[PATCH] cvsps: recognize and eliminate CVS' synthetic "file added" revisions

Greg Ward greg-hg at gerg.ca
Wed Mar 18 21:06:19 CDT 2009


On Wed, Mar 18, 2009 at 9:16 AM,  <greg-hg at gerg.ca> wrote:
> # HG changeset patch
> # User Greg Ward <greg-hg at gerg.ca>
> # Date 1237382138 14400
> # Node ID 07bad5d0e284f44f33a06e53ba3b16e062cf1969
> # Parent  166b6b12df44819a48f094d2b1699f781dec889c
> cvsps: recognize and eliminate CVS' synthetic "file added" revisions.

Oops: I forgot to mention that this is for
http://www.selenic.com/mercurial/bts/issue1558.  The motivation again:

"""
Among CVS' many charming quirks is its behaviour when you add a file on a
branch.  Specifically, in that case it adds a dead trunk revision 1.1 so that
the branch has a root for that file:

  revision 1.1
  date: 2009-03-16 08:53:13 -0400;  author: greg;  state: dead;
  branches:  1.1.2;  1.1.4;
  file file2 was initially added on branch v1_0.

Even more amusing is what happens if you then merge that file to a later branch.
 E.g. in this example, I created 'file2' on branch 'v1_0', and then merged to
'v1_1'.  CVS creates another dead revision on 'v1_1':

  revision 1.1.4.1
  date: 2009-03-16 08:53:13 -0400;  author: greg;  state: dead;  lines: +0 -0;
  file file2 was added on branch v1_1 on 2009-03-16 12:53:18 +0000

When I "hg convert" this repository, both of these synthetic revisions are
converted to hg changesets with no changes.  That is, "hg convert" preserves
this annoying artifact of CVS as a changeset that contributes nothing.

I propose dropping such changesets at conversion time.
"""

Feedback welcome!

Greg



More information about the Mercurial-devel mailing list