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)")
This commit is contained in:
Peter Wemm 1996-09-03 23:19:51 +00:00
parent 6bce784d06
commit a7d542e842
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18028

View File

@ -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);