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.
--- 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')