Show More
@@ -1,316 +1,316 b'' | |||||
1 | Test basic functionality of url#rev syntax |
|
1 | Test basic functionality of url#rev syntax | |
2 |
|
2 | |||
3 | $ hg init repo |
|
3 | $ hg init repo | |
4 | $ cd repo |
|
4 | $ cd repo | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg ci -qAm 'add a' |
|
6 | $ hg ci -qAm 'add a' | |
7 | $ hg branch foo |
|
7 | $ hg branch foo | |
8 | marked working directory as branch foo |
|
8 | marked working directory as branch foo | |
9 | (branches are permanent and global, did you want a bookmark?) |
|
9 | (branches are permanent and global, did you want a bookmark?) | |
10 | $ echo >> a |
|
10 | $ echo >> a | |
11 | $ hg ci -m 'change a' |
|
11 | $ hg ci -m 'change a' | |
12 | $ cd .. |
|
12 | $ cd .. | |
13 |
|
13 | |||
14 | $ hg clone 'repo#foo' clone |
|
14 | $ hg clone 'repo#foo' clone | |
15 | adding changesets |
|
15 | adding changesets | |
16 | adding manifests |
|
16 | adding manifests | |
17 | adding file changes |
|
17 | adding file changes | |
18 | added 2 changesets with 2 changes to 1 files |
|
18 | added 2 changesets with 2 changes to 1 files | |
19 | updating to branch foo |
|
19 | updating to branch foo | |
20 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
20 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
21 |
|
21 | |||
22 | $ hg --cwd clone heads |
|
22 | $ hg --cwd clone heads | |
23 | changeset: 1:cd2a86ecc814 |
|
23 | changeset: 1:cd2a86ecc814 | |
24 | branch: foo |
|
24 | branch: foo | |
25 | tag: tip |
|
25 | tag: tip | |
26 | user: test |
|
26 | user: test | |
27 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
27 | date: Thu Jan 01 00:00:00 1970 +0000 | |
28 | summary: change a |
|
28 | summary: change a | |
29 |
|
29 | |||
30 | changeset: 0:1f0dee641bb7 |
|
30 | changeset: 0:1f0dee641bb7 | |
31 | user: test |
|
31 | user: test | |
32 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
32 | date: Thu Jan 01 00:00:00 1970 +0000 | |
33 | summary: add a |
|
33 | summary: add a | |
34 |
|
34 | |||
35 | $ hg --cwd clone parents |
|
35 | $ hg --cwd clone parents | |
36 | changeset: 1:cd2a86ecc814 |
|
36 | changeset: 1:cd2a86ecc814 | |
37 | branch: foo |
|
37 | branch: foo | |
38 | tag: tip |
|
38 | tag: tip | |
39 | user: test |
|
39 | user: test | |
40 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | date: Thu Jan 01 00:00:00 1970 +0000 | |
41 | summary: change a |
|
41 | summary: change a | |
42 |
|
42 | |||
43 | $ cat clone/.hg/hgrc |
|
43 | $ cat clone/.hg/hgrc | |
44 | # example repository config (see "hg help config" for more info) |
|
44 | # example repository config (see "hg help config" for more info) | |
45 | [paths] |
|
45 | [paths] | |
46 |
default = $TESTTMP/repo# |
|
46 | default = $TESTTMP/repo#foo (glob) | |
47 |
|
47 | |||
48 | # path aliases to other clones of this repo in URLs or filesystem paths |
|
48 | # path aliases to other clones of this repo in URLs or filesystem paths | |
49 | # (see "hg help config.paths" for more info) |
|
49 | # (see "hg help config.paths" for more info) | |
50 | # |
|
50 | # | |
51 | # default-push = ssh://jdoe@example.net/hg/jdoes-fork |
|
51 | # default-push = ssh://jdoe@example.net/hg/jdoes-fork | |
52 | # my-fork = ssh://jdoe@example.net/hg/jdoes-fork |
|
52 | # my-fork = ssh://jdoe@example.net/hg/jdoes-fork | |
53 | # my-clone = /home/jdoe/jdoes-clone |
|
53 | # my-clone = /home/jdoe/jdoes-clone | |
54 |
|
54 | |||
55 | [ui] |
|
55 | [ui] | |
56 | # name and email (local to this repository, optional), e.g. |
|
56 | # name and email (local to this repository, optional), e.g. | |
57 | # username = Jane Doe <jdoe@example.com> |
|
57 | # username = Jane Doe <jdoe@example.com> | |
58 |
|
58 | |||
59 | Changing original repo: |
|
59 | Changing original repo: | |
60 |
|
60 | |||
61 | $ cd repo |
|
61 | $ cd repo | |
62 |
|
62 | |||
63 | $ echo >> a |
|
63 | $ echo >> a | |
64 | $ hg ci -m 'new head of branch foo' |
|
64 | $ hg ci -m 'new head of branch foo' | |
65 |
|
65 | |||
66 | $ hg up -qC default |
|
66 | $ hg up -qC default | |
67 | $ echo bar > bar |
|
67 | $ echo bar > bar | |
68 | $ hg ci -qAm 'add bar' |
|
68 | $ hg ci -qAm 'add bar' | |
69 |
|
69 | |||
70 | $ hg log |
|
70 | $ hg log | |
71 | changeset: 3:4cd725637392 |
|
71 | changeset: 3:4cd725637392 | |
72 | tag: tip |
|
72 | tag: tip | |
73 | parent: 0:1f0dee641bb7 |
|
73 | parent: 0:1f0dee641bb7 | |
74 | user: test |
|
74 | user: test | |
75 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
75 | date: Thu Jan 01 00:00:00 1970 +0000 | |
76 | summary: add bar |
|
76 | summary: add bar | |
77 |
|
77 | |||
78 | changeset: 2:faba9097cad4 |
|
78 | changeset: 2:faba9097cad4 | |
79 | branch: foo |
|
79 | branch: foo | |
80 | user: test |
|
80 | user: test | |
81 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
81 | date: Thu Jan 01 00:00:00 1970 +0000 | |
82 | summary: new head of branch foo |
|
82 | summary: new head of branch foo | |
83 |
|
83 | |||
84 | changeset: 1:cd2a86ecc814 |
|
84 | changeset: 1:cd2a86ecc814 | |
85 | branch: foo |
|
85 | branch: foo | |
86 | user: test |
|
86 | user: test | |
87 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
87 | date: Thu Jan 01 00:00:00 1970 +0000 | |
88 | summary: change a |
|
88 | summary: change a | |
89 |
|
89 | |||
90 | changeset: 0:1f0dee641bb7 |
|
90 | changeset: 0:1f0dee641bb7 | |
91 | user: test |
|
91 | user: test | |
92 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
92 | date: Thu Jan 01 00:00:00 1970 +0000 | |
93 | summary: add a |
|
93 | summary: add a | |
94 |
|
94 | |||
95 | $ hg -q outgoing '../clone' |
|
95 | $ hg -q outgoing '../clone' | |
96 | 2:faba9097cad4 |
|
96 | 2:faba9097cad4 | |
97 | 3:4cd725637392 |
|
97 | 3:4cd725637392 | |
98 | $ hg summary --remote --config paths.default='../clone' |
|
98 | $ hg summary --remote --config paths.default='../clone' | |
99 | parent: 3:4cd725637392 tip |
|
99 | parent: 3:4cd725637392 tip | |
100 | add bar |
|
100 | add bar | |
101 | branch: default |
|
101 | branch: default | |
102 | commit: (clean) |
|
102 | commit: (clean) | |
103 | update: (current) |
|
103 | update: (current) | |
104 | remote: 2 outgoing |
|
104 | remote: 2 outgoing | |
105 | $ hg -q outgoing '../clone#foo' |
|
105 | $ hg -q outgoing '../clone#foo' | |
106 | 2:faba9097cad4 |
|
106 | 2:faba9097cad4 | |
107 | $ hg summary --remote --config paths.default='../clone#foo' |
|
107 | $ hg summary --remote --config paths.default='../clone#foo' | |
108 | parent: 3:4cd725637392 tip |
|
108 | parent: 3:4cd725637392 tip | |
109 | add bar |
|
109 | add bar | |
110 | branch: default |
|
110 | branch: default | |
111 | commit: (clean) |
|
111 | commit: (clean) | |
112 | update: (current) |
|
112 | update: (current) | |
113 | remote: 1 outgoing |
|
113 | remote: 1 outgoing | |
114 |
|
114 | |||
115 | $ hg -q --cwd ../clone incoming '../repo#foo' |
|
115 | $ hg -q --cwd ../clone incoming '../repo#foo' | |
116 | 2:faba9097cad4 |
|
116 | 2:faba9097cad4 | |
117 | $ hg --cwd ../clone summary --remote --config paths.default='../repo#foo' |
|
117 | $ hg --cwd ../clone summary --remote --config paths.default='../repo#foo' | |
118 | parent: 1:cd2a86ecc814 tip |
|
118 | parent: 1:cd2a86ecc814 tip | |
119 | change a |
|
119 | change a | |
120 | branch: foo |
|
120 | branch: foo | |
121 | commit: (clean) |
|
121 | commit: (clean) | |
122 | update: (current) |
|
122 | update: (current) | |
123 | remote: 1 or more incoming |
|
123 | remote: 1 or more incoming | |
124 |
|
124 | |||
125 | $ hg -q push '../clone#foo' |
|
125 | $ hg -q push '../clone#foo' | |
126 |
|
126 | |||
127 | $ hg --cwd ../clone heads |
|
127 | $ hg --cwd ../clone heads | |
128 | changeset: 2:faba9097cad4 |
|
128 | changeset: 2:faba9097cad4 | |
129 | branch: foo |
|
129 | branch: foo | |
130 | tag: tip |
|
130 | tag: tip | |
131 | user: test |
|
131 | user: test | |
132 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
132 | date: Thu Jan 01 00:00:00 1970 +0000 | |
133 | summary: new head of branch foo |
|
133 | summary: new head of branch foo | |
134 |
|
134 | |||
135 | changeset: 0:1f0dee641bb7 |
|
135 | changeset: 0:1f0dee641bb7 | |
136 | user: test |
|
136 | user: test | |
137 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
137 | date: Thu Jan 01 00:00:00 1970 +0000 | |
138 | summary: add a |
|
138 | summary: add a | |
139 |
|
139 | |||
140 | $ hg -q --cwd ../clone incoming '../repo#foo' |
|
140 | $ hg -q --cwd ../clone incoming '../repo#foo' | |
141 | [1] |
|
141 | [1] | |
142 | $ hg --cwd ../clone summary --remote --config paths.default='../repo#foo' |
|
142 | $ hg --cwd ../clone summary --remote --config paths.default='../repo#foo' | |
143 | parent: 1:cd2a86ecc814 |
|
143 | parent: 1:cd2a86ecc814 | |
144 | change a |
|
144 | change a | |
145 | branch: foo |
|
145 | branch: foo | |
146 | commit: (clean) |
|
146 | commit: (clean) | |
147 | update: 1 new changesets (update) |
|
147 | update: 1 new changesets (update) | |
148 | remote: (synced) |
|
148 | remote: (synced) | |
149 |
|
149 | |||
150 | $ cd .. |
|
150 | $ cd .. | |
151 |
|
151 | |||
152 | $ cd clone |
|
152 | $ cd clone | |
153 | $ hg rollback |
|
153 | $ hg rollback | |
154 | repository tip rolled back to revision 1 (undo push) |
|
154 | repository tip rolled back to revision 1 (undo push) | |
155 |
|
155 | |||
156 | $ hg -q incoming |
|
156 | $ hg -q incoming | |
157 | 2:faba9097cad4 |
|
157 | 2:faba9097cad4 | |
158 |
|
158 | |||
159 | $ hg -q pull |
|
159 | $ hg -q pull | |
160 |
|
160 | |||
161 | $ hg heads |
|
161 | $ hg heads | |
162 | changeset: 2:faba9097cad4 |
|
162 | changeset: 2:faba9097cad4 | |
163 | branch: foo |
|
163 | branch: foo | |
164 | tag: tip |
|
164 | tag: tip | |
165 | user: test |
|
165 | user: test | |
166 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
166 | date: Thu Jan 01 00:00:00 1970 +0000 | |
167 | summary: new head of branch foo |
|
167 | summary: new head of branch foo | |
168 |
|
168 | |||
169 | changeset: 0:1f0dee641bb7 |
|
169 | changeset: 0:1f0dee641bb7 | |
170 | user: test |
|
170 | user: test | |
171 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
171 | date: Thu Jan 01 00:00:00 1970 +0000 | |
172 | summary: add a |
|
172 | summary: add a | |
173 |
|
173 | |||
174 | Pull should not have updated: |
|
174 | Pull should not have updated: | |
175 |
|
175 | |||
176 | $ hg parents -q |
|
176 | $ hg parents -q | |
177 | 1:cd2a86ecc814 |
|
177 | 1:cd2a86ecc814 | |
178 |
|
178 | |||
179 | Going back to the default branch: |
|
179 | Going back to the default branch: | |
180 |
|
180 | |||
181 | $ hg up -C 0 |
|
181 | $ hg up -C 0 | |
182 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
182 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
183 |
|
183 | |||
184 | $ hg parents |
|
184 | $ hg parents | |
185 | changeset: 0:1f0dee641bb7 |
|
185 | changeset: 0:1f0dee641bb7 | |
186 | user: test |
|
186 | user: test | |
187 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
187 | date: Thu Jan 01 00:00:00 1970 +0000 | |
188 | summary: add a |
|
188 | summary: add a | |
189 |
|
189 | |||
190 | No new revs, no update: |
|
190 | No new revs, no update: | |
191 |
|
191 | |||
192 | $ hg pull -qu |
|
192 | $ hg pull -qu | |
193 |
|
193 | |||
194 | $ hg parents -q |
|
194 | $ hg parents -q | |
195 | 0:1f0dee641bb7 |
|
195 | 0:1f0dee641bb7 | |
196 |
|
196 | |||
197 | $ hg rollback |
|
197 | $ hg rollback | |
198 | repository tip rolled back to revision 1 (undo pull) |
|
198 | repository tip rolled back to revision 1 (undo pull) | |
199 |
|
199 | |||
200 | $ hg parents -q |
|
200 | $ hg parents -q | |
201 | 0:1f0dee641bb7 |
|
201 | 0:1f0dee641bb7 | |
202 |
|
202 | |||
203 | Pull -u takes us back to branch foo: |
|
203 | Pull -u takes us back to branch foo: | |
204 |
|
204 | |||
205 | $ hg pull -qu |
|
205 | $ hg pull -qu | |
206 |
|
206 | |||
207 | $ hg parents |
|
207 | $ hg parents | |
208 | changeset: 2:faba9097cad4 |
|
208 | changeset: 2:faba9097cad4 | |
209 | branch: foo |
|
209 | branch: foo | |
210 | tag: tip |
|
210 | tag: tip | |
211 | user: test |
|
211 | user: test | |
212 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
212 | date: Thu Jan 01 00:00:00 1970 +0000 | |
213 | summary: new head of branch foo |
|
213 | summary: new head of branch foo | |
214 |
|
214 | |||
215 | $ hg rollback |
|
215 | $ hg rollback | |
216 | repository tip rolled back to revision 1 (undo pull) |
|
216 | repository tip rolled back to revision 1 (undo pull) | |
217 | working directory now based on revision 0 |
|
217 | working directory now based on revision 0 | |
218 |
|
218 | |||
219 | $ hg up -C 0 |
|
219 | $ hg up -C 0 | |
220 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
220 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
221 |
|
221 | |||
222 | $ hg parents -q |
|
222 | $ hg parents -q | |
223 | 0:1f0dee641bb7 |
|
223 | 0:1f0dee641bb7 | |
224 |
|
224 | |||
225 | $ hg heads -q |
|
225 | $ hg heads -q | |
226 | 1:cd2a86ecc814 |
|
226 | 1:cd2a86ecc814 | |
227 | 0:1f0dee641bb7 |
|
227 | 0:1f0dee641bb7 | |
228 |
|
228 | |||
229 | $ hg pull -qur default default |
|
229 | $ hg pull -qur default default | |
230 |
|
230 | |||
231 | $ hg parents |
|
231 | $ hg parents | |
232 | changeset: 3:4cd725637392 |
|
232 | changeset: 3:4cd725637392 | |
233 | tag: tip |
|
233 | tag: tip | |
234 | parent: 0:1f0dee641bb7 |
|
234 | parent: 0:1f0dee641bb7 | |
235 | user: test |
|
235 | user: test | |
236 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
236 | date: Thu Jan 01 00:00:00 1970 +0000 | |
237 | summary: add bar |
|
237 | summary: add bar | |
238 |
|
238 | |||
239 | $ hg heads |
|
239 | $ hg heads | |
240 | changeset: 3:4cd725637392 |
|
240 | changeset: 3:4cd725637392 | |
241 | tag: tip |
|
241 | tag: tip | |
242 | parent: 0:1f0dee641bb7 |
|
242 | parent: 0:1f0dee641bb7 | |
243 | user: test |
|
243 | user: test | |
244 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
244 | date: Thu Jan 01 00:00:00 1970 +0000 | |
245 | summary: add bar |
|
245 | summary: add bar | |
246 |
|
246 | |||
247 | changeset: 2:faba9097cad4 |
|
247 | changeset: 2:faba9097cad4 | |
248 | branch: foo |
|
248 | branch: foo | |
249 | user: test |
|
249 | user: test | |
250 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
250 | date: Thu Jan 01 00:00:00 1970 +0000 | |
251 | summary: new head of branch foo |
|
251 | summary: new head of branch foo | |
252 |
|
252 | |||
253 | Test handling of invalid urls |
|
253 | Test handling of invalid urls | |
254 |
|
254 | |||
255 | $ hg id http://foo/?bar |
|
255 | $ hg id http://foo/?bar | |
256 | abort: unsupported URL component: "bar" |
|
256 | abort: unsupported URL component: "bar" | |
257 | [255] |
|
257 | [255] | |
258 |
|
258 | |||
259 | $ cd .. |
|
259 | $ cd .. | |
260 |
|
260 | |||
261 | Test handling common incoming revisions between "default" and |
|
261 | Test handling common incoming revisions between "default" and | |
262 | "default-push" |
|
262 | "default-push" | |
263 |
|
263 | |||
264 | $ hg -R clone rollback |
|
264 | $ hg -R clone rollback | |
265 | repository tip rolled back to revision 1 (undo pull) |
|
265 | repository tip rolled back to revision 1 (undo pull) | |
266 | working directory now based on revision 0 |
|
266 | working directory now based on revision 0 | |
267 |
|
267 | |||
268 | $ cd repo |
|
268 | $ cd repo | |
269 |
|
269 | |||
270 | $ hg update -q -C default |
|
270 | $ hg update -q -C default | |
271 | $ echo modified >> bar |
|
271 | $ echo modified >> bar | |
272 | $ hg commit -m "new head to push current default head" |
|
272 | $ hg commit -m "new head to push current default head" | |
273 | $ hg -q push -r ".^1" '../clone' |
|
273 | $ hg -q push -r ".^1" '../clone' | |
274 |
|
274 | |||
275 | $ hg -q outgoing '../clone' |
|
275 | $ hg -q outgoing '../clone' | |
276 | 2:faba9097cad4 |
|
276 | 2:faba9097cad4 | |
277 | 4:d515801a8f3d |
|
277 | 4:d515801a8f3d | |
278 |
|
278 | |||
279 | $ hg summary --remote --config paths.default='../clone#default' --config paths.default-push='../clone#foo' |
|
279 | $ hg summary --remote --config paths.default='../clone#default' --config paths.default-push='../clone#foo' | |
280 | parent: 4:d515801a8f3d tip |
|
280 | parent: 4:d515801a8f3d tip | |
281 | new head to push current default head |
|
281 | new head to push current default head | |
282 | branch: default |
|
282 | branch: default | |
283 | commit: (clean) |
|
283 | commit: (clean) | |
284 | update: (current) |
|
284 | update: (current) | |
285 | remote: 1 outgoing |
|
285 | remote: 1 outgoing | |
286 |
|
286 | |||
287 | $ hg summary --remote --config paths.default='../clone#foo' --config paths.default-push='../clone' |
|
287 | $ hg summary --remote --config paths.default='../clone#foo' --config paths.default-push='../clone' | |
288 | parent: 4:d515801a8f3d tip |
|
288 | parent: 4:d515801a8f3d tip | |
289 | new head to push current default head |
|
289 | new head to push current default head | |
290 | branch: default |
|
290 | branch: default | |
291 | commit: (clean) |
|
291 | commit: (clean) | |
292 | update: (current) |
|
292 | update: (current) | |
293 | remote: 2 outgoing |
|
293 | remote: 2 outgoing | |
294 |
|
294 | |||
295 | $ hg summary --remote --config paths.default='../clone' --config paths.default-push='../clone#foo' |
|
295 | $ hg summary --remote --config paths.default='../clone' --config paths.default-push='../clone#foo' | |
296 | parent: 4:d515801a8f3d tip |
|
296 | parent: 4:d515801a8f3d tip | |
297 | new head to push current default head |
|
297 | new head to push current default head | |
298 | branch: default |
|
298 | branch: default | |
299 | commit: (clean) |
|
299 | commit: (clean) | |
300 | update: (current) |
|
300 | update: (current) | |
301 | remote: 1 outgoing |
|
301 | remote: 1 outgoing | |
302 |
|
302 | |||
303 | $ hg clone -q -r 0 . ../another |
|
303 | $ hg clone -q -r 0 . ../another | |
304 | $ hg -q outgoing '../another#default' |
|
304 | $ hg -q outgoing '../another#default' | |
305 | 3:4cd725637392 |
|
305 | 3:4cd725637392 | |
306 | 4:d515801a8f3d |
|
306 | 4:d515801a8f3d | |
307 |
|
307 | |||
308 | $ hg summary --remote --config paths.default='../another#default' --config paths.default-push='../clone#default' |
|
308 | $ hg summary --remote --config paths.default='../another#default' --config paths.default-push='../clone#default' | |
309 | parent: 4:d515801a8f3d tip |
|
309 | parent: 4:d515801a8f3d tip | |
310 | new head to push current default head |
|
310 | new head to push current default head | |
311 | branch: default |
|
311 | branch: default | |
312 | commit: (clean) |
|
312 | commit: (clean) | |
313 | update: (current) |
|
313 | update: (current) | |
314 | remote: 1 outgoing |
|
314 | remote: 1 outgoing | |
315 |
|
315 | |||
316 | $ cd .. |
|
316 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now