Patchwork [3,of,5] commands.bookmarks: pass cur in explicitly to checkconflict

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 22, 2013, 1:13 a.m.
Message ID <5f89108d45e46b4a7e1f.1385082791@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/3088/
State Superseded
Commit 410193f11422aeac9d2d2e12f1480889ffeb2272
Headers show

Comments

Siddharth Agarwal - Nov. 22, 2013, 1:13 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1385082664 28800
#      Thu Nov 21 17:11:04 2013 -0800
# Node ID 5f89108d45e46b4a7e1f86e100e4da72b7f98729
# Parent  a74d0c24dea02ccea815a49bdf3d37a86258d152
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.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -818,7 +818,7 @@ 
         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:
@@ -881,7 +881,7 @@ 
                 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)
@@ -900,7 +900,7 @@ 
                     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)