Mercurial > evolve
comparison tests/test-touch.t @ 5978:bf48247af25a stable
tests: demonstrate that touch can lose files (issue6416)
This commit also includes a test of how copies are handled in the
touched merge commit.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 05 Oct 2020 09:02:21 -0700 |
parents | a65d17b1b463 |
children | 4a09e95d29c9 |
comparison
equal
deleted
inserted
replaced
5977:fa7f2e1cb504 | 5978:bf48247af25a |
---|---|
210 A a | 210 A a |
211 A b | 211 A b |
212 | 212 |
213 $ cd .. | 213 $ cd .. |
214 | 214 |
215 Check that touching a merge commit doesn't lose file changes (issue 6416) | |
216 | |
217 $ hg init issue-6416 | |
218 $ cd issue-6416 | |
219 $ echo base > base | |
220 $ hg ci -Aqm base | |
221 $ echo left1 > left1 | |
222 $ hg ci -Aqm left1 | |
223 $ echo left2 > left2 | |
224 $ hg ci -Aqm left2 | |
225 $ hg up 0 -q | |
226 $ echo right1 > right1 | |
227 $ hg ci -Aqm right1 | |
228 $ echo right2 > right2 | |
229 $ hg ci -Aqm right2 | |
230 $ hg up 2 -q | |
231 $ hg merge 4 -q | |
232 $ hg ci -m merge | |
233 $ hg touch tip | |
234 $ hg glog --hidden | |
235 @ 6: merge | |
236 |\ | |
237 +---x 5: merge | |
238 | |/ | |
239 | o 4: right2 | |
240 | | | |
241 | o 3: right1 | |
242 | | | |
243 o | 2: left2 | |
244 | | | |
245 o | 1: left1 | |
246 |/ | |
247 o 0: base | |
248 | |
249 $ hg glog --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))' | |
250 @ 6: merge | |
251 |\ | |
252 ~ ~ | |
253 x 5: merge | |
254 |\ | |
255 ~ ~ | |
256 $ hg status --hidden --change 'min(desc("merge"))' | |
257 A right1 | |
258 A right2 | |
259 BROKEN: should be the same as "5" | |
260 $ hg status --hidden --change 'max(desc("merge"))' | |
261 A right2 | |
262 BROKEN: There should be no difference | |
263 $ hg status --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))' | |
264 R right1 | |
265 $ cd .. | |
266 | |
267 Check that touching a merge commit doesn't lose copies | |
268 | |
269 $ hg init merge-copies | |
270 $ cd merge-copies | |
271 $ echo base > base | |
272 $ hg ci -Aqm base | |
273 $ echo left > left | |
274 $ hg cp base copy-on-left | |
275 $ hg ci -Aqm left | |
276 $ hg up 0 -q | |
277 $ echo right > right | |
278 $ hg cp base copy-on-right | |
279 $ hg ci -Aqm right | |
280 $ hg up 1 -q | |
281 $ hg merge 2 -q | |
282 $ hg cp left merge-copy-left | |
283 $ hg cp right merge-copy-right | |
284 $ hg ci -m merge | |
285 $ hg touch tip | |
286 $ hg glog --hidden | |
287 @ 4: merge | |
288 |\ | |
289 +---x 3: merge | |
290 | |/ | |
291 | o 2: right | |
292 | | | |
293 o | 1: left | |
294 |/ | |
295 o 0: base | |
296 | |
297 $ hg glog --hidden --rev 'min(desc("merge"))' --rev 'max(desc("merge"))' | |
298 @ 4: merge | |
299 |\ | |
300 ~ ~ | |
301 x 3: merge | |
302 |\ | |
303 ~ ~ | |
304 $ hg debugpathcopies 'min(desc("base"))' 'min(desc("merge"))' | |
305 base -> copy-on-left | |
306 base -> copy-on-right | |
307 $ hg debugpathcopies 'min(desc("base"))' 'max(desc("merge"))' | |
308 base -> copy-on-left | |
309 base -> copy-on-right | |
310 $ hg debugpathcopies 'min(desc("left"))' 'min(desc("merge"))' | |
311 base -> copy-on-right | |
312 left -> merge-copy-left | |
313 $ hg debugpathcopies 'min(desc("left"))' 'max(desc("merge"))' | |
314 base -> copy-on-right | |
315 left -> merge-copy-left | |
316 $ hg debugpathcopies 'min(desc("right"))' 'min(desc("merge"))' | |
317 base -> copy-on-left | |
318 right -> merge-copy-right (missing-correct-output !) | |
319 $ hg debugpathcopies 'min(desc("right"))' 'max(desc("merge"))' | |
320 base -> copy-on-left | |
321 right -> merge-copy-right (missing-correct-output !) | |
322 $ cd .. | |
323 | |
215 Make sure touch doesn't fail to warn about divergence (issue6107) | 324 Make sure touch doesn't fail to warn about divergence (issue6107) |
216 | 325 |
217 $ hg init touchdiv | 326 $ hg init touchdiv |
218 $ cd touchdiv | 327 $ cd touchdiv |
219 $ echo c > c | 328 $ echo c > c |