Changing topo sort behaviour

Greg Ward <[email protected]>
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
Hi, me again.  So, the good news is that cvs2hg is working pretty
well: it's got 5 or 6 passing tests, and I can run a moderate-sized
real-world CVS repository through it and verify the results.  Runtime
and memory usage are both comparable to cvs2svn.  So we're looking
good for strict correctness.

But there's an optimization problem: Mercurial can be quite sensitive
to the order in which changesets are added to the repository.  A
strict date ordering of certain kinds of CVS workflow can make an
enormous difference (order of magnitude) in the size of the resulting
Mercurial repository.  (See http://mercurial.selenic.com/bts/issue1716
for slightly more info.)  And with DVCS, of course, that affects every
user, not just the guy maintaining the server.

For that reason, hg's own 'convert' extension by default does a topo
sort that generates a space-optimal Mercurial repository.  Basically,
it tries to follow branches for as long as it can, and then go back
and follow other branches in turn.  (There are problems with this
algorithm, but space optimization is not one of them.)  I think I need
a way to modify/extend/replace the topo sort used by cvs2hg.
(Ideally, the user would be able to pick the desired algorithm, as
they can with 'hg convert'.)

I spent some time last night reading RevisionTopologicalSortPass, and
I'm unclear on what value it adds.  I mean, where does it sort?  It
looks like it just returns the key order from ChangesetDatabase, which
seems to be determined by the iteration order in
BreakRevisionChangesetCyclesPass.  That in turns appears to be
controlled by InitializeChangesetsPass, which I presume generates an
order based on CVS timestamps.

This all makes perfect sense for converting to Subversion, or to
Mercurial if you don't care about space-optimal ordering.  But I do.
So, if I come up with a variant of RevisionTopologicalSortPass, how do
I use it?  Obviously for testing, I can just edit the passes list at
the bottom of passes.py, but what about production use?  I need to
expose this knob to the options file somehow, and I don't see an
obvious way.  *Is* there way for users to replace an entire pass?

Thanks --

Greg

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2380832

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.