changeset 17942:5e655418aa8d

diff: change how quiet mode supresses diffline Before, quiet mode produced no diffline header for mercurial as a side effect of not populating "revs". This was a weird side effect, and we will always need revs for git index header that will be added in upcoming patches, so now we just check ui.quiet from diffline directly.
author Guillermo Pérez <bisho@fb.com>
date Thu, 15 Nov 2012 13:49:04 -0800
parents 9a6e4d5d7ea8
children 66b9832331c9
files mercurial/patch.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Thu Nov 15 12:19:03 2012 -0800
+++ b/mercurial/patch.py	Thu Nov 15 13:49:04 2012 -0800
@@ -1584,9 +1584,8 @@
         return []
 
     revs = None
-    if not repo.ui.quiet:
-        hexfunc = repo.ui.debugflag and hex or short
-        revs = [hexfunc(node) for node in [node1, node2] if node]
+    hexfunc = repo.ui.debugflag and hex or short
+    revs = [hexfunc(node) for node in [node1, node2] if node]
 
     copy = {}
     if opts.git or opts.upgrade:
@@ -1665,6 +1664,8 @@
         return os.path.join(prefix, f)
 
     def diffline(revs, a, b, opts):
+        if repo.ui.quiet and not opts.git:
+            return ''
         parts = ['diff']
         if opts.git:
             parts.append('--git')