-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash during push to Hg repo #50
Comments
That is due to another bug in Git that is already fixed in the latest version. And you are right, if you push again the issue should be gone. You can try the old code this way: diff --git a/git-remote-hg.py b/git-remote-hg.py
index cf149f3..cce3172 100755
--- a/git-remote-hg.py
+++ b/git-remote-hg.py
@@ -264,27 +264,12 @@ def fix_file_path(path):
return path
return os.path.relpath(path, '/')
-def export_files(files):
- final = []
- for f in files:
- fid = node.hex(f.filenode())
-
- if fid in filenodes:
- mark = filenodes[fid]
- else:
- mark = marks.next_mark()
- filenodes[fid] = mark
- d = f.data()
-
- print "blob"
- print "mark :%u" % mark
- print "data %d" % len(d)
- print d
-
- path = fix_file_path(f.path())
- final.append((gitmode(f.flags()), mark, path))
-
- return final
+def export_file(fc):
+ d = fc.data()
+ path = fix_file_path(fc.path())
+ print "M %s inline %s" % (gitmode(fc.flags()), path)
+ print "data %d" % len(d)
+ print d
def get_filechanges(repo, ctx, parent):
modified = set()
@@ -505,8 +490,6 @@ def export_ref(repo, name, kind, head):
if len(parents) == 0 and rev:
print 'reset %s/%s' % (prefix, ename)
- modified_final = export_files(c.filectx(f) for f in modified)
-
print "commit %s/%s" % (prefix, ename)
print "mark :%d" % (marks.get_mark(c.hex()))
print "author %s" % (author)
@@ -521,8 +504,8 @@ def export_ref(repo, name, kind, head):
for f in removed:
print "D %s" % (fix_file_path(f))
- for f in modified_final:
- print "M %s :%u %s" % f
+ for f in modified:
+ export_file(c.filectx(f))
print
progress = (rev - tip)
@@ -1157,7 +1140,6 @@ def main(args):
global peer, mode, bad_mail, bad_name
global track_branches, force_push, is_tmp
global parsed_tags
- global filenodes
global fake_bmark, hg_version
global dry_run
global notes, alias
@@ -1199,7 +1181,6 @@ def main(args):
blob_marks = {}
parsed_refs = {}
parsed_tags = {}
- filenodes = {}
fake_bmark = None
try:
hg_version = tuple(int(e) for e in util.version().split('.')) |
You are unbeatable! Thank you very much for the patch above, works indeed as expected :). Janusz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git-remote-hg sometimes crashes on pushing local commits to Hg repo with error:
If you will try again after the crash, git answers with 'Everything up-to-day' message. The crash is replicable, but seems to depend both on commit as well as repo content. Moreover, when after the crash you will delete mark related to the failed commit in marks-git file, next push ends successfully.
Steps to reproduce (using clone of our SF net repository):
Tested on git 1.7.9.5 and 1.7.10.4.
The text was updated successfully, but these errors were encountered: