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

[PATCH v2 6/6] remote-hg: trivial reorganization

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 10, 2013, 20:59 UTC
Message-ID
<1368219566-1399-7-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1368219566-1399-1-git-send-email-felipe.contreras@gmail.com>
We only need to get the remote dict once.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 50ead38..40da4b0 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -854,6 +854,7 @@ def do_export(parser):
 
     if peer:
         parser.repo.push(peer, force=force_push, newbranch=True)
+        remote_bmarks = peer.listkeys('bookmarks')
 
     # handle bookmarks
     for bmark, node in p_bmarks:
@@ -880,8 +881,7 @@ def do_export(parser):
             continue
 
         if peer:
-            rb = peer.listkeys('bookmarks')
-            old = rb.get(bmark, '')
+            old = remote_bmarks.get(bmark, '')
             if not peer.pushkey('bookmarks', bmark, old, new):
                 print "error %s" % ref
                 continue
-- 
1.8.3.rc1.579.g184e698
Previous: Felipe ContrerasNext: Felipe Contreras
Message 7 of 8 in “remote-hg: fixes and cleanups”
  1. 0/6 remote-hg: fixes and cleanupsFelipe Contreras, May 10, 2013
  2. 1/6 remote-hg: disable forced push by defaultFelipe Contreras, May 10, 2013
  3. 2/6 remote-hg: don't push fake 'master' bookmarkFelipe Contreras, May 10, 2013
  4. 3/6 remote-hg: update bookmarks when pullingFelipe Contreras, May 10, 2013
  5. 4/6 remote-hg: test: be a little more quietFelipe Contreras, May 10, 2013
  6. 5/6 remote-hg: fix new branch creationFelipe Contreras, May 10, 2013
  7. 6/6 remote-hg: trivial reorganizationFelipe Contreras, May 10, 2013
  8. Felipe ContrerasMay 13, 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.