Re: Proposal: Land Greg Ward's patchset immediately

Greg Ward <[email protected]> Sat, 17 Oct 2009 13:02:47 -0400
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
On Fri, Oct 16, 2009 at 4:50 PM, I wrote:
> Thus, I do NOT recommend that you grab the latest state of my public
> repo.  Instead, you should pester me mercilessly until I cough up the
> complete series of 30 or so patches, polished to shining perfection
> and ruthlessly tested.  Then commit 'em all.  (I have not put time
> into this because I've been waiting for someone to ask for more.
> Polishing patches is a lot of work.)

Getting closer.  I need to run the full test suite on every patch
before you go committing anything.  But just for fun, here's how you
can combine an svn checkout of cvs2svn with my patch queue:

# setup: get a trunk checkout and add my Mercurial patch queue to it
svn checkout http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn
cd cvs2svn
hg init
hg commit -A -m"init: add everything " -X "**.svn"
hg clone http://vc.gerg.ca/hg/cvs2svn-patches .hg/patches

# review each patch
while patches left in queue:
  # apply patch and review it
  hg qpush
  hg tip -vp

  # svn add any new files
  svn status | awk '/^\?/ && !/\.hg/ {print $2}' | xargs svn add

  # review svn's idea of the patch (should be the same as hg tip -vp!)
  svn diff

  # see my commit message
  hg tip --template "{desc}\n"

  # maybe not quite ready for this yet ;-)
  #svn commit

Or, if you prefer, here is the core patch set with my commit message
and a URL for each patch:

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/raw-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
- use and maintain self._mirror
- factor _commit() out of process_primary_commit()
- write and commit .hgtags after converting everything

http://vc.gerg.ca/hg/cvs2svn-patches/raw-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/raw-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/raw-file/tip/hg-output-record-branch.patch

5) 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/raw-file/tip/hg-output-dummy-merge-tag-fixups.patch

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

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

7) 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/raw-file/tip/hg-output-gc.patch

8) 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/raw-file/tip/hg-output-split-creation-branches.patch

9) 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/raw-file/tip/run-tests-start-refactoring.patch

10) 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/raw-file/tip/run-tests-cvs2hg-main.patch

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

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

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

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

13) hg_output_option: convert CVS executable bit to Mercurial 'x' flag.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-output-executable-flag.patch

14) hg_output_option: handle empty CVS trunk.
- when committing .hgtags, do not assume that 'default' exists
  -- just commit on the same branch as tip right after tip
- add test case empty_trunk_hg()

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

15) hg_output_option: first crack at implementing process_post_commit().
It's a bit of a hack, but it seems to mostly work.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-output-post-commit.patch

16) run-tests: test handling "post" commits: add
branch_from_default_branch_hg().

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

17) Edit cvs2hg-example.options so it makes sense; add a test using it.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/cvs2hg-example-options.patch

18) README.cvs2hg: add braindump readme that should eventually be
merged into the real HTML docs.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-readme.patch

19) hg_output_option: improve logging.

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

20) hg_output_option: do not assume tags have only one source branch.
(When they have more than one, just pick an arbitrary one as the
Mercurial branch where the fixup commit lives.)

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

21) hg_output_option: correctly detect when a tag or branch is a simple copy.
Done by using new MirrorUpdater class, so HgOutputOption does the same
to its RepositoryMirror as GitOutputOption does.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-output-fixup-copy.patch

22) Add support for author_transforms to HgOutputOption.
- make DVCSOutputOption.normalize_author_transforms() responsible for
  formatting (name, email) into "name <email>"
- add HgOutputOption._get_author()
- add test case author_transform_hg()

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-author-transforms.patch

23) hg_output_option: unconditionally suppress CVS keyword expansion.
Needed to pass verification tests, but kind of evil because
it reduces user control.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-output-suppress-keyword.patch

24) hg_output_option: be smarter when creating fixup commits:
don't ask Mercurial to commit all the files that are unchanged since
the first parent, since that's a big waste of time and I/O.

http://vc.gerg.ca/hg/cvs2svn-patches/raw-file/tip/hg-output-smarter-fixups.patch

(I have more patches in my queue after that, but they are the more
experimental features.  I'm inclined to hold them back until the core
stuff gets in: one thing at a time.)

Greg

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

To unsubscribe from this discussion, e-mail: [[email protected]].