Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 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 |
comparison
equal
deleted
inserted
replaced
17941:9a6e4d5d7ea8 | 17942:5e655418aa8d |
---|---|
1582 | 1582 |
1583 if not modified and not added and not removed: | 1583 if not modified and not added and not removed: |
1584 return [] | 1584 return [] |
1585 | 1585 |
1586 revs = None | 1586 revs = None |
1587 if not repo.ui.quiet: | 1587 hexfunc = repo.ui.debugflag and hex or short |
1588 hexfunc = repo.ui.debugflag and hex or short | 1588 revs = [hexfunc(node) for node in [node1, node2] if node] |
1589 revs = [hexfunc(node) for node in [node1, node2] if node] | |
1590 | 1589 |
1591 copy = {} | 1590 copy = {} |
1592 if opts.git or opts.upgrade: | 1591 if opts.git or opts.upgrade: |
1593 copy = copies.pathcopies(ctx1, ctx2) | 1592 copy = copies.pathcopies(ctx1, ctx2) |
1594 | 1593 |
1663 | 1662 |
1664 def join(f): | 1663 def join(f): |
1665 return os.path.join(prefix, f) | 1664 return os.path.join(prefix, f) |
1666 | 1665 |
1667 def diffline(revs, a, b, opts): | 1666 def diffline(revs, a, b, opts): |
1667 if repo.ui.quiet and not opts.git: | |
1668 return '' | |
1668 parts = ['diff'] | 1669 parts = ['diff'] |
1669 if opts.git: | 1670 if opts.git: |
1670 parts.append('--git') | 1671 parts.append('--git') |
1671 if revs and not opts.git: | 1672 if revs and not opts.git: |
1672 parts.append(' '.join(["-r %s" % rev for rev in revs])) | 1673 parts.append(' '.join(["-r %s" % rev for rev in revs])) |