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

login
register
mail settings
Submitter phabricator
Date May 17, 2019, 5:57 p.m.
Message ID <differential-rev-PHID-DREV-c4rpf55vt755lga4dspe-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40120/
State Superseded
Headers show

Comments

phabricator - May 17, 2019, 5:57 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I think it makes it a little clearer to have the two conditions for
  files==['.'] near each other.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

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