Mercurial > hg
comparison tests/test-newbranch.t @ 22363:9510b0e9480b
tests: improve test coverage of branch command and existing branches
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 29 Aug 2014 12:17:53 +0200 |
parents | 7731a2281cf0 |
children | 701df761aa94 |
comparison
equal
deleted
inserted
replaced
22362:c9b32c6a2944 | 22363:9510b0e9480b |
---|---|
49 tag: tip | 49 tag: tip |
50 user: test | 50 user: test |
51 date: Thu Jan 01 00:00:00 1970 +0000 | 51 date: Thu Jan 01 00:00:00 1970 +0000 |
52 summary: clear branch name | 52 summary: clear branch name |
53 | 53 |
54 Merging and branches | |
54 | 55 |
55 $ hg co foo | 56 $ hg co foo |
56 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 57 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
57 $ hg branch | 58 $ hg branch |
58 foo | 59 foo |
60 | |
61 set existing branch name fails unless force - setting existing parent branch works without force: | |
62 | |
63 $ hg branch bar | |
64 abort: a branch of the same name already exists | |
65 (use 'hg update' to switch to it) | |
66 [255] | |
67 | |
68 $ hg branch -f bar | |
69 marked working directory as branch bar | |
70 (branches are permanent and global, did you want a bookmark?) | |
71 | |
72 $ hg branch foo | |
73 marked working directory as branch foo | |
74 (branches are permanent and global, did you want a bookmark?) | |
75 | |
59 $ echo bleah > a | 76 $ echo bleah > a |
60 $ hg ci -m "modify a branch" | 77 $ hg ci -m "modify a branch" |
61 | 78 |
62 $ hg merge default | 79 $ hg merge default |
63 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
64 (branch merge, don't forget to commit) | 81 (branch merge, don't forget to commit) |
65 | 82 |
66 $ hg branch | 83 $ hg branch |
67 foo | 84 foo |
85 | |
86 set existing branch name where branch head is ancestor: | |
87 | |
88 $ hg branch bar | |
89 abort: a branch of the same name already exists | |
90 (use 'hg update' to switch to it) | |
91 [255] | |
92 | |
93 set (other) parent branch as branch name | |
94 | |
95 $ hg branch default | |
96 marked working directory as branch default | |
97 (branches are permanent and global, did you want a bookmark?) | |
98 | |
99 set (first) parent branch as branch name | |
100 | |
101 $ hg branch foo | |
102 marked working directory as branch foo | |
103 (branches are permanent and global, did you want a bookmark?) | |
104 | |
68 $ hg ci -m "merge" | 105 $ hg ci -m "merge" |
69 | 106 |
70 $ hg log | 107 $ hg log -G -T '{rev}:{node|short} {branch} {desc}\n' |
71 changeset: 5:530046499edf | 108 @ 5:530046499edf foo merge |
72 branch: foo | 109 |\ |
73 tag: tip | 110 | o 4:adf1a74a7f7b foo modify a branch |
74 parent: 4:adf1a74a7f7b | 111 | | |
75 parent: 3:1c28f494dae6 | 112 o | 3:1c28f494dae6 default clear branch name |
76 user: test | 113 | | |
77 date: Thu Jan 01 00:00:00 1970 +0000 | 114 o | 2:c21617b13b22 bar change branch name |
78 summary: merge | 115 |/ |
79 | 116 o 1:6c0e42da283a foo add branch name |
80 changeset: 4:adf1a74a7f7b | 117 | |
81 branch: foo | 118 o 0:db01e8ea3388 default initial |
82 parent: 1:6c0e42da283a | |
83 user: test | |
84 date: Thu Jan 01 00:00:00 1970 +0000 | |
85 summary: modify a branch | |
86 | |
87 changeset: 3:1c28f494dae6 | |
88 user: test | |
89 date: Thu Jan 01 00:00:00 1970 +0000 | |
90 summary: clear branch name | |
91 | |
92 changeset: 2:c21617b13b22 | |
93 branch: bar | |
94 user: test | |
95 date: Thu Jan 01 00:00:00 1970 +0000 | |
96 summary: change branch name | |
97 | |
98 changeset: 1:6c0e42da283a | |
99 branch: foo | |
100 user: test | |
101 date: Thu Jan 01 00:00:00 1970 +0000 | |
102 summary: add branch name | |
103 | |
104 changeset: 0:db01e8ea3388 | |
105 user: test | |
106 date: Thu Jan 01 00:00:00 1970 +0000 | |
107 summary: initial | |
108 | 119 |
109 $ hg branches | 120 $ hg branches |
110 foo 5:530046499edf | 121 foo 5:530046499edf |
111 default 3:1c28f494dae6 (inactive) | 122 default 3:1c28f494dae6 (inactive) |
112 bar 2:c21617b13b22 (inactive) | 123 bar 2:c21617b13b22 (inactive) |