Patchwork dirstate: fix order of initializing nf vs f

login
register
mail settings
Submitter Siddharth Agarwal
Date March 31, 2015, 10:44 p.m.
Message ID <680fbcf0edcd6e746459.1427841885@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8403/
State Accepted
Commit afc29e29d569e1761b86d9b1924ea5db8dc64288
Headers show

Comments

Siddharth Agarwal - March 31, 2015, 10:44 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1427841662 25200
#      Tue Mar 31 15:41:02 2015 -0700
# Node ID 680fbcf0edcd6e7464594d88266d1794a4eaf4e4
# Parent  9fbda55c68d77d0c026d458ac228e9f98c62d64f
dirstate: fix order of initializing nf vs f

Result of a bad merge.
Matt Mackall - March 31, 2015, 10:50 p.m.
On Tue, 2015-03-31 at 15:44 -0700, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1427841662 25200
> #      Tue Mar 31 15:41:02 2015 -0700
> # Node ID 680fbcf0edcd6e7464594d88266d1794a4eaf4e4
> # Parent  9fbda55c68d77d0c026d458ac228e9f98c62d64f
> dirstate: fix order of initializing nf vs f
> 
> Result of a bad merge.

Indeed. Queued for default, thanks.

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -777,8 +777,8 @@ 
                     # even though f might be a directory, we're only interested
                     # in comparing it to files currently in the dmap --
                     # therefore normalizefile is enough
+                    nf = normalizefile(nd and (nd + "/" + f) or f, True, True)
                     f = d and (d + "/" + f) or f
-                    nf = normalizefile(nd and (nd + "/" + f) or f, True, True)
                 else:
                     nf = nd and (nd + "/" + f) or f
                     f = nf