[PATCH 3 of 5 V3] commands.bookmarks: pass cur in explicitly to checkconflict

Siddharth Agarwal sid0 at fb.com
Fri Dec 20 10:04:03 CST 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1385082664 28800
#      Thu Nov 21 17:11:04 2013 -0800
# Node ID 86fa1866bd2bcdcf24c9ec1815a7f27d13d6b9cf
# Parent  7d19e7757af44d1976cd06d08cf82358b85c2e22
commands.bookmarks: pass cur in explicitly to checkconflict

cur will be moved inside the wlock in a future patch, so we need to pass it
into checkconflict explicitly.

diff -r 7d19e7757af44d1976cd06d08cf82358b85c2e22 -r 86fa1866bd2bcdcf24c9ec1815a7f27d13d6b9cf mercurial/commands.py
--- a/mercurial/commands.py	Tue Nov 19 12:33:14 2013 -0800
+++ b/mercurial/commands.py	Thu Nov 21 17:11:04 2013 -0800
@@ -818,7 +818,7 @@ def bookmark(ui, repo, *names, **opts):
         scmutil.checknewlabel(repo, mark, 'bookmark')
         return mark
 
-    def checkconflict(repo, mark, force=False, target=None):
+    def checkconflict(repo, mark, cur, force=False, target=None):
         if mark in marks and not force:
             if target:
                 if marks[mark] == target and target == cur:
@@ -883,7 +883,7 @@ def bookmark(ui, repo, *names, **opts):
                 mark = checkformat(names[0])
                 if rename not in marks:
                     raise util.Abort(_("bookmark '%s' does not exist") % rename)
-                checkconflict(repo, mark, force)
+                checkconflict(repo, mark, cur, force)
                 marks[mark] = marks[rename]
                 if repo._bookmarkcurrent == rename and not inactive:
                     bookmarks.setcurrent(repo, mark)
@@ -902,7 +902,7 @@ def bookmark(ui, repo, *names, **opts):
                     tgt = cur
                     if rev:
                         tgt = scmutil.revsingle(repo, rev).node()
-                    checkconflict(repo, mark, force, tgt)
+                    checkconflict(repo, mark, cur, force, tgt)
                     marks[mark] = tgt
                 if not inactive and cur == marks[newact] and not rev:
                     bookmarks.setcurrent(repo, newact)


More information about the Mercurial-devel mailing list