Test if any RCS-controlled files in tree are not checked in
2
votes
2
answers
1242
views
I have multiple project trees of legacy code that are using RCS for version control with multiple users. I'd like to be able to walk the tree and test if any files are checked out (and thus the tree is not ready to be packaged for distribution update).
For example, I have a test tree:
tree -p .
.
├── [-r--r--r--] file1
├── [drwxrwxr-x] RCS
│ └── [-r--r--r--] file1,v
├── [drwxrwxr-x] subdir1
│ ├── [drwxrwxr-x] RCS
│ │ └── [-r--r--r--] sfile1,v
│ └── [-rw-r--r--] sfile1
└── [drwxrwxr-x] subdir2
├── [drwxrwxr-x] RCS
│ └── [-r--r--r--] sfile2,v
└── [-r--r--r--] sfile2
5 directories, 6 files
In which all files but sfile1
are checked in to their respective RCS dirs. sfile1
has been checked out and modified.
rlog subdir1/sfile1
(a file that is properly checked-out) returns:
RCS file: subdir1/RCS/sfile1,v
Working file: subdir1/sfile1
head: 1.1
branch:
locks: strict
torfey: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
----------------------------
revision 1.1 locked by: torfey;
date: 2016/07/20 13:09:34; author: torfey; state: Exp;
Initial revision
=============================================================================
Whereas rlog subdir2/sfile2
(a file that is properly checked-in) returns:
RCS file: subdir2/RCS/sfile2,v
Working file: subdir2/sfile2
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
----------------------------
revision 1.1
date: 2016/07/20 13:10:04; author: torfey; state: Exp;
Initial revision
=============================================================================
So the command I'd like would, given a directory argument, search for all files under that dir that are part of RCS and return names of any that are not checked in. (Ideally, also if there's some other state that is detectable and bad, like not locked yet different from checked in version, report that too.)
test_rcs_tree .
It would return, for my above simple case:
./subdir1/sfile1 checked-out
What I'm struggling with is whether there's maybe something out there that already does this that I'm just missing in all my searches.
I'm running on RHEL 6.7 which has rcs 5.7, gnu awk 3.1.7, gnu make 3.81, bash 4.1.2
Asked by Torfey
(23 rep)
Jul 20, 2016, 02:28 PM
Last activity: Jul 20, 2016, 09:39 PM
Last activity: Jul 20, 2016, 09:39 PM