Giter Club home page Giter Club logo

Comments (2)

felipec avatar felipec commented on August 25, 2024

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('.'))

from git.

itronics avatar itronics commented on August 25, 2024

You are unbeatable! Thank you very much for the patch above, works indeed as expected :).

Janusz

from git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.