bookmark: same order for options and code
authorKevin Bullock <kbullock@ringworld.org>
Wed, 17 Aug 2011 08:49:40 -0500
changeset 15490 875bb46e35ea
parent 15489 25ea33fe7e5c
child 15491 c0e42b47ec1a
bookmark: same order for options and code
mercurial/commands.py
--- a/mercurial/commands.py	Tue Nov 15 14:33:06 2011 -0600
+++ b/mercurial/commands.py	Wed Aug 17 08:49:40 2011 -0500
@@ -739,6 +739,17 @@
     marks = repo._bookmarks
     cur   = repo.changectx('.').node()
 
+    if delete:
+        if mark is None:
+            raise util.Abort(_("bookmark name required"))
+        if mark not in marks:
+            raise util.Abort(_("bookmark '%s' does not exist") % mark)
+        if mark == repo._bookmarkcurrent:
+            bookmarks.setcurrent(repo, None)
+        del marks[mark]
+        bookmarks.write(repo)
+        return
+
     if rename:
         if rename not in marks:
             raise util.Abort(_("bookmark '%s' does not exist") % rename)
@@ -754,17 +765,6 @@
         bookmarks.write(repo)
         return
 
-    if delete:
-        if mark is None:
-            raise util.Abort(_("bookmark name required"))
-        if mark not in marks:
-            raise util.Abort(_("bookmark '%s' does not exist") % mark)
-        if mark == repo._bookmarkcurrent:
-            bookmarks.setcurrent(repo, None)
-        del marks[mark]
-        bookmarks.write(repo)
-        return
-
     if mark is not None:
         if "\n" in mark:
             raise util.Abort(_("bookmark name cannot contain newlines"))