@matheusbsbs / matheus-bagliano / commits / 96f2395951
Fork 0

hg-to-git: rewrite "git-frotz" to "git frotz"

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>

Miklos Vajna committed Jul 6, 2008 at 05:15 UTC 96f2395951fd81ad49217d49074dfbcf3f0df685
1 file changed +10 -10
contrib/hg-to-git/hg-to-git.py
+10 -10
@@ -152,7 +152,7 @@ for cset in range(1, int(tip) + 1):
152
153 if not hgvers.has_key("0"):
154 print 'creating repository'
155 - os.system('git-init-db')
155 + os.system('git init-db')
156
157 # loop through every hg changeset
158 for cset in range(int(tip) + 1):
@@ -194,10 +194,10 @@ for cset in range(int(tip) + 1):
194 if cset != 0:
195 if hgbranch[str(cset)] == "branch-" + str(cset):
196 print 'creating new branch', hgbranch[str(cset)]
197 - os.system('git-checkout -b %s %s' % (hgbranch[str(cset)], hgvers[parent]))
197 + os.system('git checkout -b %s %s' % (hgbranch[str(cset)], hgvers[parent]))
198 else:
199 print 'checking out branch', hgbranch[str(cset)]
200 - os.system('git-checkout %s' % hgbranch[str(cset)])
200 + os.system('git checkout %s' % hgbranch[str(cset)])
201
202 # merge
203 if mparent:
@@ -206,7 +206,7 @@ for cset in range(int(tip) + 1):
206 else:
207 otherbranch = hgbranch[parent]
208 print 'merging', otherbranch, 'into', hgbranch[str(cset)]
209 - os.system(getgitenv(user, date) + 'git-merge --no-commit -s ours "" %s %s' % (hgbranch[str(cset)], otherbranch))
209 + os.system(getgitenv(user, date) + 'git merge --no-commit -s ours "" %s %s' % (hgbranch[str(cset)], otherbranch))
210
211 # remove everything except .git and .hg directories
212 os.system('find . \( -path "./.hg" -o -path "./.git" \) -prune -o ! -name "." -print | xargs rm -rf')
@@ -215,9 +215,9 @@ for cset in range(int(tip) + 1):
215 os.system('hg update -C %d' % cset)
216
217 # add new files
218 - os.system('git-ls-files -x .hg --others | git-update-index --add --stdin')
218 + os.system('git ls-files -x .hg --others | git update-index --add --stdin')
219 # delete removed files
220 - os.system('git-ls-files -x .hg --deleted | git-update-index --remove --stdin')
220 + os.system('git ls-files -x .hg --deleted | git update-index --remove --stdin')
221
222 # commit
223 os.system(getgitenv(user, date) + 'git commit --allow-empty -a -F %s' % filecomment)
@@ -225,20 +225,20 @@ for cset in range(int(tip) + 1):
225
226 # tag
227 if tag and tag != 'tip':
228 - os.system(getgitenv(user, date) + 'git-tag %s' % tag)
228 + os.system(getgitenv(user, date) + 'git tag %s' % tag)
229
230 # delete branch if not used anymore...
231 if mparent and len(hgchildren[str(cset)]):
232 print "Deleting unused branch:", otherbranch
233 - os.system('git-branch -d %s' % otherbranch)
233 + os.system('git branch -d %s' % otherbranch)
234
235 # retrieve and record the version
236 - vvv = os.popen('git-show --quiet --pretty=format:%H').read()
236 + vvv = os.popen('git show --quiet --pretty=format:%H').read()
237 print 'record', cset, '->', vvv
238 hgvers[str(cset)] = vvv
239
240 if hgnewcsets >= opt_nrepack and opt_nrepack != -1:
241 - os.system('git-repack -a -d')
241 + os.system('git repack -a -d')
242
243 # write the state for incrementals
244 if state: