summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-09-03 23:19:51 +0000
committerpeter <peter@FreeBSD.org>1996-09-03 23:19:51 +0000
commitdc61174b7260da9e4f07164b67bcd25e90183745 (patch)
treeec48acbf0ecf0136db8381ade7a2e6bf760d2d48 /contrib/cvs/src
parent9abb9299ce18cbf6414a160ab18c522a0a6c97a5 (diff)
downloadFreeBSD-src-dc61174b7260da9e4f07164b67bcd25e90183745.zip
FreeBSD-src-dc61174b7260da9e4f07164b67bcd25e90183745.tar.gz
Implement a horrible (but simple) hack to allow some control over the
branch number that is assigned. This is specifically to support the local commit feature of cvsup. If one sets $CVS_LOCAL_BRANCH_NUM to (say) 1000 then branches the local repository, the revision numbers will look like 1.66.1000.xx. This is almost a dead-set certainty that there will be no conflicts with version numbers. :-) (This needs to be something more than an option to 'cvs tag' or 'cvs rtag' as various parts of cvs "know" how to automatically branch files (eg: cvs add). Trying to remember state is getting "Too Hard (TM)")
Diffstat (limited to 'contrib/cvs/src')
-rw-r--r--contrib/cvs/src/rcs.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c
index c68c255..c4be6fd 100644
--- a/contrib/cvs/src/rcs.c
+++ b/contrib/cvs/src/rcs.c
@@ -1025,13 +1025,25 @@ RCS_magicrev (rcs, rev)
char *rev;
{
int rev_num;
- char *xrev, *test_branch;
+ char *xrev, *test_branch, *local_branch_num;
xrev = xmalloc (strlen (rev) + 14); /* enough for .0.number */
check_rev = xrev;
+ local_branch_num = getenv("CVS_LOCAL_BRANCH_NUM");
+ if (local_branch_num)
+ {
+ rev_num = atoi(local_branch_num);
+ if (rev_num < 2)
+ rev_num = 2;
+ else
+ rev_num &= ~1;
+ }
+ else
+ rev_num = 2;
+
/* only look at even numbered branches */
- for (rev_num = 2; ; rev_num += 2)
+ for ( ; ; rev_num += 2)
{
/* see if the physical branch exists */
(void) sprintf (xrev, "%s.%d", rev, rev_num);
OpenPOWER on IntegriCloud