D7495: localrepo: recognize trivial request for '.'

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Thu Jan 16 09:26:21 EST 2020


Alphare updated this revision to Diff 19363.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7495?vs=18384&id=19363

BRANCH
  default

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

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

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

CHANGE DETAILS

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,7 +70,6 @@
 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
 
@@ -111,8 +110,8 @@
 exporting the current changeset
 
   $ hg export
+  exporting patch:
   debug.filters: computing revision filter for "visible"
-  exporting patch:
   # HG changeset patch
   # User test
   # Date 0 0
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1708,6 +1708,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,



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


More information about the Mercurial-devel mailing list