[PATCH] Fixed bug when pushing not existing bookmarks

Stefan Thalauer sthalauer at gmail.com
Fri Aug 6 00:53:29 CDT 2010


# HG changeset patch
# User Stefan Thalauer <sthalauer at gmail.com>
# Date 1281040488 -7200
# Node ID a7646a1c3f567baf4f0fe08a594ea579b8771618
# Parent  b8b4a2417fbd51067524f0a9bb4dd698f60a31b3
Fixed bug when pushing not existing bookmarks

diff -r b8b4a2417fbd -r a7646a1c3f56 hgext/bookmarks.py
--- a/hgext/bookmarks.py	Wed Aug 04 13:21:11 2010 -0500
+++ b/hgext/bookmarks.py	Thu Aug 05 22:34:48 2010 +0200
@@ -419,17 +419,15 @@
     return result
 
 def push(oldpush, ui, repo, dest=None, **opts):
-    dopush = True
     if opts.get('bookmark'):
-        dopush = False
         for b in opts['bookmark']:
-            if b in repo._bookmarks:
-                dopush = True
+            if b not in repo._bookmarks:
+                ui.warn(_('bookmark %s does not exist!\n') % b)
+                return 2
+            else:
                 opts.setdefault('rev', []).append(b)
 
-    result = 0
-    if dopush:
-        result = oldpush(ui, repo, dest, **opts)
+    result = oldpush(ui, repo, dest, **opts)
 
     if opts.get('bookmark'):
         # this is an unpleasant hack as push will do this internally


More information about the Mercurial-devel mailing list