Add option for specifying the text encoding used by Mercurial When a mercurial repository does not use utf-8 for encoding author strings and commit messages the "-e <encoding>" command line option can be used to force fast-export to convert incoming meta data from <encoding> to utf-8. When "-e <encoding>" is given, we use Python's string decoding/encoding API to convert meta data on the fly when processing commits.
Merge pull request #6 from aried3r/master Fix for Mercurial 2.3 compatibility
Organized imports After an update to Mercurial 2.3 the module 'repo' was removed and the program crashed when trying to convert a repository. I checked the imports with 'pyflakes' and removed all unused ones, repo (among others) was never used. http://www.selenic.com/repo/hg/rev/1ac628cd7113#l9.1
Make hg-fast-export work on Windows * use sys.stdout.write instead of print to avoid end-of-line issues * use os.devnull instead of hard-coding /dev/null
Support the case where the author field has an empty email address, i.e. it is of the form 'name <>'.
Use hg methods to extract name and email when doing user fixup
Remove \" from the user string before trying to extract name and email Signed-off-by: Frej Drejhammar <frej.drejhammar@gmail.com> Reported-by: Cole Robinson <crobinso@redhat.com> Thank's to Cole Robinson for reporting the bug and providing a fix which was adapted to this patch. The original bug report: I was recently converting a few mercurial repositories to git, and noticed certain commits had their date reset to Jan 1 1970. An example repo: http://hg.fedorahosted.org/hg/virt-manager An example commit: http://hg.fedorahosted.org/hg/virt-manager/rev/41182500ddef After some poking, it seems the culprit was that the "author:" was surrounded by quotation marks
Maintain backwards compatibility for ui setup Signed-off-by: Rocco Rutte <pdmef@gmx.net>
Update to work with mercurial ui refactorings Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg-fast-export: add option to track remote branches under a custom namespace Add -o, --origin <name> to allow user to set a namespace used when importing remote branches. Signed-off-by: Fabrizio Chiarello <ponch@autistici.org>
hg2git: Update copyrights and maintainership information. Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg-fast-export: Make default branch customizable Add -M, --default-branch <branch_name> to allow user to set the default branch where to pull into Signed-off-by: Fabrizio Chiarello <ponch@autistici.org>
hg-fast-export: work still if git-commands are not in PATH In git 1.6.0, most git tools with a dash in the name will no longer be installed in $bindir. This patch makes hg-fast-export use the "git <command>" form so it will work even if "git" is the only piece of git machinery in the user's PATH. On the other hand, the "git <command>" form does not help for sourcing a shell script (with "."). So use the full path to source "git-sh-setup". Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Revert "hg2git: Replaces space with "_" in branches name" The get_branch() function's purpose is to detect whether a mercurial branch name actually should be considered the default branch. Sanitizing branch and tag names for git is done in sanitize_name(). Noted by Jonathan Nieder. This reverts commit cdfdae36c8a73fb257eceff33b03d2f320bafc6b.
Clarify where 'HEAD' branch name comes from Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg2git: Replaces space with "_" in branches name Since space doesn't conform to GIT branches name standards, it should be replaced or with another character. Signed-off-by: Felipe Zimmerle <felipe.zimmerle@indt.org.br> Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg2git.py: Allow consumers to modify keys of dicts returned by load_cache() By default, the key is not changed. This will allow us for fixing up the off-by-one issue with marks restored using load_cache(). Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg2git.py: Use git-rev-parse to get SHA1s instead of reading files below refs/ directly This should now also properly support packed refs. Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg2git.py: Map 'HEAD', 'default' and '' hg branches to 'master' in git Also add a note where HEAD is comming from. Signed-off-by: Rocco Rutte <pdmef@gmx.net>
hg-reset.py: Print details for changed branches only It doesn't make sense to suggest resetting branch HEADs to their current value. Signed-off-by: Rocco Rutte <pdmef@gmx.net>