remote-hg: safer bookmark pushing
[gitweb.git] / contrib / remote-helpers / git-remote-hg
index 548133121d23a328d76d68d058fd4fb14b60fb16..dcf6c989a724a964de93202daa9c2c2eb4d2933f 100755 (executable)
@@ -129,7 +129,7 @@ class Marks:
         self.last_mark = mark
 
     def is_marked(self, rev):
-        return self.marks.has_key(str(rev))
+        return str(rev) in self.marks
 
     def get_tip(self, branch):
         return self.tips.get(branch, 0)
@@ -782,6 +782,8 @@ def do_export(parser):
             continue
 
         if peer:
+            rb = peer.listkeys('bookmarks')
+            old = rb.get(bmark, '')
             if not peer.pushkey('bookmarks', bmark, old, new):
                 print "error %s" % ref
                 continue