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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Nov 12 21:33:52 UTC 2019


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

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)



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


More information about the Mercurial-devel mailing list