bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Issuezilla #175: Add new -F style option that only allows tag to mov


From: Geoffrey Lowney
Subject: RE: Issuezilla #175: Add new -F style option that only allows tag to move to newer revision
Date: Tue, 4 May 2004 12:33:51 -0700

That's awesome Derek.

Question: The function checks that r1 is an ancestor of r2, or it checks
that r2 is a descendant of r1, depending on your point of view.  Given
this, and any CVS coding standards that may apply, would this be more
properly named is_ancestor() or is_decendant()?

Now I just need to get the latest cvs code from cvs...

Thanks

Geoffrey A. Lowney 
Senior Software Development Engineer 
Recreational Equipment, Inc. 
Phone 253-395-8164 Fax 253-437-7291 
Pager 206-625-8477 address@hidden 
address@hidden http://www.rei.com/


> -----Original Message-----
> From: Derek Robert Price [mailto:address@hidden
> Sent: Tuesday, May 04, 2004 12:21 PM
> To: Geoffrey Lowney
> Cc: Mark D. Baushke; address@hidden
> Subject: Re: Issuezilla #175: Add new -F style option that only allows
tag
> to move to newer revision
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Geoffrey Lowney wrote:
> 
> > >But I am not sure how to check that one revision is a descendant of
> > >another.  Does anyone know if there an existing function in the
code
> > >(similar to compare_revnums) that would work?  Or will I end up
having
> > >to implement a new is_descendant function to enforce this new rule?
> 
> 
> You'll need a new function.  Put it in subr.c, probably.  Assuming
> that rev1 & rev2 are already known to be valid revisions, something
> like the following should suffice:
> 
> /* The following will return true if rev1 is an ancestor of rev2.  */
> dotsrev1 = numdots (rev1);
> dotsrev2 = numdots (rev2);
> /* assert we were not passed any branches */
> assert (dotsrev1 & 1);
> assert (dotsrev2 & 1);
> if (dotsrev1 == dotsrev2)
> {
>     p = strrchr (rev1, '.');
>     *p++ = '\0';
>     q = strrchr (rev2, '.');
>     *q++ = '\0';
>     return !strcmp (rev1, rev2) && strtol (p, NULL, 10) < strtol (q,
> NULL, 10);
> }
> return strlen (rev1) < strlen (rev2) && strncmp (rev1, rev2, strlen
> (rev1));
> 
> 
> 
> Not sure if you want to special-case vendor branches or not.
> Unfortunately, in some cases it might be valid to move a tag from a
> vendor branch to the trunk and in other cases it might not and the
> difference won't be easily detectable,  I say leave it alone and let
> the user use -F if they think they know what they are doing.
> 
> Derek
> - --
>                 *8^)
> 
> Email: address@hidden
> 
> Get CVS support at <http://ximbiot.com>!
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFAl+0SLD1OTBfyMaQRAgTCAKCQMZ7Hn8X1po6Kx0Vz0io+PGx+YgCg9LF/
> wc/I3clSr3egLTtzuG8hQCU=
> =r03j
> -----END PGP SIGNATURE-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]