Patchwork D8579: context: avoid computing status twice when comparing among revisions

login
register
mail settings
Submitter phabricator
Date May 25, 2020, 6:48 a.m.
Message ID <differential-rev-PHID-DREV-er5i64y5h7nnnrzbfz3c-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46370/
State New
Headers show

Comments

phabricator - May 25, 2020, 6:48 a.m.
rom1dep created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: rom1dep, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1937,12 +1937,13 @@ 
         building a new manifest if self (working directory) is not comparing
         against its parent (repo['.']).
         """
-        s = self._dirstatestatus(match, listignored, listclean, listunknown)
-        # Filter out symlinks that, in the case of FAT32 and NTFS filesystems,
-        # might have accidentally ended up with the entire contents of the file
-        # they are supposed to be linking to.
-        s.modified[:] = self._filtersuspectsymlink(s.modified)
-        if other != self._repo[b'.']:
+        if other == self._repo[b'.']:
+            s = self._dirstatestatus(match, listignored, listclean, listunknown)
+            # Filter out symlinks that, in the case of FAT32 and NTFS filesystems,
+            # might have accidentally ended up with the entire contents of the file
+            # they are supposed to be linking to.
+            s.modified[:] = self._filtersuspectsymlink(s.modified)
+        else:
             s = super(workingctx, self)._buildstatus(
                 other, s, match, listignored, listclean, listunknown
             )