##// END OF EJS Templates
tests: unify test-url-rev
Adrian Buehlmann -
r12300:ca31b0b2 default
parent child Browse files
Show More
@@ -1,83 +1,206 b''
1 #!/bin/sh
2 1 # test basic functionality of url#rev syntax
3 2
4 hg init repo
5 cd repo
6 echo a > a
7 hg ci -qAm 'add a'
8 hg branch foo
9 echo >> a
10 hg ci -m 'change a'
11 cd ..
3 $ hg init repo
4 $ cd repo
5 $ echo a > a
6 $ hg ci -qAm 'add a'
7 $ hg branch foo
8 marked working directory as branch foo
9 $ echo >> a
10 $ hg ci -m 'change a'
11 $ cd ..
12
13 $ hg clone 'repo#foo' clone
14 requesting all changes
15 adding changesets
16 adding manifests
17 adding file changes
18 added 2 changesets with 2 changes to 1 files
19 updating to branch foo
20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 21
13 echo '% clone repo#foo'
14 hg clone 'repo#foo' clone
15 echo '% heads'
16 hg --cwd clone heads
17 echo '% parents'
18 hg --cwd clone parents
19 sed -e 's/default.*#/default = #/' clone/.hg/hgrc
20 echo
22 $ hg --cwd clone heads
23 changeset: 1:cd2a86ecc814
24 branch: foo
25 tag: tip
26 user: test
27 date: Thu Jan 01 00:00:00 1970 +0000
28 summary: change a
29
30 changeset: 0:1f0dee641bb7
31 user: test
32 date: Thu Jan 01 00:00:00 1970 +0000
33 summary: add a
34
35 $ hg --cwd clone parents
36 changeset: 1:cd2a86ecc814
37 branch: foo
38 tag: tip
39 user: test
40 date: Thu Jan 01 00:00:00 1970 +0000
41 summary: change a
42
43 $ cat clone/.hg/hgrc
44 [paths]
45 default = .*/repo#foo
46
47 Changing original repo:
48
49 $ cd repo
21 50
22 echo '% changing original repo'
23 cd repo
24 echo >> a
25 hg ci -m 'new head of branch foo'
26 hg up -qC default
27 echo bar > bar
28 hg ci -qAm 'add bar'
29 hg log
30 echo
51 $ echo >> a
52 $ hg ci -m 'new head of branch foo'
53
54 $ hg up -qC default
55 $ echo bar > bar
56 $ hg ci -qAm 'add bar'
57
58 $ hg log
59 changeset: 3:4cd725637392
60 tag: tip
61 parent: 0:1f0dee641bb7
62 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: add bar
65
66 changeset: 2:faba9097cad4
67 branch: foo
68 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: new head of branch foo
31 71
32 echo '% outgoing'
33 hg -q outgoing '../clone#foo'
34 echo
72 changeset: 1:cd2a86ecc814
73 branch: foo
74 user: test
75 date: Thu Jan 01 00:00:00 1970 +0000
76 summary: change a
77
78 changeset: 0:1f0dee641bb7
79 user: test
80 date: Thu Jan 01 00:00:00 1970 +0000
81 summary: add a
82
83 $ hg -q outgoing '../clone#foo'
84 2:faba9097cad4
35 85
36 echo '% push'
37 hg -q push '../clone#foo'
38 hg --cwd ../clone heads
39 cd ..
40 echo
86 $ hg -q push '../clone#foo'
87
88 $ hg --cwd ../clone heads
89 changeset: 2:faba9097cad4
90 branch: foo
91 tag: tip
92 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: new head of branch foo
95
96 changeset: 0:1f0dee641bb7
97 user: test
98 date: Thu Jan 01 00:00:00 1970 +0000
99 summary: add a
100
101 $ cd ..
41 102
42 echo '% rolling back'
43 cd clone
44 hg rollback
103 $ cd clone
104 $ hg rollback
105 rolling back to revision 1 (undo push)
106
107 $ hg -q incoming
108 2:faba9097cad4
109
110 $ hg -q pull
111
112 $ hg heads
113 changeset: 2:faba9097cad4
114 branch: foo
115 tag: tip
116 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: new head of branch foo
119
120 changeset: 0:1f0dee641bb7
121 user: test
122 date: Thu Jan 01 00:00:00 1970 +0000
123 summary: add a
124
125 Pull should not have updated:
45 126
46 echo '% incoming'
47 hg -q incoming
127 $ hg parents -q
128 1:cd2a86ecc814
129
130 Going back to the default branch:
131
132 $ hg up -C 0
133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 134
49 echo '% pull'
50 hg -q pull
51 hg heads
52 echo
135 $ hg parents
136 changeset: 0:1f0dee641bb7
137 user: test
138 date: Thu Jan 01 00:00:00 1970 +0000
139 summary: add a
140
141 No new revs, no update:
142
143 $ hg pull -qu
144
145 $ hg parents -q
146 0:1f0dee641bb7
147
148 $ hg rollback
149 rolling back to revision 1 (undo pull)
150
151 $ hg up -C 0
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 153
54 echo '% pull should not have updated'
55 hg parents -q
56 echo '% going back to the default branch'
57 hg up -C 0
58 hg parents
59 echo '% no new revs, no update'
60 hg pull -qu
61 hg parents -q
62 echo '% rollback'
63 hg rollback
64 hg up -C 0
65 hg parents -q
66 echo '% pull -u takes us back to branch foo'
67 hg pull -qu
68 hg parents
154 $ hg parents -q
155 0:1f0dee641bb7
156
157 Pull -u takes us back to branch foo:
158
159 $ hg pull -qu
160
161 $ hg parents
162 changeset: 2:faba9097cad4
163 branch: foo
164 tag: tip
165 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
167 summary: new head of branch foo
168
169 $ hg rollback
170 rolling back to revision 1 (undo pull)
171
172 $ hg up -C 0
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174
175 $ hg parents -q
176 0:1f0dee641bb7
69 177
70 echo '% rollback'
71 hg rollback
72 hg up -C 0
73 echo '% parents'
74 hg parents -q
75 echo '% heads'
76 hg heads -q
77 echo '% pull -u -r otherrev url#rev updates to rev'
78 hg pull -qur default default
79 echo '% parents'
80 hg parents
81 echo '% heads'
82 hg heads
178 $ hg heads -q
179 1:cd2a86ecc814
180 0:1f0dee641bb7
181
182 $ hg pull -qur default default
183
184 $ hg parents
185 changeset: 3:4cd725637392
186 tag: tip
187 parent: 0:1f0dee641bb7
188 user: test
189 date: Thu Jan 01 00:00:00 1970 +0000
190 summary: add bar
83 191
192 $ hg heads
193 changeset: 3:4cd725637392
194 tag: tip
195 parent: 0:1f0dee641bb7
196 user: test
197 date: Thu Jan 01 00:00:00 1970 +0000
198 summary: add bar
199
200 changeset: 2:faba9097cad4
201 branch: foo
202 user: test
203 date: Thu Jan 01 00:00:00 1970 +0000
204 summary: new head of branch foo
205
206
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now