info-cvs
[Top][All Lists]
Advanced

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

Re: How to determine the previous revision number?


From: Paul Sander
Subject: Re: How to determine the previous revision number?
Date: Thu, 7 Aug 2003 18:47:06 -0700

>--- Forwarded mail from address@hidden

>On Thu, Aug 07, 2003 at 06:42:43PM -0400, Dickson, Craig wrote:
>> Or alternatively is there a known algorithm, that given a
>> CVS revision number, can determine what the previous revision number was?

>if the last component (the Z in 1.3.2.Z) is greater than 1
>       decrement it
>else if there are more than two components
>       strip off the last two components
>else
>       // there are exactly two components, X.1
>       this was the first revision; it has no predecessor

This algorithm does not consider:
- The effects of resurrecting a file, where the predecessor is in the dead
  state.  It's unclear what the user expects here, if the predecessor is
  the dead revision, the dead revision's predecessor, or none.
- The effects of using "cvs admin" to obsolete one or more revisions.  It's
  unclear if the user expects the prior revision to be the obsolete one, the
  latest non-obsolete revision, or none.
- A "cvs add" is performed on a branch, or a join causes a new file to appear
  on a branch.  These should show no prior revision, but the RCS file state
  is indistinguishable from spawning a new branch.
- Although you alude to this in subsequent notes, the user can increment the
  trunk's major version number at any time.  The predecessor should be the
  highest revision of the highest major version number below the given one
  if the given revision matches the pattern *.1 and none if no such revision
  exists.

>--- End of forwarded message from address@hidden





reply via email to

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