remote-hg: trivial reorganization
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 25 May 2013 02:29:18 +0000 (21:29 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 May 2013 14:59:18 +0000 (07:59 -0700)
We only need to get the remote dict once.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/remote-helpers/git-remote-hg
index 1dd3d7030efa7e6a3e25a45d019938e2d8f8d890..426c1fc54a57dc8c5b8fe694b1b22ebe4d71a2bd 100755 (executable)
@@ -857,6 +857,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:
@@ -883,8 +884,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