bookmarks: Check if the bookmark to delete exists on the remote stable
authorDavid Soria Parra <dsp@php.net>
Thu, 19 Aug 2010 15:04:21 -0400
branchstable
changeset 11994 31dde4c3bb83
parent 11992 ccd8e592c3c5
child 12001 4b1197f15313
child 12005 c6b1be675d3c
child 12212 bb63f0532aa6
bookmarks: Check if the bookmark to delete exists on the remote
hgext/bookmarks.py
--- a/hgext/bookmarks.py	Thu Aug 19 22:51:09 2010 +0200
+++ b/hgext/bookmarks.py	Thu Aug 19 15:04:21 2010 -0400
@@ -442,9 +442,12 @@
             if b in repo._bookmarks:
                 ui.status(_("exporting bookmark %s\n") % b)
                 new = repo[b].hex()
-            else:
+            elif b in rb:
                 ui.status(_("deleting remote bookmark %s\n") % b)
                 new = '' # delete
+            else:
+                ui.warn(_('bookmark %s does not exist on the local or remote repository!\n') % b)
+                return 2
             old = rb.get(b, '')
             r = other.pushkey('bookmarks', b, old, new)
             if not r: