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

[PATCH 2/4] remote-hg: fix compatibility with older versions of hg

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 12, 2012, 17:41 UTC
Message-ID
<1352742068-15346-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1352742068-15346-1-git-send-email-felipe.contreras@gmail.com>

Turns out repo.revs was introduced quite late, and it doesn't do anything fancy for our refspec; only list all the numbers in that range.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 1d46838..c6d0367 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -294,7 +294,7 @@ def export_ref(repo, name, kind, head):
     if tip and tip == head.rev():
         # nothing to do
         return
-    revs = repo.revs('%u:%u' % (tip, head))
+    revs = xrange(tip, head.rev() + 1)
     count = 0
 
     revs = [rev for rev in revs if not marks.is_marked(rev)]
-- 
1.8.0
Previous: Felipe ContrerasNext: Ramkumar Ramachandra
Message 7 of 11 in “remote-hg: small fixes”
  1. 0/4 remote-hg: small fixesFelipe Contreras, Nov 12, 2012
  2. 1/4 remote-hg: add missing config for basic testsFelipe Contreras, Nov 12, 2012
  3. Jeff KingNov 12, 2012
  4. Felipe ContrerasNov 13, 2012
  5. Jeff KingNov 13, 2012
  6. Felipe ContrerasNov 13, 2012
  7. 2/4 remote-hg: fix compatibility with older versions of hgFelipe Contreras, Nov 12, 2012
  8. Ramkumar RamachandraNov 13, 2012
  9. Felipe ContrerasNov 13, 2012
  10. 3/4 remote-hg: try the 'tip' if no checkout presentFelipe Contreras, Nov 12, 2012
  11. 4/4 remote-hg: avoid bad refsFelipe Contreras, Nov 12, 2012

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.