Show More
@@ -919,26 +919,26 b' def branches(ui, repo, active=False, clo' | |||||
919 |
|
919 | |||
920 | for isactive, node, tag in branches: |
|
920 | for isactive, node, tag in branches: | |
921 | if (not active) or isactive: |
|
921 | if (not active) or isactive: | |
|
922 | hn = repo.lookup(node) | |||
|
923 | if isactive: | |||
|
924 | label = 'branches.active' | |||
|
925 | notice = '' | |||
|
926 | elif hn not in repo.branchheads(tag, closed=False): | |||
|
927 | if not closed: | |||
|
928 | continue | |||
|
929 | label = 'branches.closed' | |||
|
930 | notice = _(' (closed)') | |||
|
931 | else: | |||
|
932 | label = 'branches.inactive' | |||
|
933 | notice = _(' (inactive)') | |||
|
934 | if tag == repo.dirstate.branch(): | |||
|
935 | label = 'branches.current' | |||
|
936 | rev = str(node).rjust(31 - encoding.colwidth(tag)) | |||
|
937 | rev = ui.label('%s:%s' % (rev, hexfunc(hn)), 'log.changeset') | |||
|
938 | tag = ui.label(tag, label) | |||
922 | if ui.quiet: |
|
939 | if ui.quiet: | |
923 | ui.write("%s\n" % tag) |
|
940 | ui.write("%s\n" % tag) | |
924 | else: |
|
941 | else: | |
925 | hn = repo.lookup(node) |
|
|||
926 | if isactive: |
|
|||
927 | label = 'branches.active' |
|
|||
928 | notice = '' |
|
|||
929 | elif hn not in repo.branchheads(tag, closed=False): |
|
|||
930 | if not closed: |
|
|||
931 | continue |
|
|||
932 | label = 'branches.closed' |
|
|||
933 | notice = _(' (closed)') |
|
|||
934 | else: |
|
|||
935 | label = 'branches.inactive' |
|
|||
936 | notice = _(' (inactive)') |
|
|||
937 | if tag == repo.dirstate.branch(): |
|
|||
938 | label = 'branches.current' |
|
|||
939 | rev = str(node).rjust(31 - encoding.colwidth(tag)) |
|
|||
940 | rev = ui.label('%s:%s' % (rev, hexfunc(hn)), 'log.changeset') |
|
|||
941 | tag = ui.label(tag, label) |
|
|||
942 | ui.write("%s %s%s\n" % (tag, rev, notice)) |
|
942 | ui.write("%s %s%s\n" % (tag, rev, notice)) | |
943 |
|
943 | |||
944 | @command('bundle', |
|
944 | @command('bundle', |
@@ -241,6 +241,11 b'' | |||||
241 | default 0:19709c5a4e75 (inactive) |
|
241 | default 0:19709c5a4e75 (inactive) | |
242 | $ hg branches -a |
|
242 | $ hg branches -a | |
243 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 |
|
243 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
244 | $ hg branches -q | |||
|
245 | a branch name much longer than the default justification used by branches | |||
|
246 | c | |||
|
247 | a | |||
|
248 | default | |||
244 | $ hg heads b |
|
249 | $ hg heads b | |
245 | no open branch heads found on branches b |
|
250 | no open branch heads found on branches b | |
246 | [1] |
|
251 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now