# HG changeset patch # User Travis Herrick # Date 1336349542 25200 # Node ID 726dd0fc7cfe4876b56988e989b01d0113bba00f # Parent f1745323a56765a11e33491859fdc8e0985fed77 branches: quiet option observes other parameters diff -r f1745323a567 -r 726dd0fc7cfe mercurial/commands.py --- a/mercurial/commands.py Wed May 09 02:46:58 2012 +0300 +++ b/mercurial/commands.py Sun May 06 17:12:22 2012 -0700 @@ -919,26 +919,26 @@ for isactive, node, tag in branches: if (not active) or isactive: + hn = repo.lookup(node) + if isactive: + label = 'branches.active' + notice = '' + elif hn not in repo.branchheads(tag, closed=False): + if not closed: + continue + label = 'branches.closed' + notice = _(' (closed)') + else: + label = 'branches.inactive' + notice = _(' (inactive)') + if tag == repo.dirstate.branch(): + label = 'branches.current' + rev = str(node).rjust(31 - encoding.colwidth(tag)) + rev = ui.label('%s:%s' % (rev, hexfunc(hn)), 'log.changeset') + tag = ui.label(tag, label) if ui.quiet: ui.write("%s\n" % tag) else: - hn = repo.lookup(node) - if isactive: - label = 'branches.active' - notice = '' - elif hn not in repo.branchheads(tag, closed=False): - if not closed: - continue - label = 'branches.closed' - notice = _(' (closed)') - else: - label = 'branches.inactive' - notice = _(' (inactive)') - if tag == repo.dirstate.branch(): - label = 'branches.current' - rev = str(node).rjust(31 - encoding.colwidth(tag)) - rev = ui.label('%s:%s' % (rev, hexfunc(hn)), 'log.changeset') - tag = ui.label(tag, label) ui.write("%s %s%s\n" % (tag, rev, notice)) @command('bundle', diff -r f1745323a567 -r 726dd0fc7cfe tests/test-branches.t --- a/tests/test-branches.t Wed May 09 02:46:58 2012 +0300 +++ b/tests/test-branches.t Sun May 06 17:12:22 2012 -0700 @@ -241,6 +241,11 @@ default 0:19709c5a4e75 (inactive) $ hg branches -a a branch name much longer than the default justification used by branches 7:10ff5895aa57 + $ hg branches -q + a branch name much longer than the default justification used by branches + c + a + default $ hg heads b no open branch heads found on branches b [1]