Patchwork D7495: localrepo: recognize trivial request for '.'

login
register
mail settings
Submitter phabricator
Date Nov. 22, 2019, 9:23 a.m.
Message ID <differential-rev-PHID-DREV-leskfkcjrjgzt34ls2um-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43432/
State Superseded
Headers show

Comments

phabricator - Nov. 22, 2019, 9:23 a.m.
marmoute created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Same logic as for `null`, this is a command request and skipping the revset
  logic can avoid triggering the changelog filtering logic.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-repo-filters-tiptoe.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-repo-filters-tiptoe.t b/tests/test-repo-filters-tiptoe.t
--- a/tests/test-repo-filters-tiptoe.t
+++ b/tests/test-repo-filters-tiptoe.t
@@ -70,6 +70,5 @@ 
 Getting data about the working copy parent
 
   $ hg log -r '.' -T "{node}\n{date}\n"
-  debug.filters: computing revision filter for "visible"
   c2932ca7786be30b67154d541a8764fae5532261
   0.00
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1705,6 +1705,10 @@ 
         '''
         if specs == [b'null']:
             return revset.baseset([nullrev])
+        if specs == [b'.']:
+            quick_data = self._quick_access_changeid.get(b'.')
+            if quick_data is not None:
+                return revset.baseset([quick_data[0]])
         if user:
             m = revset.matchany(
                 self.ui,