Patchwork D7144: status: use unfiltered repo if we're getting status of working copy

login
register
mail settings
Submitter phabricator
Date Nov. 12, 2019, 9:33 p.m.
Message ID <1b5176796f20c873013a2ab69fb0bbe0@localhost.localdomain>
Download mbox | patch
Permalink /patch/43148/
State Not Applicable
Headers show

Comments

phabricator - Nov. 12, 2019, 9:33 p.m.
martinvonz edited the summary of this revision.
martinvonz updated this revision to Diff 18044.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7144?vs=17367&id=18044

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

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -163,6 +163,20 @@ 
 subrepoopts = cmdutil.subrepoopts
 debugrevlogopts = cmdutil.debugrevlogopts
 
+
+def _maybeunfilteredrepo(repo, commandname, args, kwargs):
+    """decides if we can optimize by using an unfiltered repo
+
+    Extracted to a function so extensions can override it.
+    """
+    use_unfiltered = False
+    if commandname == b'status':
+        if not kwargs.get(b'rev') and not kwargs.get(b'change'):
+            use_unfiltered = True
+
+    return repo.unfiltered() if use_unfiltered else repo
+
+
 # Commands start here, listed alphabetically
 
 
@@ -6790,6 +6804,8 @@ 
         else:
             terse = ui.config(b'commands', b'status.terse')
 
+    repo = _maybeunfilteredrepo(repo, b'status', pats, opts)
+
     if revs and change:
         msg = _(b'cannot specify --rev and --change at the same time')
         raise error.Abort(msg)