eazysvn lives in a Subversion
repository. I want to bring it (kicking and screaming) into the 21st century
and put it on Github.
git-svn is unsuitable for the conversion, because in revision 50 I moved
/ to /trunk and added the traditional /tags and /branches. With git-svn I
either get one third of the history that ignores everything before the layout
switch, or I get directories named 'trunk', 'tags' and 'branches'.
Then I thought maybe hg would be smarter about the conversion, and then I
could use hg-fast-export to convert hg to git. I enabled the hgsubversion
extension:
$ sudo apt-get install hgsubversion
$ echo '[extensions'] >> ~/.hgrc
$ echo 'hgsubversion =' >> ~/.hgrc
(blog posts like this are a good reason why hg ought to steal the 'git
config --global foo.bar=baz' syntax from git).
Then I converted the svn repository to Mercurial:
$ hg clone svn+ssh://fridge/home/mg/svn/eazysvn eazysvn-hg
hg log -p confirmed that hg handled the conversion nicely looked
right-ish at first glance, except the author information was nonsensical. To
fix that:
$ rm -rf eazysvn-hg
$ echo 'mg = Marius Gedminas <marius@gedmin.as>' > AUTHORS
$ hg clone svn+ssh://fridge/home/mg/svn/eazysvn eazysvn-hg -A AUTHORS
Unfortunately, a closer look at hg log now shows that two thirds of the
history is lost: hg ignored everything before the layout restructuring, despite
printing the log messages of those revisions as it went about the conversion.
*sigh*.
Dear lazyweb, surely svn layout reorganization can't be such a rare thing
that no tools in existence support it? What should I try next?
P.S. I also tried Bazaar, to see what it would do:
$ bzr branch svn+ssh://fridge/home/mg/svn/eazysvn eazysvn-bzr
Repository with UUID 4fc293c4-4eed-0310-a01a-b4ad72f90fad at svn+ssh://fridge/home/mg/svn/eazysvn contains fewer revisions than cache. This either means that this repository contains an out of date mirror of another repository (harmless), or that the UUID is being used for two different Subversion repositories (potential repository corruption).
bzr: ERROR: exceptions.KeyError: 'missing revision paths for 78'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 946, in exception_to_return_code
return the_callable(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1150, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 699, in run_argv_aliases
return self.run(**all_cmd_args)
File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 721, in run
return self._operation.run_simple(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
self.cleanups, self.func, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
result = func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 1263, in run
from_location)
File "/usr/lib/python2.7/dist-packages/bzrlib/bzrdir.py", line 919, in open_tree_or_branch
return bzrdir._get_tree_branch()
File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 410, in _get_tree_branch
branch = self.open_branch(name=name)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/remote.py", line 420, in open_branch
branch_path = self._determine_relpath(name)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/remote.py", line 369, in _determine_relpath
layout = repos.get_layout()
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/repository.py", line 701, in get_layout
return self.get_layout_source()[0]
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/repository.py", line 720, in get_layout_source
self._find_guessed_layout(self.get_config())
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/repository.py", line 743, in _find_guessed_layout
revnum, self._hinted_branch_path)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/layout/guess.py", line 143, in repository_guess_layout
return logwalker_guess_layout(repository._log, revnum, branch_path=branch_path)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/layout/guess.py", line 149, in logwalker_guess_layout
logwalker.iter_changes(None, revnum, max(0, revnum-GUESS_SAMPLE_SIZE)), revnum, branch_path)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/layout/guess.py", line 104, in guess_layout_from_history
for (revpaths, revnum, revprops) in changed_paths:
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/logwalker.py", line 60, in iter_all_changes
revpaths = get_revision_paths(revnum)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/logwalker.py", line 295, in get_revision_paths
return self.cache.get_revision_paths(revnum)
File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/cache/tdbcache.py", line 187, in get_revision_paths
raise KeyError("missing revision paths for %d" % revnum)
KeyError: 'missing revision paths for 78'
You can report this problem to Bazaar's developers by running
apport-bug /var/crash/bzr.1000.2012-02-19T22:12.crash
if a bug-reporting window does not automatically appear.