D6400: dirstate: move special handling of files==['.'] together

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon May 20 11:47:00 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7ada598941d2: dirstate: move special handling of files==['.'] together (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6400?vs=15172&id=15191

REVISION DETAIL
  https://phab.mercurial-scm.org/D6400

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -759,13 +759,14 @@
 
         if not files or '.' in files:
             files = ['.']
+            # constructing the foldmap is expensive, so don't do it for the
+            # common case where files is ['.']
+            normalize = None
         results = dict.fromkeys(subrepos)
         results['.hg'] = None
 
         for ff in files:
-            # constructing the foldmap is expensive, so don't do it for the
-            # common case where files is ['.']
-            if normalize and ff != '.':
+            if normalize:
                 nf = normalize(ff, False, True)
             else:
                 nf = ff



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list