Commit Graph

115 Commits

Author SHA1 Message Date
Rocco Rutte
fdbb1decaa hg2git: Update copyrights and maintainership information.
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2008-11-25 11:25:22 +01:00
Fabrizio Chiarello
1ab60e492b 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>
2008-09-19 08:03:44 +02:00
Rocco Rutte
02bc08886f hg-fast-export: Catch up with mercurial crew API changes
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2008-09-19 08:01:53 +02:00
Peter Colberg
e8ba36aa3f hg-fast-export.py: Use appropriate file mode for symlinks. 2008-09-19 07:55:45 +02:00
Jonathan Nieder
6e3872b6a0 hg-fast-export.py: sanitize tildes (~) in branch names
In git-check-ref-format (1), there is the following rule for refnames:

	3. It cannot have ASCII control character (i.e. bytes
	   whose values are lower than \040, or \177 DEL), space,
	   tilde ~, caret ^, colon :, question-mark ?, asterisk *,
	   or open bracket [ anywhere;

and indeed, this rule is enforced by "git fast-import". hg-fast-export
already checked for all of the visible characters listed except for ~
and converted them to underscores. For some reason the tilde was
forgotten. This patch makes good on the omission.

Note that control characters are still left alone.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2008-06-03 08:49:57 +02:00
Rocco Rutte
bc98d2c088 hg-fast-export.py: Cache possibly sanitized branch names
...instead of doing it for every single commit.

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-10-26 17:11:57 +02:00
Rocco Rutte
4cc930807d hg-fast-import.py: Sanitize ref names
At least the opensolaris hg repo has tag names containing '*',
so sanitize all branch and tag names roughly according to the
specs for git-check-ref-format(1).

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-10-26 16:06:40 +02:00
Rocco Rutte
431c32de6b hg-fast-export.py: Don't attempt to dump revs beyond tip with -m
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-10-25 15:23:17 +02:00
Rocco Rutte
ec1be3d05f hg-fast-export.py: Minor tweaks/cleanup
Remove some unused variables, generalize dictionary-splitting and make
sure we don't sort filename lists twice (repo.status returns files
sorted already).

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-10-25 15:21:46 +02:00
Rocco Rutte
ee510bb022 hg-fast-export.py: Rewrite merge logic
Merges were completely broken as they ended up with twice the same
parent in git. Still everything besides gitk seemed to work.

This because of 1) the incorrect assumption that a commit's parent is
the commit exported right before it and 2) some confusion with markes
being saved/loaded/used since git-fast-import doesn't allow for a ":0"
mark to map hg revision 1:1 to marks.

The merge "algorithm" now works like this:

1) If the commit's higher parent (highest hg rev), is not the last
commit exported for a particular branch, we issue a "from" command to
place it on top of it.

2) If the commit's lower parent exists, we issue a "merge" for it.

This is much simpler and seems to produce correct merges in git. And
while I'm at it, make output less confusing by prepending the target
branch name to each line.

The "twice the same parent" bug was discovered by Michele Ballabio on
the git list.

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-10-22 10:06:58 +02:00
Rocco Rutte
5cc155e367 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>
2007-03-19 09:27:37 +00:00
Rocco Rutte
f1397c068b hg-fast-export.py: Fix option presence checking
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-03-19 09:05:51 +00:00
Rocco Rutte
7044bdd4d1 Add hg2git.py with library routines
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>
2007-03-19 08:45:42 +00:00
Rocco Rutte
30ce6693ed hg-fast-export.py: Kill stale usage() and __doc__
Both are obsolete since using the option parser.

Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-03-14 10:32:33 +00:00
Rocco Rutte
c84790da82 Use MIT license, adjust hg2git script names to match fast-export repo style
Signed-off-by: Rocco Rutte <pdmef@gmx.net>
2007-03-14 10:29:24 +00:00