Patchwork D7494: localrepo: fastpath access to "."

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

Comments

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

REVISION SUMMARY
  "." is just an aliast for `p1(wdir()`, let us handle it that way.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel
phabricator - Jan. 17, 2020, 2:58 p.m.
pulkit added a comment.


  > "." is just an aliast for `p1(wdir()`,
  
  "." is just an alias for `p1(wdir())`,
  
  in flight.

REPOSITORY
  rHG Mercurial

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

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

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

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1540,6 +1540,9 @@ 
             pair = (rev, node)
             quick[rev] = pair
             quick[node] = pair
+        p1node = self.dirstate.p1()
+        if p1node != nullid:
+            quick[b'.'] = quick[p1node]
         return quick
 
     @unfilteredmethod