localrepo: fastpath access to "."
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 17 Nov 2019 14:47:29 +0100
changeset 44105 d86dede17392
parent 44104 85c4cd73996b
child 44106 bfaf4c673bec
localrepo: fastpath access to "." "." is just an alias for `p1(wdir())`, let us handle it that way. Differential Revision: https://phab.mercurial-scm.org/D7494
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Nov 17 14:39:28 2019 +0100
+++ b/mercurial/localrepo.py	Sun Nov 17 14:47:29 2019 +0100
@@ -1543,6 +1543,9 @@
             pair = (rev, node)
             quick[rev] = pair
             quick[node] = pair
+        p1node = self.dirstate.p1()
+        if p1node != nullid:
+            quick[b'.'] = quick[p1node]
         return quick
 
     @unfilteredmethod