Show More
@@ -436,16 +436,19 b' def branch(ui, repo, label=None, **opts)' | |||
|
436 | 436 | else: |
|
437 | 437 | ui.write("%s\n" % encoding.tolocal(repo.dirstate.branch())) |
|
438 | 438 | |
|
439 | def branches(ui, repo, active=False): | |
|
439 | def branches(ui, repo, active=False, closed=False): | |
|
440 | 440 | """list repository named branches |
|
441 | 441 | |
|
442 | 442 | List the repository's named branches, indicating which ones are |
|
443 |
inactive. If - |
|
|
444 | ||
|
445 | A branch is considered active if it contains repository heads. | |
|
443 | inactive. If -c/--closed is specified, also list branches which have | |
|
444 | been marked closed (see hg commit --close-branch). | |
|
445 | ||
|
446 | If -a/--active is specified, only show active branches. A branch | |
|
447 | is considered active if it contains repository heads. | |
|
446 | 448 | |
|
447 | 449 | Use the command 'hg update' to switch to an existing branch. |
|
448 | 450 | """ |
|
451 | ||
|
449 | 452 | hexfunc = ui.debugflag and hex or short |
|
450 | 453 | activebranches = [encoding.tolocal(repo[n].branch()) |
|
451 | 454 | for n in repo.heads()] |
@@ -466,6 +469,8 b' def branches(ui, repo, active=False):' | |||
|
466 | 469 | if isactive: |
|
467 | 470 | notice = '' |
|
468 | 471 | elif hn not in repo.branchheads(tag, closed=False): |
|
472 | if not closed: | |
|
473 | continue | |
|
469 | 474 | notice = ' (closed)' |
|
470 | 475 | else: |
|
471 | 476 | notice = ' (inactive)' |
@@ -3205,7 +3210,9 b' table = {' | |||
|
3205 | 3210 | "branches": |
|
3206 | 3211 | (branches, |
|
3207 | 3212 | [('a', 'active', False, |
|
3208 |
_('show only branches that have unmerged heads')) |
|
|
3213 | _('show only branches that have unmerged heads')), | |
|
3214 | ('c', 'closed', False, | |
|
3215 | _('show normal and closed heads'))], | |
|
3209 | 3216 | _('[-a]')), |
|
3210 | 3217 | "bundle": |
|
3211 | 3218 | (bundle, |
@@ -70,6 +70,7 b' hg up -C b' | |||
|
70 | 70 | hg commit -d '9 0' --close-branch -m 'close this part branch too' |
|
71 | 71 | echo '--- b branch should be inactive' |
|
72 | 72 | hg branches |
|
73 | hg branches -c | |
|
73 | 74 | hg branches -a |
|
74 | 75 | hg heads b |
|
75 | 76 | hg heads --closed b |
@@ -108,6 +108,10 b' a branch name much longer than the defau' | |||
|
108 | 108 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
109 | 109 | --- b branch should be inactive |
|
110 | 110 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 |
|
111 | c 6:589736a22561 (inactive) | |
|
112 | a 5:d8cbc61dbaa6 (inactive) | |
|
113 | default 0:19709c5a4e75 (inactive) | |
|
114 | a branch name much longer than the default justification used by branches 7:10ff5895aa57 | |
|
111 | 115 | b 12:2da6583810df (closed) |
|
112 | 116 | c 6:589736a22561 (inactive) |
|
113 | 117 | a 5:d8cbc61dbaa6 (inactive) |
@@ -184,7 +184,7 b' archive: no-decode, prefix, rev, type, i' | |||
|
184 | 184 | backout: merge, parent, rev, include, exclude, message, logfile, date, user |
|
185 | 185 | bisect: reset, good, bad, skip, command, noupdate |
|
186 | 186 | branch: force, clean |
|
187 | branches: active | |
|
187 | branches: active, closed | |
|
188 | 188 | bundle: force, rev, base, all, type, ssh, remotecmd |
|
189 | 189 | cat: output, rev, decode, include, exclude |
|
190 | 190 | copy: after, force, include, exclude, dry-run |
General Comments 0
You need to be logged in to leave comments.
Login now