Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
hg-to-git: rewrite "git-frotz" to "git frotz"
author
Miklos Vajna
<vmiklos@frugalware.org>
Sun, 6 Jul 2008 03:15:19 +0000
(
05:15
+0200)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 6 Jul 2008 06:35:12 +0000
(23:35 -0700)
This is not just nice but necessary since git-frotz is no longer in
PATH.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/hg-to-git/hg-to-git.py
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2553ede
)
diff --git
a/contrib/hg-to-git/hg-to-git.py
b/contrib/hg-to-git/hg-to-git.py
index 130b1c4bcda98354dd1b599bc2a4788985fa6beb..61540ef806e67e35022301f4a3fbd5e710b7ddb1 100755
(executable)
--- a/
contrib/hg-to-git/hg-to-git.py
+++ b/
contrib/hg-to-git/hg-to-git.py
@@
-152,7
+152,7
@@
def getgitenv(user, date):
if not hgvers.has_key("0"):
print 'creating repository'
if not hgvers.has_key("0"):
print 'creating repository'
- os.system('git
-
init-db')
+ os.system('git
init-db')
# loop through every hg changeset
for cset in range(int(tip) + 1):
# loop through every hg changeset
for cset in range(int(tip) + 1):
@@
-194,10
+194,10
@@
def getgitenv(user, date):
if cset != 0:
if hgbranch[str(cset)] == "branch-" + str(cset):
print 'creating new branch', hgbranch[str(cset)]
if cset != 0:
if hgbranch[str(cset)] == "branch-" + str(cset):
print 'creating new branch', hgbranch[str(cset)]
- os.system('git
-
checkout -b %s %s' % (hgbranch[str(cset)], hgvers[parent]))
+ os.system('git
checkout -b %s %s' % (hgbranch[str(cset)], hgvers[parent]))
else:
print 'checking out branch', hgbranch[str(cset)]
else:
print 'checking out branch', hgbranch[str(cset)]
- os.system('git
-
checkout %s' % hgbranch[str(cset)])
+ os.system('git
checkout %s' % hgbranch[str(cset)])
# merge
if mparent:
# merge
if mparent:
@@
-206,7
+206,7
@@
def getgitenv(user, date):
else:
otherbranch = hgbranch[parent]
print 'merging', otherbranch, 'into', hgbranch[str(cset)]
else:
otherbranch = hgbranch[parent]
print 'merging', otherbranch, 'into', hgbranch[str(cset)]
- os.system(getgitenv(user, date) + 'git
-
merge --no-commit -s ours "" %s %s' % (hgbranch[str(cset)], otherbranch))
+ os.system(getgitenv(user, date) + 'git
merge --no-commit -s ours "" %s %s' % (hgbranch[str(cset)], otherbranch))
# remove everything except .git and .hg directories
os.system('find . \( -path "./.hg" -o -path "./.git" \) -prune -o ! -name "." -print | xargs rm -rf')
# remove everything except .git and .hg directories
os.system('find . \( -path "./.hg" -o -path "./.git" \) -prune -o ! -name "." -print | xargs rm -rf')
@@
-215,9
+215,9
@@
def getgitenv(user, date):
os.system('hg update -C %d' % cset)
# add new files
os.system('hg update -C %d' % cset)
# add new files
- os.system('git
-ls-files -x .hg --others | git-
update-index --add --stdin')
+ os.system('git
ls-files -x .hg --others | git
update-index --add --stdin')
# delete removed files
# delete removed files
- os.system('git
-ls-files -x .hg --deleted | git-
update-index --remove --stdin')
+ os.system('git
ls-files -x .hg --deleted | git
update-index --remove --stdin')
# commit
os.system(getgitenv(user, date) + 'git commit --allow-empty -a -F %s' % filecomment)
# commit
os.system(getgitenv(user, date) + 'git commit --allow-empty -a -F %s' % filecomment)
@@
-225,20
+225,20
@@
def getgitenv(user, date):
# tag
if tag and tag != 'tip':
# tag
if tag and tag != 'tip':
- os.system(getgitenv(user, date) + 'git
-
tag %s' % tag)
+ os.system(getgitenv(user, date) + 'git
tag %s' % tag)
# delete branch if not used anymore...
if mparent and len(hgchildren[str(cset)]):
print "Deleting unused branch:", otherbranch
# delete branch if not used anymore...
if mparent and len(hgchildren[str(cset)]):
print "Deleting unused branch:", otherbranch
- os.system('git
-
branch -d %s' % otherbranch)
+ os.system('git
branch -d %s' % otherbranch)
# retrieve and record the version
# retrieve and record the version
- vvv = os.popen('git
-
show --quiet --pretty=format:%H').read()
+ vvv = os.popen('git
show --quiet --pretty=format:%H').read()
print 'record', cset, '->', vvv
hgvers[str(cset)] = vvv
if hgnewcsets >= opt_nrepack and opt_nrepack != -1:
print 'record', cset, '->', vvv
hgvers[str(cset)] = vvv
if hgnewcsets >= opt_nrepack and opt_nrepack != -1:
- os.system('git
-
repack -a -d')
+ os.system('git
repack -a -d')
# write the state for incrementals
if state:
# write the state for incrementals
if state: