Patchwork D7147: diff: use unfiltered repo if we're diffing the working copy

login
register
mail settings
Submitter phabricator
Date Oct. 22, 2019, 5:56 p.m.
Message ID <differential-rev-PHID-DREV-hhx5ksk3jmir5hhxuqsz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42533/
State New
Headers show

Comments

phabricator - Oct. 22, 2019, 5:56 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Same reasoning as in the previous patch.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 22, 2019, 9:41 p.m.
marmoute added a comment.


  Do you have performance number for this ?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7147/new/

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

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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2471,6 +2471,11 @@ 
     stat = opts.get(b'stat')
     reverse = opts.get(b'reverse')
 
+    if not revs and not change:
+        # Avoid loading obsmarkers if we're accessing only the working copy
+        # parent (which will never be hidden).
+        repo = repo.unfiltered()
+
     if revs and change:
         msg = _(b'cannot specify --rev and --change at the same time')
         raise error.Abort(msg)