Patchwork [1,of,4] dirstate.walk: remove subrepo and .hg from results before step 3

login
register
mail settings
Submitter Siddharth Agarwal
Date March 23, 2013, 2:37 a.m.
Message ID <54e5c022f4d4e7b7f536.1364006221@sid0x220>
Download mbox | patch
Permalink /patch/1172/
State Superseded
Commit 1c40526da52a3ed35497fa58623dfe76382bd4f1
Headers show

Comments

Siddharth Agarwal - March 23, 2013, 2:37 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1363996552 25200
#      Fri Mar 22 16:55:52 2013 -0700
# Node ID 54e5c022f4d4e7b7f536d395268a04313f532340
# Parent  d68b6129cbfd9e4fd0e364f9f273788b6320f5fc
dirstate.walk: remove subrepo and .hg from results before step 3

This should be safe because subrepos and .hg aren't part of the dirstate.
Siddharth Agarwal - March 23, 2013, 8:58 a.m.
On 03/22/2013 09:32 PM, Kevin Bullock wrote:
> Okay, but why?

In preparation for patch 4. I (or the person crewing the patches) could 
add that as a note if you like.

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -695,6 +695,10 @@  class dirstate(object):
                     elif nf in dmap and matchfn(nf):
                         results[nf] = None
 
+        for s in subrepos:
+            del results[s]
+        del results['.hg']
+
         # step 3: report unseen items in the dmap hash
         if not skipstep3 and not exact:
             visit = sorted([f for f in dmap if f not in results and matchfn(f)])
@@ -722,9 +726,6 @@  class dirstate(object):
                 nf = iter(visit).next
                 for st in util.statfiles([join(i) for i in visit]):
                     results[nf()] = st
-        for s in subrepos:
-            del results[s]
-        del results['.hg']
         return results
 
     def status(self, match, subrepos, ignored, clean, unknown):