Patchwork D7147: diff: use unfiltered repo if we're diffing the working copy

login
register
mail settings
Submitter phabricator
Date Nov. 12, 2019, 9:33 p.m.
Message ID <1abd5155c7dcd28151ab47af74ef272f@localhost.localdomain>
Download mbox | patch
Permalink /patch/43147/
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 18045.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7147?vs=17368&id=18045

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

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -173,6 +173,9 @@ 
     if commandname == b'status':
         if not kwargs.get(b'rev') and not kwargs.get(b'change'):
             use_unfiltered = True
+    elif commandname == b'diff':
+        if not kwargs.get(b'rev') and not kwargs.get(b'change'):
+            use_unfiltered = True
 
     return repo.unfiltered() if use_unfiltered else repo
 
@@ -2491,6 +2494,8 @@ 
     stat = opts.get(b'stat')
     reverse = opts.get(b'reverse')
 
+    repo = _maybeunfilteredrepo(repo, b'diff', pats, opts)
+
     if revs and change:
         msg = _(b'cannot specify --rev and --change at the same time')
         raise error.Abort(msg)