--- 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"))