[PATCH 0 of 1] convert: make convert from cvs recognise branch points correctly

Henrik Stuart henrik.stuart at edlund.dk
Tue Apr 7 06:15:06 CDT 2009


This patch fixes issue 1447. 

Currently, the full symbolic names map of the file (as returned by the CVS server) is only read in my patch for handling cvsnt mergepoints, but it is also needed to decide when files have been branched off and to what branch.

When a branch is created, each file is tagged with a "magic" branch tag on the form BRANCHNAME:<X>.0.Y where <X> is the branch point revision (i.e. the file's revision prior to the branch) and Y is a unique, even number that differentiates each branch that starts at that branch point (I've verified this to be a fact both with CVSNT and GNU CVS - other CVS servers are on their own). Branch points in CVS are per file, like all other things.

The problem, as reported in issue 1447, was that a CVS repository like this, where the file names that are modified are listed in the parenthesis:

@ BRANCH (b)
|
o HEAD (a)
|
o HEAD (b)
|
o HEAD (a, b)

was converted to Mercurial like this:

o HEAD (a)
|
| o BRANCH (b)
|/
o HEAD (b)
|
o HEAD (a, b)

thus not including the actually changed file, a, on the BRANCH. This has been rectified by extending logentry with a .branchesto list that contains the symbolic names that the file revision branches off to. This is used to fix what parent each changeset points to, by searching forward in our branch history to the latest possible point such that the commit date isn't later than our branch's initial commit date and that there are no file revisions that have a greater revision than one that is in the branch point. 

This is /only/ relevant for the initial commit on a branch, all other commits should be handled correctly.

-- 
Kind regards,
  Henrik Stuart


More information about the Mercurial-devel mailing list