D7144: status: use unfiltered repo if we're getting status of working copy
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Sat Oct 19 07:39:12 UTC 2019
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Loading the filtered repo can be slow if there are many obsmarkers and
it's not needed in the plain `hg status` case. This saves about 60ms
in my hg repo and about 200ms in a repo I use at work (where we have
an extension that hooks into repoview.pinnedrevs()).
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D7144
AFFECTED FILES
mercurial/commands.py
CHANGE DETAILS
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6767,6 +6767,11 @@
else:
terse = ui.config(b'commands', b'status.terse')
+ if not revs and not change:
+ # Avoid loading obsmarkers if we're accessing only the working copy
+ # parent (which will never be hidden).
+ repo = repo.unfiltered()
+
if revs and change:
msg = _(b'cannot specify --rev and --change at the same time')
raise error.Abort(msg)
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list