PATCHES: start adding Mercurial backend (HgOutputOption)

Greg Ward <[email protected]>
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
I've finally started assembling a patch queue that adds the Mercurial
backend, HgOutputOption.  This is a pretty big patch series, so hang
on to your hats.  And you should consider this preliminary; I'm still
running the test suite on every patch, and might do more to collapse
trivial patches into the big ones.  Your comments are welcome.  I'm
particularly interested to hear what folks think of the testing
strategy, introduced in patch #12 and elaborated in #13 and #14.

Here's the first half of the patch series, which gives us a rough 'n
ready HgOutputOption that is incomplete, but pretty thoroughly tested:

1) Add skeletal hg_output_option with support for primary commits only.

* cvs2svn_lib/hg_output_option.py: new module

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-primary.patch

2) hg_output_option: initial support for adding tags
- flesh out process_tag_commit()
- track Hg changesets in self.changesets
- track tags in self.tags (not written to .hgtags yet!)
- adjust to changes in DVCSOutputOption
- use and maintain self._mirror
- factor _commit() out of process_primary_commit()
- write and commit .hgtags after converting everything
[OOPS: just realized that checkin comment is inaccurate... well, I'm
sure there are other errors that will be corrected when I resend]

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-tags.patch

3) hg_output_option: initial support for branch creation.
- factor _create_fixup_changeset() out of process_tag_commit()
- add branch support to _commit()
- flesh out process_branch_commit()

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-branches.patch

4) hg_output_option: record the branch of each tag and primary commit.
(Without this, branch support was a bit of a joke: all we did was
create branches.  Now they actually have some changesets.)

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-record-branch.patch

5) Tweak comments.

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-comments.patch

6) hg_output_option: use dummy merges to avoid many-headed repository.
- track pending (unmerged) fixup changesets
- whenever we're about to commit a changeset, check if there is
  a pending fixup and, if so, dummy merge it in
- at the end of conversion, do a final round of dummy merges to make
  sure there are no remaining heads created by fixup changesets
  (this is actually necessary for correctness: without it,
  the tip of default might not be the same as the head of CVS trunk)

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-dummy-merge-tag-fixups.patch

7) Simpler way to find the trunk when writing .hgtags.

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-hgtags-simplify-trunk.patch

8) hg_output_option: countermand cvs2svn default and enable GC.
This is particularly important under Mercurial 1.3, which seems to
have a reference cycle somewhere (memory use grows quickly without GC).
Also, do a preemptive GC run after conversion to avoid warning.

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-gc.patch

9) hg_output_option: fix so branches with a "split" creation work.
- add _create_second_coming()
- modify process_branch_commit() to call it when appropriate
- factor _get_source_changesets(), _commit_fixup() out of
  _create_fixup_changeset()

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/hg-output-split-creation-branches.patch

10) run-tests: fix some out-of-date git-related comments.

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/run-tests-git-comments.patch

11) run-tests: start refactoring for testing cvs2hg.
- turn GitConversion into DVCSConversion
- rewrite main_hg() test case to run cvs2hg with direct conversion

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/run-tests-start-refactoring.patch

12) run-tests: test output of cvs2hg directly.
Use the Mercurial API to open and read the repository and test, in gory
detail, that it contains exactly what we expect it to contain.

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/run-tests-cvs2hg-main.patch

13) run-tests: yet more testing in main_hg().

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/run-tests-hg-split-branch.patch

14) run-tests: in main_hg(), test that heads == branch heads

http://vc.gerg.ca/hg/cvs2svn-patches/file/tip/run-tests-hg-heads.patch

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

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.