changeset 42340:7ada598941d2

dirstate: move special handling of files==['.'] together I think it makes it a little clearer to have the two conditions for files==['.'] near each other. Differential Revision: https://phab.mercurial-scm.org/D6400
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 24 Apr 2019 09:32:29 -0700
parents c0e1ea0c4cee
children 27d6956d386b
files mercurial/dirstate.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Fri May 17 00:57:57 2019 -0700
+++ b/mercurial/dirstate.py	Wed Apr 24 09:32:29 2019 -0700
@@ -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