Show More
@@ -774,6 +774,35 b' def backout(ui, repo, rev, **opts):' | |||
|
774 | 774 | ui.status(_('(use "backout --merge" ' |
|
775 | 775 | 'if you want to auto-merge)\n')) |
|
776 | 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))) | |
|
805 | ||
|
777 | 806 | def bundle(ui, repo, fname, dest=None, **opts): |
|
778 | 807 | """create a changegroup file |
|
779 | 808 | |
@@ -2850,6 +2879,8 b' table = {' | |||
|
2850 | 2879 | ('u', 'user', '', _('record user as committer')), |
|
2851 | 2880 | ] + walkopts, |
|
2852 | 2881 | _('hg backout [OPTION]... REV')), |
|
2882 | "branch": (branch, [], _('hg branch [NAME]')), | |
|
2883 | "branches": (branches, [], _('hg branches')), | |
|
2853 | 2884 | "bundle": |
|
2854 | 2885 | (bundle, |
|
2855 | 2886 | [('f', 'force', None, |
@@ -4,6 +4,8 b' addremove' | |||
|
4 | 4 | annotate |
|
5 | 5 | archive |
|
6 | 6 | backout |
|
7 | branch | |
|
8 | branches | |
|
7 | 9 | bundle |
|
8 | 10 | cat |
|
9 | 11 | clone |
@@ -120,6 +120,8 b' list of commands (use "hg help -v" to sh' | |||
|
120 | 120 | annotate show changeset information per file line |
|
121 | 121 | archive create unversioned archive of a repository revision |
|
122 | 122 | backout reverse effect of earlier changeset |
|
123 | branch set or show the current branch name | |
|
124 | branches list repository named branches | |
|
123 | 125 | bundle create a changegroup file |
|
124 | 126 | cat output the latest or given revisions of files |
|
125 | 127 | clone make a copy of an existing repository |
@@ -168,6 +170,8 b' list of commands (use "hg help -v" to sh' | |||
|
168 | 170 | annotate show changeset information per file line |
|
169 | 171 | archive create unversioned archive of a repository revision |
|
170 | 172 | backout reverse effect of earlier changeset |
|
173 | branch set or show the current branch name | |
|
174 | branches list repository named branches | |
|
171 | 175 | bundle create a changegroup file |
|
172 | 176 | cat output the latest or given revisions of files |
|
173 | 177 | clone make a copy of an existing repository |
@@ -43,6 +43,8 b' list of commands (use "hg help -v" to sh' | |||
|
43 | 43 | annotate show changeset information per file line |
|
44 | 44 | archive create unversioned archive of a repository revision |
|
45 | 45 | backout reverse effect of earlier changeset |
|
46 | branch set or show the current branch name | |
|
47 | branches list repository named branches | |
|
46 | 48 | bundle create a changegroup file |
|
47 | 49 | cat output the latest or given revisions of files |
|
48 | 50 | clone make a copy of an existing repository |
@@ -87,6 +89,8 b' list of commands (use "hg help -v" to sh' | |||
|
87 | 89 | annotate show changeset information per file line |
|
88 | 90 | archive create unversioned archive of a repository revision |
|
89 | 91 | backout reverse effect of earlier changeset |
|
92 | branch set or show the current branch name | |
|
93 | branches list repository named branches | |
|
90 | 94 | bundle create a changegroup file |
|
91 | 95 | cat output the latest or given revisions of files |
|
92 | 96 | clone make a copy of an existing repository |
@@ -2,27 +2,32 b'' | |||
|
2 | 2 | |
|
3 | 3 | hg init t |
|
4 | 4 | cd t |
|
5 | hg branches | |
|
5 | 6 | |
|
6 | 7 | echo foo > a |
|
7 | 8 | hg add a |
|
8 | 9 | hg ci -m "initial" -d "0 0" |
|
9 | echo foo > .hg/branch | |
|
10 | hg branch foo | |
|
11 | hg branch | |
|
10 | 12 | hg ci -m "add branch name" -d "0 0" |
|
11 | echo bar > .hg/branch | |
|
13 | hg branch bar | |
|
12 | 14 | hg ci -m "change branch name" -d "0 0" |
|
13 |
|
|
|
15 | hg branch "" | |
|
14 | 16 | hg ci -m "clear branch name" -d "0 0" |
|
15 | 17 | |
|
16 | 18 | hg co foo |
|
17 |
|
|
|
19 | hg branch | |
|
18 | 20 | echo bleah > a |
|
19 | 21 | hg ci -m "modify a branch" -d "0 0" |
|
20 | 22 | |
|
21 | 23 | hg merge |
|
22 |
|
|
|
24 | hg branch | |
|
23 | 25 | HG_MERGE=true hg ci -m "merge" -d "0 0" |
|
24 | 26 | hg log |
|
25 | 27 | |
|
28 | hg branches | |
|
29 | hg branches -q | |
|
30 | ||
|
26 | 31 | echo % test for invalid branch cache |
|
27 | 32 | hg rollback |
|
28 | 33 | hg tip |
@@ -1,3 +1,4 b'' | |||
|
1 | foo | |
|
1 | 2 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 3 | foo |
|
3 | 4 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -41,6 +42,10 b' user: test' | |||
|
41 | 42 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
42 | 43 | summary: initial |
|
43 | 44 | |
|
45 | foo 5:dc140083783b | |
|
46 | bar 2:ed2bbf4e0102 | |
|
47 | foo | |
|
48 | bar | |
|
44 | 49 | % test for invalid branch cache |
|
45 | 50 | rolling back last transaction |
|
46 | 51 | changeset: 4:98d14f698afe |
General Comments 0
You need to be logged in to leave comments.
Login now