Show More
@@ -62,6 +62,11 b' Default effects may be overridden from t' | |||||
62 |
|
62 | |||
63 | bookmarks.current = green |
|
63 | bookmarks.current = green | |
64 |
|
64 | |||
|
65 | branches.active = none | |||
|
66 | branches.closed = black bold | |||
|
67 | branches.current = green | |||
|
68 | branches.inactive = none | |||
|
69 | ||||
65 | The color extension will try to detect whether to use ANSI codes or |
|
70 | The color extension will try to detect whether to use ANSI codes or | |
66 | Win32 console APIs, unless it is made explicit:: |
|
71 | Win32 console APIs, unless it is made explicit:: | |
67 |
|
72 | |||
@@ -87,6 +92,10 b' from mercurial.i18n import _' | |||||
87 | 'cyan_background': 46, 'white_background': 47} |
|
92 | 'cyan_background': 46, 'white_background': 47} | |
88 |
|
93 | |||
89 | _styles = {'grep.match': 'red bold', |
|
94 | _styles = {'grep.match': 'red bold', | |
|
95 | 'branches.active': 'none', | |||
|
96 | 'branches.closed': 'black bold', | |||
|
97 | 'branches.current': 'green', | |||
|
98 | 'branches.inactive': 'none', | |||
90 | 'diff.changed': 'white', |
|
99 | 'diff.changed': 'white', | |
91 | 'diff.deleted': 'red', |
|
100 | 'diff.deleted': 'red', | |
92 | 'diff.diffline': 'bold', |
|
101 | 'diff.diffline': 'bold', |
@@ -512,16 +512,22 b' def branches(ui, repo, active=False, clo' | |||||
512 | else: |
|
512 | else: | |
513 | hn = repo.lookup(node) |
|
513 | hn = repo.lookup(node) | |
514 | if isactive: |
|
514 | if isactive: | |
|
515 | label = 'branches.active' | |||
515 | notice = '' |
|
516 | notice = '' | |
516 | elif hn not in repo.branchheads(tag, closed=False): |
|
517 | elif hn not in repo.branchheads(tag, closed=False): | |
517 | if not closed: |
|
518 | if not closed: | |
518 | continue |
|
519 | continue | |
|
520 | label = 'branches.closed' | |||
519 | notice = _(' (closed)') |
|
521 | notice = _(' (closed)') | |
520 | else: |
|
522 | else: | |
|
523 | label = 'branches.inactive' | |||
521 | notice = _(' (inactive)') |
|
524 | notice = _(' (inactive)') | |
|
525 | if tag == repo.dirstate.branch(): | |||
|
526 | label = 'branches.current' | |||
522 | rev = str(node).rjust(31 - encoding.colwidth(encodedtag)) |
|
527 | rev = str(node).rjust(31 - encoding.colwidth(encodedtag)) | |
523 |
|
|
528 | rev = ui.label('%s:%s' % (rev, hexfunc(hn)), 'log.changeset') | |
524 | ui.write("%s %s:%s%s\n" % data) |
|
529 | encodedtag = ui.label(encodedtag, label) | |
|
530 | ui.write("%s %s%s\n" % (encodedtag, rev, notice)) | |||
525 |
|
531 | |||
526 | def bundle(ui, repo, fname, dest=None, **opts): |
|
532 | def bundle(ui, repo, fname, dest=None, **opts): | |
527 | """create a changegroup file |
|
533 | """create a changegroup file |
@@ -341,3 +341,53 b' branch b' | |||||
341 | date: Thu Jan 01 00:00:09 1970 +0000 |
|
341 | date: Thu Jan 01 00:00:09 1970 +0000 | |
342 | summary: prune bad branch |
|
342 | summary: prune bad branch | |
343 |
|
343 | |||
|
344 | default branch colors: | |||
|
345 | ||||
|
346 | $ echo "[extensions]" >> $HGRCPATH | |||
|
347 | $ echo "color =" >> $HGRCPATH | |||
|
348 | ||||
|
349 | $ hg up -C c | |||
|
350 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |||
|
351 | $ hg commit -d '9 0' --close-branch -m 'reclosing this branch' | |||
|
352 | $ hg up -C b | |||
|
353 | 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |||
|
354 | $ hg branches --color=always | |||
|
355 | [0;32mb[0m [0;33m 13:6ac12926b8c3[0m | |||
|
356 | [0;0ma branch name much longer than the default justification used by branches[0m [0;33m7:10ff5895aa57[0m | |||
|
357 | [0;0ma[0m [0;33m 5:d8cbc61dbaa6[0m (inactive) | |||
|
358 | [0;0mdefault[0m [0;33m 0:19709c5a4e75[0m (inactive) | |||
|
359 | ||||
|
360 | default closed branch color: | |||
|
361 | ||||
|
362 | $ hg branches --color=always --closed | |||
|
363 | [0;32mb[0m [0;33m 13:6ac12926b8c3[0m | |||
|
364 | [0;0ma branch name much longer than the default justification used by branches[0m [0;33m7:10ff5895aa57[0m | |||
|
365 | [0;30;1mc[0m [0;33m 14:717d2e6fabe1[0m (closed) | |||
|
366 | [0;0ma[0m [0;33m 5:d8cbc61dbaa6[0m (inactive) | |||
|
367 | [0;0mdefault[0m [0;33m 0:19709c5a4e75[0m (inactive) | |||
|
368 | ||||
|
369 | $ echo "[extensions]" >> $HGRCPATH | |||
|
370 | $ echo "color =" >> $HGRCPATH | |||
|
371 | $ echo "[color]" >> $HGRCPATH | |||
|
372 | $ echo "branches.active = green" >> $HGRCPATH | |||
|
373 | $ echo "branches.closed = blue" >> $HGRCPATH | |||
|
374 | $ echo "branches.current = red" >> $HGRCPATH | |||
|
375 | $ echo "branches.inactive = magenta" >> $HGRCPATH | |||
|
376 | $ echo "log.changeset = cyan" >> $HGRCPATH | |||
|
377 | ||||
|
378 | custom branch colors: | |||
|
379 | ||||
|
380 | $ hg branches --color=always | |||
|
381 | [0;31mb[0m [0;36m 13:6ac12926b8c3[0m | |||
|
382 | [0;32ma branch name much longer than the default justification used by branches[0m [0;36m7:10ff5895aa57[0m | |||
|
383 | [0;35ma[0m [0;36m 5:d8cbc61dbaa6[0m (inactive) | |||
|
384 | [0;35mdefault[0m [0;36m 0:19709c5a4e75[0m (inactive) | |||
|
385 | ||||
|
386 | custom closed branch color: | |||
|
387 | ||||
|
388 | $ hg branches --color=always --closed | |||
|
389 | [0;31mb[0m [0;36m 13:6ac12926b8c3[0m | |||
|
390 | [0;32ma branch name much longer than the default justification used by branches[0m [0;36m7:10ff5895aa57[0m | |||
|
391 | [0;34mc[0m [0;36m 14:717d2e6fabe1[0m (closed) | |||
|
392 | [0;35ma[0m [0;36m 5:d8cbc61dbaa6[0m (inactive) | |||
|
393 | [0;35mdefault[0m [0;36m 0:19709c5a4e75[0m (inactive) |
General Comments 0
You need to be logged in to leave comments.
Login now