Show More
@@ -1,83 +1,206 b'' | |||||
1 | #!/bin/sh |
|
|||
2 | # test basic functionality of url#rev syntax |
|
1 | # test basic functionality of url#rev syntax | |
3 |
|
2 | |||
4 | hg init repo |
|
3 | $ hg init repo | |
5 | cd repo |
|
4 | $ cd repo | |
6 | echo a > a |
|
5 | $ echo a > a | |
7 | hg ci -qAm 'add a' |
|
6 | $ hg ci -qAm 'add a' | |
8 | hg branch foo |
|
7 | $ hg branch foo | |
9 | echo >> a |
|
8 | marked working directory as branch foo | |
10 | hg ci -m 'change a' |
|
9 | $ echo >> a | |
11 | cd .. |
|
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' |
|
22 | $ hg --cwd clone heads | |
14 | hg clone 'repo#foo' clone |
|
23 | changeset: 1:cd2a86ecc814 | |
15 | echo '% heads' |
|
24 | branch: foo | |
16 | hg --cwd clone heads |
|
25 | tag: tip | |
17 | echo '% parents' |
|
26 | user: test | |
18 | hg --cwd clone parents |
|
27 | date: Thu Jan 01 00:00:00 1970 +0000 | |
19 | sed -e 's/default.*#/default = #/' clone/.hg/hgrc |
|
28 | summary: change a | |
20 | echo |
|
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' |
|
51 | $ echo >> a | |
23 | cd repo |
|
52 | $ hg ci -m 'new head of branch foo' | |
24 | echo >> a |
|
53 | ||
25 | hg ci -m 'new head of branch foo' |
|
54 | $ hg up -qC default | |
26 | hg up -qC default |
|
55 | $ echo bar > bar | |
27 | echo bar > bar |
|
56 | $ hg ci -qAm 'add bar' | |
28 | hg ci -qAm 'add bar' |
|
|||
29 | hg log |
|
|||
30 | echo |
|
|||
31 |
|
57 | |||
32 | echo '% outgoing' |
|
58 | $ hg log | |
33 | hg -q outgoing '../clone#foo' |
|
59 | changeset: 3:4cd725637392 | |
34 | echo |
|
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 | |||
|
71 | ||||
|
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' |
|
86 | $ hg -q push '../clone#foo' | |
37 | hg -q push '../clone#foo' |
|
87 | ||
38 | hg --cwd ../clone heads |
|
88 | $ hg --cwd ../clone heads | |
39 | cd .. |
|
89 | changeset: 2:faba9097cad4 | |
40 | echo |
|
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' |
|
103 | $ cd clone | |
43 | cd clone |
|
104 | $ hg rollback | |
44 | 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' |
|
127 | $ hg parents -q | |
47 | hg -q incoming |
|
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' |
|
135 | $ hg parents | |
50 | hg -q pull |
|
136 | changeset: 0:1f0dee641bb7 | |
51 | hg heads |
|
137 | user: test | |
52 | echo |
|
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' |
|
154 | $ hg parents -q | |
55 | hg parents -q |
|
155 | 0:1f0dee641bb7 | |
56 | echo '% going back to the default branch' |
|
156 | ||
57 | hg up -C 0 |
|
157 | Pull -u takes us back to branch foo: | |
58 | hg parents |
|
158 | ||
59 | echo '% no new revs, no update' |
|
159 | $ hg pull -qu | |
60 | hg pull -qu |
|
160 | ||
61 |
hg parents |
|
161 | $ hg parents | |
62 | echo '% rollback' |
|
162 | changeset: 2:faba9097cad4 | |
63 | hg rollback |
|
163 | branch: foo | |
64 | hg up -C 0 |
|
164 | tag: tip | |
65 | hg parents -q |
|
165 | user: test | |
66 | echo '% pull -u takes us back to branch foo' |
|
166 | date: Thu Jan 01 00:00:00 1970 +0000 | |
67 | hg pull -qu |
|
167 | summary: new head of branch foo | |
68 | hg parents |
|
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' |
|
178 | $ hg heads -q | |
71 | hg rollback |
|
179 | 1:cd2a86ecc814 | |
72 | hg up -C 0 |
|
180 | 0:1f0dee641bb7 | |
73 | echo '% parents' |
|
181 | ||
74 | hg parents -q |
|
182 | $ hg pull -qur default default | |
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 |
|
|||
83 |
|
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 | |||
|
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 |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now