dirstate: move special handling of files==['.'] together
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 24 Apr 2019 09:32:29 -0700
changeset 42340 7ada598941d2
parent 42339 c0e1ea0c4cee
child 42341 27d6956d386b
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
mercurial/dirstate.py
--- 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