Given a hg revision to reset to, these scripts get the latest changes
per hg branch and print git SHA1. The user then needs to manually reset
branches as needed, tune the state file and can re-import things again.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
Unfortunately, I can't do 'import hg-fast-export' from python itself, so
we need to move some common methods into 'hg2git.py' which is to be used
as a library for common hg->git routines.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
Without really knowing the svn API, using plain svn_fs_open() complained
about a missing /foo/DB_CONFIG even on fsfs type repos. Use
svn_repos_open() to open the repo and use svn_repos_fs() to get the fs
instead of using svn_fs_open() since even the headers say I wouldn't
want to use it directly... and they're right, obviously. :)
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
* 'master' of git://repo.or.cz/hg2git: (38 commits)
hg2git.py: Only print verification message for branches we have
hg2git.py: Add simple delta revision feed
hg2git.py: Create only leightweight tags
hg2git.py: add -f/--force option to bypass validation checks
hg2git.py: Bail out for certain errors
Add a note about hg's unnamed branches and multiple heads
hg2git.py: For the first revision, feed out full manifest
hg2git.py: Don't complain die for non-existent heads
Remove SHA stability note from readme
hg2git.py: Remove leading/trailing spaces from authormap
hg2git.py: Allow for spaces in authorfile
hg2git.sh: Add usage note that argument order matters
hg2git.sh: Complete --help output's option listing
Basic support for an author map
hg2git.py: Fix typo saving status to headsfile instead of statusfile
hg2git.py: Display our max revision as progress, not tip
hg2git.py: Disable parsing Signef-off-by lines and add -s to enable
Basic support for command line options in hg2git.py
Rename README.txt to hg2git.txt
Only attempt to verify heads hg has, too
...
It's pointless for many branches to print the validation message for the
first revision already; the same counts for incremental runs.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
Now we have three methods of feeding out changes
1) full for first revision or
2) thorough delta for merges (compare checksums with all parents) or
3) simple delta else (only got with manifest)
This requires some cleanup so that we have only place where we actually
call the appropriate dumping method.
The export_file_contents() method now also sorts its file list before
writing out anything as this seems to speed up hg data retrival a bit.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
For the mutt and hg repos, it didn't make a difference, but attempting
to run the conversion on the opensolaris repo looks like this is needed.
When we attempt to export some commit, special-case the revision number
0 and export all files the manifest has while labeling this a "full
revision export". Otherwise we do what we did before labeling this a
"delta revision export".
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
Previously, when no head was present under .git/refs/heads, we simply
died as we couldn't open the file. Now, simply return None in case we
cannot read from it.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
Turns out, it isn't true though the diffs are still empty, i.e.
$ git log --name-status --no-merges b1..b2
produces bogus output when b1 is the a branch from the main hg repo and
b2 a fork of it. But
$ git diff b1..b2
still produces the correct result.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
The current regex may leave us with keys/values having trailing/leading
spaces in all flavours which will break lookup. Solution: strip() key
and value.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
By allowing spaces in keys we allow for (re-)mapping complete lines
like "Joe User <joe@host>" to be mapped to something else.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>