box.matto.nl
Enjoying Open Source Software

Rcsclean in OpenRCS

Introduction

When using rcsclean in OpenRCS, files that contain expanded keywords are not recognized as unchanged after the last checkout, and therefore are not removed.

Description of rcsclean from the man page:

 The rcsclean program is used to clean up (remove) files that are not
 being worked on.  Only checked out files from the current working
 directory are removed.

The idea behind rcsclean is that you remove all the files in your current working directory that have not changed since the last checkout. This prevents removing files that have un-committed changes.

Here there is a major difference between OpenRCS and GNU RCS. OpenRCS doesnot clean files that have expanded keywords, GNU RCS does.

Checkin and checkout cycle on OpenRCS

Here is how it works on OpenRCS (on OpenBSD):

Without keywords:

$ mkdir -p test/RCS
$ cd test
$ echo 'First line' > testfile
$ ci -u -t-"file" -m"Start versioning" testfile
RCS/testfile,v  <--  testfile
initial revision: 1.1
done
$ co -l testfile
RCS/testfile,v  -->  testfile
revision 1.1 (locked)
done
$ rcsclean -u
rcs -u1.1 RCS/testfile,v
rm -f testfile

Now, add a keyword and check in for keyword expansion:

$ echo '$Id: rcsclean,v 1.4 2018/08/25 18:30:48 matto Exp matto $' >> testfile
$ ci -u -m"Add id" testfile
RCS/testfile,v  <--  testfile
revision 1.2 (unlocked)
done
$ rcsclean -u
$

So, no rm -f testfile here ...

The keyword '$Id: rcsclean,v 1.4 2018/08/25 18:30:48 matto Exp matto $' is expanded and now rcsclean cannot recognize that the file has not changed since the last checkout. Also, after multiple cycles of checking in changes to the file and checking the file out again, this doesnot change.

Most of the time, the extra options that the GNU utilities offer, make life a little easier, but here the difference in functionality is quite strong.

Tags:

⇽ Lynx without cookies Scripting with ed and here documents ⇾