# HG changeset patch # User Martin von Zweigbergk # Date 2014-11-20 20:15:12 # Node ID a9b61dbdb827165a9fd9d44dd42b892dbd9fa07c # Parent ba272156113ff341b79cd4aec892849c88894c51 context: use unfiltered repo for '.' There is no reason to read obsolescence markers when doing a plain 'hg status' without --rev. Use the unfiltered repo when initializing context._rev to speed things up. This speeds up 'hg status' from 1.342s to 0.080s on my repo with ~110k markers. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -376,10 +376,6 @@ class changectx(basectx): return if isinstance(changeid, long): changeid = str(changeid) - if changeid == '.': - self._node = repo.dirstate.p1() - self._rev = repo.changelog.rev(self._node) - return if changeid == 'null': self._node = nullid self._rev = nullrev @@ -388,6 +384,12 @@ class changectx(basectx): self._node = repo.changelog.tip() self._rev = repo.changelog.rev(self._node) return + if changeid == '.' or changeid == repo.dirstate.p1(): + # this is a hack to delay/avoid loading obsmarkers + # when we know that '.' won't be hidden + self._node = repo.dirstate.p1() + self._rev = repo.unfiltered().changelog.rev(self._node) + return if len(changeid) == 20: try: self._node = changeid