Re: [viewvc-users] Add/remove/re-add file in CVS

"C. Michael Pilato" <[email protected]> Fri, 2 Aug 2013 09:39:03 -0400
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Message-ID <[email protected]>
On 08/01/2013 07:15 PM, Jan Smets wrote:
> Hi
> 
> I have this situation where a CVS file was added, removed and re-added
> again on the HEAD branch. I would expect ViewVC to set the type to "Add"
> for rev 1.3 of this file. 
> Is this a bug? If not, can you please explain the idea behind it. (I
> verified that the behaviour is the same in 1.0/1.1/1.2dev)

ViewVC is simply relating the information that CVS tells it.  If you
were to run 'cvs log' on your file, you would probably find that CVS
reports changes (in the form of added and removed lines) in the file for
every revision except the first.  ViewVC interprets any revision that
has this attribute as a "change" to the file unless that revision is
also marked as "dead" (which is obviously a deletion).

Arguably, ViewVC could try to detect that in the previous revision (1.2)
the file was "dead", therefore it must have been re-added in revision 1.3.

But CVS isn't like Subversion, where files that happen to share a path
at different times throughout revision history remain distinct from one
another.  If anything, CVS's behavior in this regard is more like
Subversion's add-with-history (aka "copy") behavior.  To CVS, your
deleted file's history was simply resumed in 1.3 from its pre-deletion
state, quite possibly with a bunch of text changes (up to and including
replacing every line in the file with something else).  Yes, you use
'cvs add' to accomplish this, but maybe the as-yet-unwritten command
'cvs undelete' would have been a closer semantic fit here.

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=3061893

To unsubscribe from this discussion, e-mail: [[email protected]].