git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATH 2/4] remote-hg: improve node traversing

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 5, 2013, 11:36 UTC
Message-ID
<1365161779-32170-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1365161779-32170-1-git-send-email-felipe.contreras@gmail.com>

We won't be able to count the unmarked commits, but we are not going to be able to do that anyway when we switch to SHA-1 ids.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index a8591a2..02fda2d 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -314,12 +314,16 @@ def export_ref(repo, name, kind, head):
     revs = xrange(tip, head.rev() + 1)
     count = 0
 
-    revs = [rev for rev in revs if not marks.is_marked(rev)]
-
     for rev in revs:
 
         c = repo[rev]
-        (manifest, user, (time, tz), files, desc, extra) = repo.changelog.read(c.node())
+        node = c.node()
+
+        if marks.is_marked(c.hex()):
+            count += 1
+            continue
+
+        (manifest, user, (time, tz), files, desc, extra) = repo.changelog.read(node)
         rev_branch = extra['branch']
 
         author = "%s %d %s" % (fixup_user(user), time, gittz(tz))
-- 
1.8.2
Previous: Felipe ContrerasNext: Felipe Contreras
Message 3 of 7 in “[RFC/PATH 0/4] remoe-hg: switch to SHA-1 ids”
  1. Felipe ContrerasApr 5, 2013
  2. 1/4 remote-hg: shuffle some codeFelipe Contreras, Apr 5, 2013
  3. 2/4 remote-hg: improve node traversingFelipe Contreras, Apr 5, 2013
  4. 3/4 remote-hg: add version checks to the marksFelipe Contreras, Apr 5, 2013
  5. Jed BrownApr 5, 2013
  6. Felipe ContrerasApr 5, 2013
  7. 4/4 remote-hg: switch from revisions to SHA-1 noteidsFelipe Contreras, Apr 5, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.