tests/test-evolve.t
branchmercurial-4.4
changeset 4363 a2fdbece7ce1
parent 4360 522abf1d70b7
parent 4206 04aeaec6ec07
child 4516 f54bb6eaf5e6
equal deleted inserted replaced
4362:8bd60e09dfb4 4363:a2fdbece7ce1
   342 
   342 
   343 
   343 
   344 (amend of on ancestors)
   344 (amend of on ancestors)
   345 
   345 
   346   $ hg amend
   346   $ hg amend
   347   1 new orphan changesets
       
   348   $ hg log
   347   $ hg log
   349   4	feature-A: a nifty feature - test
   348   4	feature-A: a nifty feature - test
   350   3	feature-B: another feature (child of 568a468b60fc) - test
   349   3	feature-B: another feature (child of 568a468b60fc) - test
   351   1	: a nifty feature - test
   350   1	: a nifty feature - test
   352   0	: base - test
   351   0	: base - test
   353   $ hg up -q 0
   352   $ hg up -q 0
   354   $ glog --hidden
   353   $ glog --hidden
   355   o  4:ba0ec09b1bab@default(draft) a nifty feature
   354   o  4:ba0ec09b1bab@default(draft) a nifty feature
   356   |
   355   |
   357   | *  3:6992c59c6b06@default(draft) another feature (child of 568a468b60fc)
   356   | o  3:6992c59c6b06@default(draft) another feature (child of 568a468b60fc)
   358   | |
   357   | |
   359   | | x  2:73296a82292a@default(draft) another feature (child of 568a468b60fc)
   358   | | x  2:73296a82292a@default(draft) another feature (child of 568a468b60fc)
   360   | |/
   359   | |/
   361   | x  1:568a468b60fc@default(draft) a nifty feature
   360   | x  1:568a468b60fc@default(draft) a nifty feature
   362   |/
   361   |/
   391   0	: base - test
   390   0	: base - test
   392 
   391 
   393 phase change turning obsolete changeset public issue a bumped warning
   392 phase change turning obsolete changeset public issue a bumped warning
   394 
   393 
   395   $ hg phase --hidden --public 99833d22b0c6
   394   $ hg phase --hidden --public 99833d22b0c6
   396   1 new phase-divergent changesets
       
   397 
   395 
   398 all solving bumped troubled
   396 all solving bumped troubled
   399 
   397 
   400   $ glog
   398   $ glog
   401   @  6:47d52a103155@default(draft) another feature that rox
   399   @  6:47d52a103155@default(draft) another feature that rox
   438   $ hg commit -m 'dansk 3!'
   436   $ hg commit -m 'dansk 3!'
   439   $ hg update aca219761afb
   437   $ hg update aca219761afb
   440   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   438   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   441   $ sed -i'' -e s/Un/Én/ main-file-1
   439   $ sed -i'' -e s/Un/Én/ main-file-1
   442   $ hg commit --amend -m 'dansk!'
   440   $ hg commit --amend -m 'dansk!'
   443   2 new orphan changesets
       
   444 
   441 
   445 (ninja test for the {trouble} template:
   442 (ninja test for the {trouble} template:
   446 
   443 
   447   $ hg log -G --template '{rev} {troubles}\n'
   444   $ hg log -G --template '{rev} {troubles}\n'
   448   @  10
   445   @  10
   449   |
   446   |
   450   | *  9 orphan
   447   | o  9 orphan
   451   | |
   448   | |
   452   | *  8 orphan
   449   | o  8 orphan
   453   | |
   450   | |
   454   | x  7
   451   | x  7
   455   |/
   452   |/
   456   o  5
   453   o  5
   457   |
   454   |
   825   adding b
   822   adding b
   826   $ hg mv a c
   823   $ hg mv a c
   827   $ hg ci -m c
   824   $ hg ci -m c
   828   $ hg prune .^
   825   $ hg prune .^
   829   1 changesets pruned
   826   1 changesets pruned
   830   1 new orphan changesets
       
   831   $ hg stab --any
   827   $ hg stab --any
   832   move:[15] c
   828   move:[15] c
   833   atop:[13] a
   829   atop:[13] a
   834   working directory is now at 3742bde73477
   830   working directory is now at 3742bde73477
   835   $ hg st -C --change=tip
   831   $ hg st -C --change=tip
   902   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   898   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   903   $ hg branch mybranch
   899   $ hg branch mybranch
   904   marked working directory as branch mybranch
   900   marked working directory as branch mybranch
   905   (branches are permanent and global, did you want a bookmark?)
   901   (branches are permanent and global, did you want a bookmark?)
   906   $ hg amend
   902   $ hg amend
   907   1 new orphan changesets
       
   908 
   903 
   909   $ hg evolve
   904   $ hg evolve
   910   move:[3] a3
   905   move:[3] a3
   911   atop:[4] a2
   906   atop:[4] a2
   912   working directory is now at 7c5649f73d11
   907   working directory is now at 7c5649f73d11
   924 branch change preserved
   919 branch change preserved
   925 
   920 
   926   $ hg up 'desc(a1)'
   921   $ hg up 'desc(a1)'
   927   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   922   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   928   $ hg amend -m 'a1_'
   923   $ hg amend -m 'a1_'
   929   2 new orphan changesets
       
   930   $ hg evolve
   924   $ hg evolve
   931   move:[4] a2
   925   move:[4] a2
   932   atop:[6] a1_
   926   atop:[6] a1_
   933   working directory is now at eb07e22a0e63
   927   working directory is now at eb07e22a0e63
   934   $ hg evolve
   928   $ hg evolve
   948 Evolve from the middle of a stack pick the right changesets.
   942 Evolve from the middle of a stack pick the right changesets.
   949 
   943 
   950   $ hg up -r "desc('a1_')"
   944   $ hg up -r "desc('a1_')"
   951   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   945   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   952   $ hg ci --amend -m 'a1__'
   946   $ hg ci --amend -m 'a1__'
   953   2 new orphan changesets
       
   954 
   947 
   955   $ hg up -r "desc('a2')"
   948   $ hg up -r "desc('a2')"
   956   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   949   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   957   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
   950   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
   958   o  9 [default] a1__
   951   o  9 [default] a1__
   959   |
   952   |
   960   | *  8 [mybranch] a3
   953   | o  8 [mybranch] a3
   961   | |
   954   | |
   962   | @  7 [mybranch] a2
   955   | @  7 [mybranch] a2
   963   | |
   956   | |
   964   | x  6 [default] a1_
   957   | x  6 [default] a1_
   965   |/
   958   |/
   989   $ glog
   982   $ glog
   990   @  10:d952e93add6f@mybranch(draft) a2
   983   @  10:d952e93add6f@mybranch(draft) a2
   991   |
   984   |
   992   o  9:9f8b83c2e7f3@default(draft) a1__
   985   o  9:9f8b83c2e7f3@default(draft) a1__
   993   |
   986   |
   994   | *  8:777c26ca5e78@mybranch(draft) a3
   987   | o  8:777c26ca5e78@mybranch(draft) a3
   995   | |
   988   | |
   996   | x  7:eb07e22a0e63@mybranch(draft) a2
   989   | x  7:eb07e22a0e63@mybranch(draft) a2
   997   | |
   990   | |
   998   | x  6:faafc6cea0ba@default(draft) a1_
   991   | x  6:faafc6cea0ba@default(draft) a1_
   999   |/
   992   |/
  1009   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
  1002   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
  1010   o  10 [mybranch] a2
  1003   o  10 [mybranch] a2
  1011   |
  1004   |
  1012   @  9 [default] a1__
  1005   @  9 [default] a1__
  1013   |
  1006   |
  1014   | *  8 [mybranch] a3
  1007   | o  8 [mybranch] a3
  1015   | |
  1008   | |
  1016   | x  7 [mybranch] a2
  1009   | x  7 [mybranch] a2
  1017   | |
  1010   | |
  1018   | x  6 [default] a1_
  1011   | x  6 [default] a1_
  1019   |/
  1012   |/
  1021   
  1014   
  1022   $ echo "hello world" > newfile
  1015   $ echo "hello world" > newfile
  1023   $ hg add newfile
  1016   $ hg add newfile
  1024   $ hg commit -m "add new file bumped" -o 10
  1017   $ hg commit -m "add new file bumped" -o 10
  1025   $ hg phase --public --hidden d952e93add6f
  1018   $ hg phase --public --hidden d952e93add6f
  1026   1 new phase-divergent changesets
       
  1027   $ hg log -G
  1019   $ hg log -G
  1028   @  11	: add new file bumped - test
  1020   @  11	: add new file bumped - test
  1029   |
  1021   |
  1030   | o  10	: a2 - test
  1022   | o  10	: a2 - test
  1031   |/
  1023   |/
  1032   o  9	testbookmark: a1__ - test
  1024   o  9	testbookmark: a1__ - test
  1033   |
  1025   |
  1034   | *  8	: a3 - test
  1026   | o  8	: a3 - test
  1035   | |
  1027   | |
  1036   | x  7	: a2 - test
  1028   | x  7	: a2 - test
  1037   | |
  1029   | |
  1038   | x  6	: a1_ - test
  1030   | x  6	: a1_ - test
  1039   |/
  1031   |/
  1048   |
  1040   |
  1049   | o  10	: a2 - test
  1041   | o  10	: a2 - test
  1050   |/
  1042   |/
  1051   o  9	testbookmark: a1__ - test
  1043   o  9	testbookmark: a1__ - test
  1052   |
  1044   |
  1053   | *  8	: a3 - test
  1045   | o  8	: a3 - test
  1054   | |
  1046   | |
  1055   | x  7	: a2 - test
  1047   | x  7	: a2 - test
  1056   | |
  1048   | |
  1057   | x  6	: a1_ - test
  1049   | x  6	: a1_ - test
  1058   |/
  1050   |/
  1105   o  9	testbookmark: a1__ - test
  1097   o  9	testbookmark: a1__ - test
  1106   |
  1098   |
  1107   o  0	: a0 - test
  1099   o  0	: a0 - test
  1108   
  1100   
  1109   $ hg amend
  1101   $ hg amend
  1110   2 new orphan changesets
       
  1111   $ glog
  1102   $ glog
  1112   @  16:0cf3707e8971@default(draft) a3
  1103   @  16:0cf3707e8971@default(draft) a3
  1113   |
  1104   |
  1114   | *  15:daa1ff1c7fbd@default(draft) add gh
  1105   | o  15:daa1ff1c7fbd@default(draft) add gh
  1115   | |
  1106   | |
  1116   | | *  14:484fb3cfa7f2@default(draft) add gg
  1107   | | o  14:484fb3cfa7f2@default(draft) add gg
  1117   | |/
  1108   | |/
  1118   | x  13:b88539ad24d7@default(draft) a3
  1109   | x  13:b88539ad24d7@default(draft) a3
  1119   |/
  1110   |/
  1120   o  12:a8bb31d4b7f2@default(draft) phase-divergent update to d952e93add6f:
  1111   o  12:a8bb31d4b7f2@default(draft) phase-divergent update to d952e93add6f:
  1121   |
  1112   |
  1251   [255]
  1242   [255]
  1252 
  1243 
  1253 Shows "use 'hg evolve' to..." hints iff the evolve command is enabled
  1244 Shows "use 'hg evolve' to..." hints iff the evolve command is enabled
  1254 
  1245 
  1255   $ hg --hidden up 14
  1246   $ hg --hidden up 14
  1256   updating to a hidden changeset 484fb3cfa7f2
       
  1257   (hidden revision '484fb3cfa7f2' was rewritten as: 98e171e2f272)
       
  1258   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1247   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1259   working directory parent is obsolete! (484fb3cfa7f2)
  1248   working directory parent is obsolete! (484fb3cfa7f2)
  1260   $ cat >> $HGRCPATH <<EOF
  1249   $ cat >> $HGRCPATH <<EOF
  1261   > [experimental]
  1250   > [experimental]
  1262   > evolutioncommands=evolve
  1251   > evolutioncommands=evolve
  1263   > EOF
  1252   > EOF
  1264   $ hg --hidden up 15
  1253   $ hg --hidden up 15
  1265   updating to a hidden changeset daa1ff1c7fbd
       
  1266   (hidden revision 'daa1ff1c7fbd' was rewritten as: 0c049e4e5422)
       
  1267   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1254   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1268   working directory parent is obsolete! (daa1ff1c7fbd)
  1255   working directory parent is obsolete! (daa1ff1c7fbd)
  1269   (use 'hg evolve' to update to its successor: 0c049e4e5422)
  1256   (use 'hg evolve' to update to its successor: 0c049e4e5422)
  1270 
  1257 
  1271 Restore all of the evolution features
  1258 Restore all of the evolution features
  1284   $ hg up .^^
  1271   $ hg up .^^
  1285   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  1272   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  1286   $ echo "hello" > j4
  1273   $ echo "hello" > j4
  1287   $ hg add j4
  1274   $ hg add j4
  1288   $ hg amend
  1275   $ hg amend
  1289   2 new orphan changesets
       
  1290   $ glog -r "0cf3707e8971::"
  1276   $ glog -r "0cf3707e8971::"
  1291   @  22:274b6cd0c101@default(draft) add j1
  1277   @  22:274b6cd0c101@default(draft) add j1
  1292   |
  1278   |
  1293   | *  21:89e4f7e8feb5@default(draft) add j3
  1279   | o  21:89e4f7e8feb5@default(draft) add j3
  1294   | |
  1280   | |
  1295   | *  20:4cd61236beca@default(draft) add j2
  1281   | o  20:4cd61236beca@default(draft) add j2
  1296   | |
  1282   | |
  1297   | x  19:0fd8bfb02de4@default(draft) add j1
  1283   | x  19:0fd8bfb02de4@default(draft) add j1
  1298   |/
  1284   |/
  1299   | o  18:0c049e4e5422@default(draft) add gh
  1285   | o  18:0c049e4e5422@default(draft) add gh
  1300   | |
  1286   | |
  1328   new changeset is empty
  1314   new changeset is empty
  1329   (use 'hg prune .' to remove it)
  1315   (use 'hg prune .' to remove it)
  1330   $ glog -r "0cf3707e8971::"
  1316   $ glog -r "0cf3707e8971::"
  1331   @  23:0ef9ff75f8e2@default(draft) add j1
  1317   @  23:0ef9ff75f8e2@default(draft) add j1
  1332   |
  1318   |
  1333   | *  21:89e4f7e8feb5@default(draft) add j3
  1319   | o  21:89e4f7e8feb5@default(draft) add j3
  1334   | |
  1320   | |
  1335   | *  20:4cd61236beca@default(draft) add j2
  1321   | o  20:4cd61236beca@default(draft) add j2
  1336   | |
  1322   | |
  1337   | x  19:0fd8bfb02de4@default(draft) add j1
  1323   | x  19:0fd8bfb02de4@default(draft) add j1
  1338   |/
  1324   |/
  1339   | o  18:0c049e4e5422@default(draft) add gh
  1325   | o  18:0c049e4e5422@default(draft) add gh
  1340   | |
  1326   | |
  1455   $ printf "pp" > pp;
  1441   $ printf "pp" > pp;
  1456   $ hg add pp
  1442   $ hg add pp
  1457   $ hg commit -m "_pp"
  1443   $ hg commit -m "_pp"
  1458   $ hg prune --succ "desc(_oo) + desc(_pp)" -r "desc('oo+pp')" --split
  1444   $ hg prune --succ "desc(_oo) + desc(_pp)" -r "desc('oo+pp')" --split
  1459   1 changesets pruned
  1445   1 changesets pruned
  1460   1 new orphan changesets
       
  1461   $ glog -r "0cf3707e8971::"
  1446   $ glog -r "0cf3707e8971::"
  1462   @  32:c7dbf668e9d5@default(draft) _pp
  1447   @  32:c7dbf668e9d5@default(draft) _pp
  1463   |
  1448   |
  1464   o  31:2b5a32114b3d@default(draft) _oo
  1449   o  31:2b5a32114b3d@default(draft) _oo
  1465   |
  1450   |
  1466   | *  30:4d122571f3b6@default(draft) add uu
  1451   | o  30:4d122571f3b6@default(draft) add uu
  1467   | |
  1452   | |
  1468   | x  29:7da3e73df8a5@default(draft) oo+pp
  1453   | x  29:7da3e73df8a5@default(draft) oo+pp
  1469   |/
  1454   |/
  1470   | o  28:92ca6f3984de@default(draft) add gg
  1455   | o  28:92ca6f3984de@default(draft) add gg
  1471   | |
  1456   | |
  1522   ~
  1507   ~
  1523 
  1508 
  1524   $ hg update -q 98c7ab460e6b
  1509   $ hg update -q 98c7ab460e6b
  1525   $ echo "amended" > newfile
  1510   $ echo "amended" > newfile
  1526   $ hg amend -m "amended"
  1511   $ hg amend -m "amended"
  1527   2 new orphan changesets
       
  1528 
  1512 
  1529   $ hg evolve --rev "98c7ab460e6b::"
  1513   $ hg evolve --rev "98c7ab460e6b::"
  1530   move:[35] will be evolved safely
  1514   move:[35] will be evolved safely
  1531   atop:[37] amended
  1515   atop:[37] amended
  1532   move:[36] will cause conflict at evolve
  1516   move:[36] will cause conflict at evolve
  1570 
  1554 
  1571   $ hg log -GT "{rev}:{node|short} {desc} {bookmarks}\n"
  1555   $ hg log -GT "{rev}:{node|short} {desc} {bookmarks}\n"
  1572   @  1:ab832e43dd5a added a
  1556   @  1:ab832e43dd5a added a
  1573   
  1557   
  1574   $ hg up f7ad41964313 --hidden
  1558   $ hg up f7ad41964313 --hidden
  1575   updating to a hidden changeset f7ad41964313
       
  1576   (hidden revision 'f7ad41964313' was rewritten as: ab832e43dd5a)
       
  1577   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1559   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1578   working directory parent is obsolete! (f7ad41964313)
  1560   working directory parent is obsolete! (f7ad41964313)
  1579   (use 'hg evolve' to update to its successor: ab832e43dd5a)
  1561   (use 'hg evolve' to update to its successor: ab832e43dd5a)
  1580 
  1562 
  1581   $ hg bookmark book
  1563   $ hg bookmark book
  1628 
  1610 
  1629 Now make the parents of merge commit obsolete to get a orphan merge:
  1611 Now make the parents of merge commit obsolete to get a orphan merge:
  1630   $ hg up 2 -q
  1612   $ hg up 2 -q
  1631   $ echo "fixit" > c
  1613   $ echo "fixit" > c
  1632   $ hg ci --amend -m "updated c"
  1614   $ hg ci --amend -m "updated c"
  1633   1 new orphan changesets
       
  1634   $ hg up 3 -q
  1615   $ hg up 3 -q
  1635   $ echo "fixit" > c
  1616   $ echo "fixit" > c
  1636   $ hg ci --amend -m "updated f"
  1617   $ hg ci --amend -m "updated f"
  1637   $ glog
  1618   $ glog
  1638   @  6:086d9bedcd75@default(draft) updated f
  1619   @  6:086d9bedcd75@default(draft) updated f
  1639   |
  1620   |
  1640   | o  5:f84f2c548fbc@default(draft) updated c
  1621   | o  5:f84f2c548fbc@default(draft) updated c
  1641   |/
  1622   |/
  1642   | *    4:2c0a98d38026@default(draft) merge feature branch
  1623   | o    4:2c0a98d38026@default(draft) merge feature branch
  1643   | |\
  1624   | |\
  1644   +---x  3:4c33e511041e@default(draft) added feature f
  1625   +---x  3:4c33e511041e@default(draft) added feature f
  1645   | |
  1626   | |
  1646   | x  2:8be98ac1a569@default(draft) added c
  1627   | x  2:8be98ac1a569@default(draft) added c
  1647   |/
  1628   |/
  1663   adding e
  1644   adding e
  1664   $ hg up .^
  1645   $ hg up .^
  1665   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1646   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1666   $ echo "updated d" >> d
  1647   $ echo "updated d" >> d
  1667   $ hg ci --amend -m "updated d"
  1648   $ hg ci --amend -m "updated d"
  1668   1 new orphan changesets
       
  1669   $ glog
  1649   $ glog
  1670   @  9:7c4d1834c346@default(draft) updated d
  1650   @  9:7c4d1834c346@default(draft) updated d
  1671   |
  1651   |
  1672   | *  8:421f7614462a@default(draft) added e
  1652   | o  8:421f7614462a@default(draft) added e
  1673   | |
  1653   | |
  1674   | x  7:afe5acea1990@default(draft) added d
  1654   | x  7:afe5acea1990@default(draft) added d
  1675   |/
  1655   |/
  1676   | o  6:086d9bedcd75@default(draft) updated f
  1656   | o  6:086d9bedcd75@default(draft) updated f
  1677   |/
  1657   |/
  1678   | o  5:f84f2c548fbc@default(draft) updated c
  1658   | o  5:f84f2c548fbc@default(draft) updated c
  1679   |/
  1659   |/
  1680   | *    4:2c0a98d38026@default(draft) merge feature branch
  1660   | o    4:2c0a98d38026@default(draft) merge feature branch
  1681   | |\
  1661   | |\
  1682   +---x  3:4c33e511041e@default(draft) added feature f
  1662   +---x  3:4c33e511041e@default(draft) added feature f
  1683   | |
  1663   | |
  1684   | x  2:8be98ac1a569@default(draft) added c
  1664   | x  2:8be98ac1a569@default(draft) added c
  1685   |/
  1665   |/