771 else: |
771 else: |
772 ui.status(_('the backout changeset is a new head - ' |
772 ui.status(_('the backout changeset is a new head - ' |
773 'do not forget to merge\n')) |
773 'do not forget to merge\n')) |
774 ui.status(_('(use "backout --merge" ' |
774 ui.status(_('(use "backout --merge" ' |
775 'if you want to auto-merge)\n')) |
775 'if you want to auto-merge)\n')) |
|
776 |
|
777 def branch(ui, repo, label=None): |
|
778 """set or show the current branch name |
|
779 |
|
780 With <name>, set the current branch name. Otherwise, show the |
|
781 current branch name. |
|
782 """ |
|
783 |
|
784 if label is not None: |
|
785 repo.opener("branch", "w").write(label) |
|
786 else: |
|
787 b = repo.workingctx().branch() |
|
788 if b: |
|
789 ui.write("%s\n" % b) |
|
790 |
|
791 def branches(ui, repo): |
|
792 """list repository named branches |
|
793 |
|
794 List the repository's named branches. |
|
795 """ |
|
796 b = repo.branchtags() |
|
797 l = [(-repo.changelog.rev(n), n, t) for t,n in b.items()] |
|
798 l.sort() |
|
799 for r, n, t in l: |
|
800 hexfunc = ui.debugflag and hex or short |
|
801 if ui.quiet: |
|
802 ui.write("%s\n" % t) |
|
803 else: |
|
804 ui.write("%-30s %s:%s\n" % (t, -r, hexfunc(n))) |
776 |
805 |
777 def bundle(ui, repo, fname, dest=None, **opts): |
806 def bundle(ui, repo, fname, dest=None, **opts): |
778 """create a changegroup file |
807 """create a changegroup file |
779 |
808 |
780 Generate a compressed changegroup file collecting changesets. |
809 Generate a compressed changegroup file collecting changesets. |
2848 ('d', 'date', '', _('record datecode as commit date')), |
2877 ('d', 'date', '', _('record datecode as commit date')), |
2849 ('', 'parent', '', _('parent to choose when backing out merge')), |
2878 ('', 'parent', '', _('parent to choose when backing out merge')), |
2850 ('u', 'user', '', _('record user as committer')), |
2879 ('u', 'user', '', _('record user as committer')), |
2851 ] + walkopts, |
2880 ] + walkopts, |
2852 _('hg backout [OPTION]... REV')), |
2881 _('hg backout [OPTION]... REV')), |
|
2882 "branch": (branch, [], _('hg branch [NAME]')), |
|
2883 "branches": (branches, [], _('hg branches')), |
2853 "bundle": |
2884 "bundle": |
2854 (bundle, |
2885 (bundle, |
2855 [('f', 'force', None, |
2886 [('f', 'force', None, |
2856 _('run even when remote repository is unrelated')), |
2887 _('run even when remote repository is unrelated')), |
2857 ('r', 'rev', [], |
2888 ('r', 'rev', [], |