CVS conversion: making it look like merges happened

Greg Ward greg-bzr at gerg.ca
Mon Mar 23 15:15:22 GMT 2009


Hi all --

I'm evaluating VC tools to replace CVS at work.  Our repository is
fairly large: 9 years, ~50k files total, ~19k files on trunk, ~500k
CVS revisions, ~110k changesets.  Right now, Mercurial and Bazaar are
at the top of my list for all the obvious reasons (usability,
performance, features, documentation, ....)

One quirk of our workflow is that we maintain many active release
branches because, well, we have customers paying for support and
sometimes we have to fix bugs on old release branches.  Generally,
every fix is cherrypicked from release branch n to n+1 to n+2 ... to
trunk.  One obvious annoyance of moving from CVS to a DVCS is that
none of these merges are captured in the resulting DAG.  So when I
start playing in my brand-new Mercurial repository or Bazaar branch,
trying to merge branch n-1 to branch n goes horribly wrong.  (I'd like
to get away from the "cherrypick every fix" mentality and move towards
"merge branches after each fix", which is what all the DVCS tools
really want me to do.)

Right now I'm playing with this technique to create fake merge revisions:

  # go to second-oldest release branch that I care about
  cd <repo>/3-7-1
  # merge from oldest release branch and throw away the results
  bzr merge ../3-6-1
  bzr revert .
  # check that there really is a pending merge
  bzr status -v
  # commit it
  bzr commit -m"Fake merge from branch 3-6-1 to 3-7-1."

Repeat, fake merging branch n-1 onto n, up until n=trunk.

(This hack is occasionally recommended on the Mercurial mailing list.
I haven't been hanging around here long enough to know if it's
something Bazaar users do, but I thought I'd give it a try.)

Is this a completely stupid idea?  Is there a cleaner way to do it?

(Mercurial's CVS convertor supports regex detection of CVS merges,
which I think might work for us in 80% of cases.  I haven't tried it,
and strongly suspect I will still need to do a fake "whole-branch"
merge right after conversion.  But it might result in a clearer/more
accurate DAG.  I think if I want that for my Bazaar repo, I should be
talking to the cvs2{svn,git} maintainers, since I'm using cvs2git ->
bzr fast-import for the conversion.)

Thanks --

Greg



More information about the bazaar mailing list