Show More
@@ -1,272 +1,272 b'' | |||||
1 | Check that obsolete properly strip heads |
|
1 | Check that obsolete properly strip heads | |
2 | $ cat > obs.py << EOF |
|
2 | $ cat > obs.py << EOF | |
3 | > import mercurial.obsolete |
|
3 | > import mercurial.obsolete | |
4 | > mercurial.obsolete._enabled = True |
|
4 | > mercurial.obsolete._enabled = True | |
5 | > EOF |
|
5 | > EOF | |
6 | $ cat >> $HGRCPATH << EOF |
|
6 | $ cat >> $HGRCPATH << EOF | |
7 | > [phases] |
|
7 | > [phases] | |
8 | > # public changeset are not obsolete |
|
8 | > # public changeset are not obsolete | |
9 | > publish=false |
|
9 | > publish=false | |
10 | > [ui] |
|
10 | > [ui] | |
11 | > logtemplate='{node|short} ({phase}) {desc|firstline}\n' |
|
11 | > logtemplate='{node|short} ({phase}) {desc|firstline}\n' | |
12 | > [extensions] |
|
12 | > [extensions] | |
13 | > graphlog= |
|
13 | > graphlog= | |
14 | > EOF |
|
14 | > EOF | |
15 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH |
|
15 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH | |
16 | $ mkcommit() { |
|
16 | $ mkcommit() { | |
17 | > echo "$1" > "$1" |
|
17 | > echo "$1" > "$1" | |
18 | > hg add "$1" |
|
18 | > hg add "$1" | |
19 | > hg ci -m "add $1" |
|
19 | > hg ci -m "add $1" | |
20 | > } |
|
20 | > } | |
21 | $ getid() { |
|
21 | $ getid() { | |
22 | > hg id --debug -ir "desc('$1')" |
|
22 | > hg id --debug -ir "desc('$1')" | |
23 | > } |
|
23 | > } | |
24 |
|
24 | |||
25 |
|
25 | |||
26 | $ hg init remote |
|
26 | $ hg init remote | |
27 | $ cd remote |
|
27 | $ cd remote | |
28 | $ mkcommit base |
|
28 | $ mkcommit base | |
29 | $ hg phase --public . |
|
29 | $ hg phase --public . | |
30 | $ cd .. |
|
30 | $ cd .. | |
31 | $ cp -r remote base |
|
31 | $ cp -r remote base | |
32 | $ hg clone remote local |
|
32 | $ hg clone remote local | |
33 | updating to branch default |
|
33 | updating to branch default | |
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
35 | $ cd local |
|
35 | $ cd local | |
36 |
|
36 | |||
37 | New head replaces old head |
|
37 | New head replaces old head | |
38 | ========================== |
|
38 | ========================== | |
39 |
|
39 | |||
40 | setup |
|
40 | setup | |
41 |
|
41 | |||
42 | $ mkcommit old |
|
42 | $ mkcommit old | |
43 | $ hg push |
|
43 | $ hg push | |
44 | pushing to $TESTTMP/remote |
|
44 | pushing to $TESTTMP/remote (glob) | |
45 | searching for changes |
|
45 | searching for changes | |
46 | adding changesets |
|
46 | adding changesets | |
47 | adding manifests |
|
47 | adding manifests | |
48 | adding file changes |
|
48 | adding file changes | |
49 | added 1 changesets with 1 changes to 1 files |
|
49 | added 1 changesets with 1 changes to 1 files | |
50 | $ hg up -q '.^' |
|
50 | $ hg up -q '.^' | |
51 | $ mkcommit new |
|
51 | $ mkcommit new | |
52 | created new head |
|
52 | created new head | |
53 | $ hg debugobsolete `getid old` `getid new` |
|
53 | $ hg debugobsolete `getid old` `getid new` | |
54 | $ hg glog --hidden |
|
54 | $ hg glog --hidden | |
55 | @ 71e3228bffe1 (draft) add new |
|
55 | @ 71e3228bffe1 (draft) add new | |
56 | | |
|
56 | | | |
57 | | x c70b08862e08 (draft) add old |
|
57 | | x c70b08862e08 (draft) add old | |
58 | |/ |
|
58 | |/ | |
59 | o b4952fcf48cf (public) add base |
|
59 | o b4952fcf48cf (public) add base | |
60 |
|
60 | |||
61 | $ cp -r ../remote ../backup1 |
|
61 | $ cp -r ../remote ../backup1 | |
62 |
|
62 | |||
63 | old exists remotely as draft. It is obsoleted by new that we now push. |
|
63 | old exists remotely as draft. It is obsoleted by new that we now push. | |
64 | Push should not warn about creating new head |
|
64 | Push should not warn about creating new head | |
65 |
|
65 | |||
66 | $ hg push |
|
66 | $ hg push | |
67 | pushing to $TESTTMP/remote |
|
67 | pushing to $TESTTMP/remote (glob) | |
68 | searching for changes |
|
68 | searching for changes | |
69 | adding changesets |
|
69 | adding changesets | |
70 | adding manifests |
|
70 | adding manifests | |
71 | adding file changes |
|
71 | adding file changes | |
72 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
72 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
73 |
|
73 | |||
74 | old head is now public (public local version) |
|
74 | old head is now public (public local version) | |
75 | ============================================= |
|
75 | ============================================= | |
76 |
|
76 | |||
77 | setup |
|
77 | setup | |
78 |
|
78 | |||
79 | $ rm -fr ../remote |
|
79 | $ rm -fr ../remote | |
80 | $ cp -r ../backup1 ../remote |
|
80 | $ cp -r ../backup1 ../remote | |
81 | $ hg -R ../remote phase --public c70b08862e08 |
|
81 | $ hg -R ../remote phase --public c70b08862e08 | |
82 | $ hg pull -v |
|
82 | $ hg pull -v | |
83 | pulling from $TESTTMP/remote |
|
83 | pulling from $TESTTMP/remote (glob) | |
84 | searching for changes |
|
84 | searching for changes | |
85 | no changes found |
|
85 | no changes found | |
86 | $ hg glog --hidden |
|
86 | $ hg glog --hidden | |
87 | @ 71e3228bffe1 (draft) add new |
|
87 | @ 71e3228bffe1 (draft) add new | |
88 | | |
|
88 | | | |
89 | | o c70b08862e08 (public) add old |
|
89 | | o c70b08862e08 (public) add old | |
90 | |/ |
|
90 | |/ | |
91 | o b4952fcf48cf (public) add base |
|
91 | o b4952fcf48cf (public) add base | |
92 |
|
92 | |||
93 |
|
93 | |||
94 | Abort: old will still be an head because it's public. |
|
94 | Abort: old will still be an head because it's public. | |
95 |
|
95 | |||
96 | $ hg push |
|
96 | $ hg push | |
97 | pushing to $TESTTMP/remote |
|
97 | pushing to $TESTTMP/remote (glob) | |
98 | searching for changes |
|
98 | searching for changes | |
99 | abort: push creates new remote head 71e3228bffe1! |
|
99 | abort: push creates new remote head 71e3228bffe1! | |
100 | (did you forget to merge? use push -f to force) |
|
100 | (did you forget to merge? use push -f to force) | |
101 | [255] |
|
101 | [255] | |
102 |
|
102 | |||
103 | old head is now public (public remote version) |
|
103 | old head is now public (public remote version) | |
104 | ============================================== |
|
104 | ============================================== | |
105 |
|
105 | |||
106 | TODO: Not implemented yet. |
|
106 | TODO: Not implemented yet. | |
107 |
|
107 | |||
108 | # setup |
|
108 | # setup | |
109 | # |
|
109 | # | |
110 | # $ rm -fr ../remote |
|
110 | # $ rm -fr ../remote | |
111 | # $ cp -r ../backup1 ../remote |
|
111 | # $ cp -r ../backup1 ../remote | |
112 | # $ hg -R ../remote phase --public c70b08862e08 |
|
112 | # $ hg -R ../remote phase --public c70b08862e08 | |
113 | # $ hg phase --draft --force c70b08862e08 |
|
113 | # $ hg phase --draft --force c70b08862e08 | |
114 | # $ hg glog --hidden |
|
114 | # $ hg glog --hidden | |
115 | # @ 71e3228bffe1 (draft) add new |
|
115 | # @ 71e3228bffe1 (draft) add new | |
116 | # | |
|
116 | # | | |
117 | # | x c70b08862e08 (draft) add old |
|
117 | # | x c70b08862e08 (draft) add old | |
118 | # |/ |
|
118 | # |/ | |
119 | # o b4952fcf48cf (public) add base |
|
119 | # o b4952fcf48cf (public) add base | |
120 | # |
|
120 | # | |
121 | # |
|
121 | # | |
122 | # |
|
122 | # | |
123 | # Abort: old will still be an head because it's public. |
|
123 | # Abort: old will still be an head because it's public. | |
124 | # |
|
124 | # | |
125 | # $ hg push |
|
125 | # $ hg push | |
126 | # pushing to $TESTTMP/remote |
|
126 | # pushing to $TESTTMP/remote | |
127 | # searching for changes |
|
127 | # searching for changes | |
128 | # abort: push creates new remote head 71e3228bffe1! |
|
128 | # abort: push creates new remote head 71e3228bffe1! | |
129 | # (did you forget to merge? use push -f to force) |
|
129 | # (did you forget to merge? use push -f to force) | |
130 | # [255] |
|
130 | # [255] | |
131 |
|
131 | |||
132 | old head is obsolete but replacement is not pushed |
|
132 | old head is obsolete but replacement is not pushed | |
133 | ================================================== |
|
133 | ================================================== | |
134 |
|
134 | |||
135 | setup |
|
135 | setup | |
136 |
|
136 | |||
137 | $ rm -fr ../remote |
|
137 | $ rm -fr ../remote | |
138 | $ cp -r ../backup1 ../remote |
|
138 | $ cp -r ../backup1 ../remote | |
139 | $ hg phase --draft --force '(0::) - 0' |
|
139 | $ hg phase --draft --force '(0::) - 0' | |
140 | $ hg up -q '.^' |
|
140 | $ hg up -q '.^' | |
141 | $ mkcommit other |
|
141 | $ mkcommit other | |
142 | created new head |
|
142 | created new head | |
143 | $ hg glog --hidden |
|
143 | $ hg glog --hidden | |
144 | @ d7d41ccbd4de (draft) add other |
|
144 | @ d7d41ccbd4de (draft) add other | |
145 | | |
|
145 | | | |
146 | | o 71e3228bffe1 (draft) add new |
|
146 | | o 71e3228bffe1 (draft) add new | |
147 | |/ |
|
147 | |/ | |
148 | | x c70b08862e08 (draft) add old |
|
148 | | x c70b08862e08 (draft) add old | |
149 | |/ |
|
149 | |/ | |
150 | o b4952fcf48cf (public) add base |
|
150 | o b4952fcf48cf (public) add base | |
151 |
|
151 | |||
152 |
|
152 | |||
153 | old exists remotely as draft. It is obsoleted by new but we don't push new. |
|
153 | old exists remotely as draft. It is obsoleted by new but we don't push new. | |
154 | Push should abort on new head |
|
154 | Push should abort on new head | |
155 |
|
155 | |||
156 | $ hg push -r 'desc("other")' |
|
156 | $ hg push -r 'desc("other")' | |
157 | pushing to $TESTTMP/remote |
|
157 | pushing to $TESTTMP/remote (glob) | |
158 | searching for changes |
|
158 | searching for changes | |
159 | abort: push creates new remote head d7d41ccbd4de! |
|
159 | abort: push creates new remote head d7d41ccbd4de! | |
160 | (did you forget to merge? use push -f to force) |
|
160 | (did you forget to merge? use push -f to force) | |
161 | [255] |
|
161 | [255] | |
162 |
|
162 | |||
163 |
|
163 | |||
164 |
|
164 | |||
165 | Both precursors and successors are already know remotely. Descendant adds heads |
|
165 | Both precursors and successors are already know remotely. Descendant adds heads | |
166 | =============================================================================== |
|
166 | =============================================================================== | |
167 |
|
167 | |||
168 | setup. (The obsolete marker is known locally only |
|
168 | setup. (The obsolete marker is known locally only | |
169 |
|
169 | |||
170 | $ cd .. |
|
170 | $ cd .. | |
171 | $ rm -rf local |
|
171 | $ rm -rf local | |
172 | $ hg clone remote local |
|
172 | $ hg clone remote local | |
173 | updating to branch default |
|
173 | updating to branch default | |
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
175 | $ cd local |
|
175 | $ cd local | |
176 | $ mkcommit old |
|
176 | $ mkcommit old | |
177 | old already tracked! |
|
177 | old already tracked! | |
178 | nothing changed |
|
178 | nothing changed | |
179 | [1] |
|
179 | [1] | |
180 | $ hg up -q '.^' |
|
180 | $ hg up -q '.^' | |
181 | $ mkcommit new |
|
181 | $ mkcommit new | |
182 | created new head |
|
182 | created new head | |
183 | $ hg push -f |
|
183 | $ hg push -f | |
184 | pushing to $TESTTMP/remote |
|
184 | pushing to $TESTTMP/remote (glob) | |
185 | searching for changes |
|
185 | searching for changes | |
186 | adding changesets |
|
186 | adding changesets | |
187 | adding manifests |
|
187 | adding manifests | |
188 | adding file changes |
|
188 | adding file changes | |
189 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
189 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
190 | $ mkcommit desc1 |
|
190 | $ mkcommit desc1 | |
191 | $ hg up -q '.^' |
|
191 | $ hg up -q '.^' | |
192 | $ mkcommit desc2 |
|
192 | $ mkcommit desc2 | |
193 | created new head |
|
193 | created new head | |
194 | $ hg debugobsolete `getid old` `getid new` |
|
194 | $ hg debugobsolete `getid old` `getid new` | |
195 | $ hg glog --hidden |
|
195 | $ hg glog --hidden | |
196 | @ 5fe37041cc2b (draft) add desc2 |
|
196 | @ 5fe37041cc2b (draft) add desc2 | |
197 | | |
|
197 | | | |
198 | | o a3ef1d111c5f (draft) add desc1 |
|
198 | | o a3ef1d111c5f (draft) add desc1 | |
199 | |/ |
|
199 | |/ | |
200 | o 71e3228bffe1 (draft) add new |
|
200 | o 71e3228bffe1 (draft) add new | |
201 | | |
|
201 | | | |
202 | | x c70b08862e08 (draft) add old |
|
202 | | x c70b08862e08 (draft) add old | |
203 | |/ |
|
203 | |/ | |
204 | o b4952fcf48cf (public) add base |
|
204 | o b4952fcf48cf (public) add base | |
205 |
|
205 | |||
206 | $ hg glog --hidden -R ../remote |
|
206 | $ hg glog --hidden -R ../remote | |
207 | o 71e3228bffe1 (draft) add new |
|
207 | o 71e3228bffe1 (draft) add new | |
208 | | |
|
208 | | | |
209 | | o c70b08862e08 (draft) add old |
|
209 | | o c70b08862e08 (draft) add old | |
210 | |/ |
|
210 | |/ | |
211 | @ b4952fcf48cf (public) add base |
|
211 | @ b4952fcf48cf (public) add base | |
212 |
|
212 | |||
213 | $ cp -r ../remote ../backup2 |
|
213 | $ cp -r ../remote ../backup2 | |
214 |
|
214 | |||
215 | Push should not warn about adding new heads. We create one, but we'll delete |
|
215 | Push should not warn about adding new heads. We create one, but we'll delete | |
216 | one anyway. |
|
216 | one anyway. | |
217 |
|
217 | |||
218 | $ hg push |
|
218 | $ hg push | |
219 | pushing to $TESTTMP/remote |
|
219 | pushing to $TESTTMP/remote (glob) | |
220 | searching for changes |
|
220 | searching for changes | |
221 | adding changesets |
|
221 | adding changesets | |
222 | adding manifests |
|
222 | adding manifests | |
223 | adding file changes |
|
223 | adding file changes | |
224 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
224 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
225 |
|
225 | |||
226 |
|
226 | |||
227 | Remote head is unknown but obsoleted by a local changeset |
|
227 | Remote head is unknown but obsoleted by a local changeset | |
228 | ========================================================= |
|
228 | ========================================================= | |
229 |
|
229 | |||
230 | setup |
|
230 | setup | |
231 |
|
231 | |||
232 | $ rm -fr ../remote |
|
232 | $ rm -fr ../remote | |
233 | $ cp -r ../backup1 ../remote |
|
233 | $ cp -r ../backup1 ../remote | |
234 | $ cd .. |
|
234 | $ cd .. | |
235 | $ rm -rf local |
|
235 | $ rm -rf local | |
236 | $ hg clone remote local -r 0 |
|
236 | $ hg clone remote local -r 0 | |
237 | adding changesets |
|
237 | adding changesets | |
238 | adding manifests |
|
238 | adding manifests | |
239 | adding file changes |
|
239 | adding file changes | |
240 | added 1 changesets with 1 changes to 1 files |
|
240 | added 1 changesets with 1 changes to 1 files | |
241 | updating to branch default |
|
241 | updating to branch default | |
242 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
242 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
243 | $ cd local |
|
243 | $ cd local | |
244 | $ mkcommit new |
|
244 | $ mkcommit new | |
245 | $ hg -R ../remote id --debug -r tip |
|
245 | $ hg -R ../remote id --debug -r tip | |
246 | c70b08862e0838ea6d7c59c85da2f1ed6c8d67da tip |
|
246 | c70b08862e0838ea6d7c59c85da2f1ed6c8d67da tip | |
247 | $ hg id --debug -r tip |
|
247 | $ hg id --debug -r tip | |
248 | 71e3228bffe1886550777233d6c97bb5a6b2a650 tip |
|
248 | 71e3228bffe1886550777233d6c97bb5a6b2a650 tip | |
249 | $ hg debugobsolete c70b08862e0838ea6d7c59c85da2f1ed6c8d67da 71e3228bffe1886550777233d6c97bb5a6b2a650 |
|
249 | $ hg debugobsolete c70b08862e0838ea6d7c59c85da2f1ed6c8d67da 71e3228bffe1886550777233d6c97bb5a6b2a650 | |
250 | $ hg glog --hidden |
|
250 | $ hg glog --hidden | |
251 | @ 71e3228bffe1 (draft) add new |
|
251 | @ 71e3228bffe1 (draft) add new | |
252 | | |
|
252 | | | |
253 | o b4952fcf48cf (public) add base |
|
253 | o b4952fcf48cf (public) add base | |
254 |
|
254 | |||
255 | $ hg glog --hidden -R ../remote |
|
255 | $ hg glog --hidden -R ../remote | |
256 | o c70b08862e08 (draft) add old |
|
256 | o c70b08862e08 (draft) add old | |
257 | | |
|
257 | | | |
258 | @ b4952fcf48cf (public) add base |
|
258 | @ b4952fcf48cf (public) add base | |
259 |
|
259 | |||
260 |
|
260 | |||
261 | Push should not complain about new heads. |
|
261 | Push should not complain about new heads. | |
262 |
|
262 | |||
263 | It should not complain about "unsynced remote changes!" either but that's not |
|
263 | It should not complain about "unsynced remote changes!" either but that's not | |
264 | handled yet. |
|
264 | handled yet. | |
265 |
|
265 | |||
266 | $ hg push --traceback |
|
266 | $ hg push --traceback | |
267 | pushing to $TESTTMP/remote |
|
267 | pushing to $TESTTMP/remote (glob) | |
268 | searching for changes |
|
268 | searching for changes | |
269 | adding changesets |
|
269 | adding changesets | |
270 | adding manifests |
|
270 | adding manifests | |
271 | adding file changes |
|
271 | adding file changes | |
272 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
272 | added 1 changesets with 1 changes to 1 files (+1 heads) |
General Comments 0
You need to be logged in to leave comments.
Login now