From a7d542e8428e9c3ef346833c939e928573663bb1 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 3 Sep 1996 23:19:51 +0000 Subject: [PATCH] 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)") --- contrib/cvs/src/rcs.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c index c68c25524a7..c4be6fd85a3 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);