[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog rcs.c [cvs1-11-x-branch]
From: |
Mark D. Baushke |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog rcs.c [cvs1-11-x-branch] |
Date: |
Wed, 10 May 2006 02:30:33 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch: cvs1-11-x-branch
Changes by: Mark D. Baushke <address@hidden> 06/05/10 02:30:33
Modified files:
src : ChangeLog rcs.c
Log message:
Backout this patch:
* rcs.c (findhighestmagicrev_proc): New function to find the
highest magic rev with the required number of dots.
(findnextmagicrev): New function to walk the symbolic tag list
calling findhighestmagicrev_proc() to find the next unused magic
branch revision.
(RCS_magicrev): Use findnextmagicrev().
(Patch suggested by "Kelly F. Hickel" <address@hidden> based
on advice from Larry Jones.)
As implemented, this function finds the highest rev across *all*
branches with the right number of dots, not just branches rooted at
the same revision. So, for example, if you have a number of branches
off 1.1 -- 1.1.0.2, 1.1.0.4, and 1.1.0.6, for example -- and then
create a new branch off of 1.2, you'll get 1.2.0.8 instead of 1.2.0.2
like you should. In fact, it checks *all* tags with the right number
of dots, not just magic branch tags, so plain revision tags will
pollute the branch number, too.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/ChangeLog.diff?only_with_tag=cvs1-11-x-branch&tr1=1.2336.2.443&tr2=1.2336.2.444&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/rcs.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.262.4.50&tr2=1.262.4.51&r1=text&r2=text
Patches:
Index: ccvs/src/ChangeLog
diff -u ccvs/src/ChangeLog:1.2336.2.443 ccvs/src/ChangeLog:1.2336.2.444
--- ccvs/src/ChangeLog:1.2336.2.443 Tue May 9 20:50:03 2006
+++ ccvs/src/ChangeLog Wed May 10 02:30:32 2006
@@ -1,14 +1,3 @@
-2006-05-09 Mark D. Baushke <address@hidden>
-
- * rcs.c (findhighestmagicrev_proc): New function to find the
- highest magic rev with the required number of dots.
- (findnextmagicrev): New function to walk the symbolic tag list
- calling findhighestmagicrev_proc() to find the next unused magic
- branch revision.
- (RCS_magicrev): Use findnextmagicrev().
- (Patch suggested by "Kelly F. Hickel" <address@hidden> based
- on advice from Larry Jones <address@hidden>.)
-
2006-05-04 Mark D. Baushke <address@hidden>
* filesubr.c (cvs_temp_file): Avoid keeping pointers to free()'d
Index: ccvs/src/rcs.c
diff -u ccvs/src/rcs.c:1.262.4.50 ccvs/src/rcs.c:1.262.4.51
--- ccvs/src/rcs.c:1.262.4.50 Tue May 9 23:32:52 2006
+++ ccvs/src/rcs.c Wed May 10 02:30:32 2006
@@ -133,8 +133,6 @@
static FILE *rcs_internal_lockfile PROTO ((char *));
static void rcs_internal_unlockfile PROTO ((FILE *, char *));
static char *rcs_lockfilename PROTO ((const char *));
-static int findnextmagicrev PROTO ((RCSNode *rcs, char *rev, int default_rv));
-static int findhighestmagicrev_proc PROTO((Node *p, void *closure));
/* The RCS file reading functions are called a lot, and they do some
string comparisons. This macro speeds things up a bit by skipping
@@ -2551,13 +2549,8 @@
xrev = xmalloc (strlen (rev) + 14); /* enough for .0.number */
check_rev = xrev;
- /* prime the pump by finding the next unused magic rev,
- * if none are found, it should return 2.
- */
- rev_num = findnextmagicrev (rcs, rev, 2);
-
/* only look at even numbered branches */
- for ( ; ; rev_num += 2)
+ for (rev_num = 2; ; rev_num += 2)
{
/* see if the physical branch exists */
(void) sprintf (xrev, "%s.%d", rev, rev_num);
@@ -8829,66 +8822,3 @@
}
return label;
}
-
-/*
- * Go through the symbolic tag list, find the next unused magic
- * branch revision.
- *
- * Returns defaultrv if it can't figure anything out, then the caller
- * will end up doing a linear search.
- */
-static int findnextmagicrev_dots;
-static int
-findnextmagicrev (rcs, rev, defaultrv)
- RCSNode *rcs;
- char *rev;
- int defaultrv;
-{
- int rv = defaultrv;
-
- /* Tell the walklist proc how many dots we're looking for,
- * which is the number of dots in the existing rev, plus
- * 2. one for RCS_MAGIC_BRANCH and one for the new rev number.
- */
- findnextmagicrev_dots = numdots (rev) + 2;
-
- /* walk the symbols list to find the highest revision. */
- (void) walklist (RCS_symbols (rcs), findhighestmagicrev_proc, &rv);
-
- /* adjust to next even number if we found something */
- if (rv != defaultrv)
- {
- if ((rv % 2) != 0)
- rv++;
- else
- rv += 2;
- }
-
- return rv;
-}
-
-/*
- * walklist proc to find the highest magic rev with
- * the required number of dots.
- */
-static int
-findhighestmagicrev_proc (p, closure)
- Node *p;
- void *closure;
-{
- int *rev = (int *) closure;
-
- if (numdots (p->data) == findnextmagicrev_dots)
- {
- /* if the last term of the rev is greater than the current
- max, update */
- char *cp = strrchr (p->data, '.');
- if ((cp != NULL) && (cp[1] != 0))
- {
- int new_rev = atoi (cp + 1);
- if (new_rev > *rev)
- *rev = new_rev;
- }
- }
- return 1;
-}