diff: change how quiet mode supresses diffline
authorGuillermo Pérez <bisho@fb.com>
Thu, 15 Nov 2012 13:49:04 -0800
changeset 17942 5e655418aa8d
parent 17941 9a6e4d5d7ea8
child 17943 66b9832331c9
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.
mercurial/patch.py
--- 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')