[PATCH 3 of 4] commands.bookmarks: move cur initialization to inside names block
David Soria Parra
davidsp at fb.com
Thu Nov 21 16:08:36 CST 2013
On 11/19/13, 12:45 PM, "Siddharth Agarwal" <sid0 at fb.com> wrote:
># HG changeset patch
># User Siddharth Agarwal <sid0 at fb.com>
># Date 1384893737 28800
># Tue Nov 19 12:42:17 2013 -0800
># Node ID 5efde1fac081f2271fc2d97189506aa61cd908be
># Parent d018c7466c66d710dccc2ede1b10e79b02de01c1
>commands.bookmarks: move cur initialization to inside names block
>
>Not only is cur not used outside this block, this is also more correct
>because
>we now fetch the current node while the wlock is held.
>
>diff --git a/mercurial/commands.py b/mercurial/commands.py
>--- a/mercurial/commands.py
>+++ b/mercurial/commands.py
>@@ -808,7 +808,6 @@
> inactive = opts.get('inactive')
>
> hexfn = ui.debugflag and hex or short
>- cur = repo.changectx('.').node()
>
> def checkformat(mark):
> mark = mark.strip()
>@@ -889,6 +888,7 @@
> marks.write()
>
> elif names:
>+ cur = repo.changectx('.').node()
Before that patch it was obvious that cur is always initialized when
checkconflict() (which uses cur) is called but now it¹s not anymore.
Can we pass cur into checkconflict().
More information about the Mercurial-devel
mailing list