##// END OF EJS Templates
graft: do not try to skip rev derived from ancestor more than once (issue6024)...
Yuya Nishihara -
r40692:3bc2e550 stable
parent child Browse files
Show More
@@ -2478,10 +2478,11 b' def _dograft(ui, repo, *revs, **opts):'
2478 revs.remove(ids[n])
2478 revs.remove(ids[n])
2479 elif ctx.hex() in ids:
2479 elif ctx.hex() in ids:
2480 r = ids[ctx.hex()]
2480 r = ids[ctx.hex()]
2481 ui.warn(_('skipping already grafted revision %d:%s '
2481 if r in revs:
2482 '(was grafted from %d:%s)\n') %
2482 ui.warn(_('skipping already grafted revision %d:%s '
2483 (r, repo[r], rev, ctx))
2483 '(was grafted from %d:%s)\n') %
2484 revs.remove(r)
2484 (r, repo[r], rev, ctx))
2485 revs.remove(r)
2485 if not revs:
2486 if not revs:
2486 return -1
2487 return -1
2487
2488
@@ -1390,6 +1390,52 b' also detecting that both 3 and 5 should '
1390
1390
1391 $ cd ..
1391 $ cd ..
1392
1392
1393 Grafted revision should be warned and skipped only once. (issue6024)
1394
1395 $ mkdir issue6024
1396 $ cd issue6024
1397
1398 $ hg init base
1399 $ cd base
1400 $ touch x
1401 $ hg commit -qAminit
1402 $ echo a > x
1403 $ hg commit -mchange
1404 $ hg update -q 0
1405 $ hg graft -r 1
1406 grafting 1:a0b923c546aa "change" (tip)
1407 $ cd ..
1408
1409 $ hg clone -qr 2 base clone
1410 $ cd clone
1411 $ hg pull -q
1412 $ hg merge -q 2
1413 $ hg commit -mmerge
1414 $ hg update -q 0
1415 $ hg graft -r 1
1416 grafting 1:04fc6d444368 "change"
1417 $ hg update -q 3
1418 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1419 o 4:4e16 <- a0b9
1420 |
1421 | @ 3:f0ac <-
1422 | |\
1423 +---o 2:a0b9 <-
1424 | |
1425 | o 1:04fc <- a0b9
1426 |/
1427 o 0:7848 <-
1428
1429
1430 the source of rev 4 is an ancestor of the working parent, and was also
1431 grafted as rev 1. it should be stripped from the target revisions only once.
1432
1433 $ hg graft -r 4
1434 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1435 [255]
1436
1437 $ cd ../..
1438
1393 Testing the reading of old format graftstate file with newer mercurial
1439 Testing the reading of old format graftstate file with newer mercurial
1394
1440
1395 $ hg init oldgraft
1441 $ hg init oldgraft
General Comments 0
You need to be logged in to leave comments. Login now