tests/test-evolve.t
branchmercurial-4.4
changeset 4675 79bc0f1a832e
parent 4673 3ef4980353af
parent 4516 f54bb6eaf5e6
equal deleted inserted replaced
4674:3810ca63398f 4675:79bc0f1a832e
   341 
   341 
   342 
   342 
   343 (amend of on ancestors)
   343 (amend of on ancestors)
   344 
   344 
   345   $ hg amend
   345   $ hg amend
   346   1 new orphan changesets
       
   347   $ hg log
   346   $ hg log
   348   4	feature-A: a nifty feature - test
   347   4	feature-A: a nifty feature - test
   349   3	feature-B: another feature (child of 568a468b60fc) - test
   348   3	feature-B: another feature (child of 568a468b60fc) - test
   350   1	: a nifty feature - test
   349   1	: a nifty feature - test
   351   0	: base - test
   350   0	: base - test
   352   $ hg up -q 0
   351   $ hg up -q 0
   353   $ glog --hidden
   352   $ glog --hidden
   354   o  4:ba0ec09b1bab@default(draft) a nifty feature
   353   o  4:ba0ec09b1bab@default(draft) a nifty feature
   355   |
   354   |
   356   | *  3:6992c59c6b06@default(draft) another feature (child of 568a468b60fc)
   355   | o  3:6992c59c6b06@default(draft) another feature (child of 568a468b60fc)
   357   | |
   356   | |
   358   | | x  2:73296a82292a@default(draft) another feature (child of 568a468b60fc)
   357   | | x  2:73296a82292a@default(draft) another feature (child of 568a468b60fc)
   359   | |/
   358   | |/
   360   | x  1:568a468b60fc@default(draft) a nifty feature
   359   | x  1:568a468b60fc@default(draft) a nifty feature
   361   |/
   360   |/
   389   0	: base - test
   388   0	: base - test
   390 
   389 
   391 phase change turning obsolete changeset public issues a phase divergence warning
   390 phase change turning obsolete changeset public issues a phase divergence warning
   392 
   391 
   393   $ hg phase --hidden --public 99833d22b0c6
   392   $ hg phase --hidden --public 99833d22b0c6
   394   1 new phase-divergent changesets
       
   395 
   393 
   396 all solving phase-divergent
   394 all solving phase-divergent
   397 
   395 
   398   $ glog
   396   $ glog
   399   @  6:47d52a103155@default(draft) another feature that rox
   397   @  6:47d52a103155@default(draft) another feature that rox
   435   $ hg commit -m 'dansk 3!'
   433   $ hg commit -m 'dansk 3!'
   436   $ hg update aca219761afb
   434   $ hg update aca219761afb
   437   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   435   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   438   $ sed -i'' -e s/Un/Én/ main-file-1
   436   $ sed -i'' -e s/Un/Én/ main-file-1
   439   $ hg commit --amend -m 'dansk!'
   437   $ hg commit --amend -m 'dansk!'
   440   2 new orphan changesets
       
   441 
   438 
   442 (ninja test for the {trouble} template:
   439 (ninja test for the {trouble} template:
   443 
   440 
   444   $ hg log -G --template '{rev} {instabilities}\n'
   441   $ hg log -G --template '{rev} {instabilities}\n'
   445   @  10
   442   @  10
   446   |
   443   |
   447   | *  9 orphan
   444   | o  9 orphan
   448   | |
   445   | |
   449   | *  8 orphan
   446   | o  8 orphan
   450   | |
   447   | |
   451   | x  7
   448   | x  7
   452   |/
   449   |/
   453   o  5
   450   o  5
   454   |
   451   |
   821   adding b
   818   adding b
   822   $ hg mv a c
   819   $ hg mv a c
   823   $ hg ci -m c
   820   $ hg ci -m c
   824   $ hg prune .^
   821   $ hg prune .^
   825   1 changesets pruned
   822   1 changesets pruned
   826   1 new orphan changesets
       
   827   $ hg stab --any
   823   $ hg stab --any
   828   move:[15] c
   824   move:[15] c
   829   atop:[13] a
   825   atop:[13] a
   830   working directory is now at 3742bde73477
   826   working directory is now at 3742bde73477
   831   $ hg st -C --change=tip
   827   $ hg st -C --change=tip
   900   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   896   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   901   $ hg branch mybranch
   897   $ hg branch mybranch
   902   marked working directory as branch mybranch
   898   marked working directory as branch mybranch
   903   (branches are permanent and global, did you want a bookmark?)
   899   (branches are permanent and global, did you want a bookmark?)
   904   $ hg amend
   900   $ hg amend
   905   1 new orphan changesets
       
   906 
   901 
   907   $ hg evolve
   902   $ hg evolve
   908   move:[3] a3
   903   move:[3] a3
   909   atop:[4] a2
   904   atop:[4] a2
   910 
   905 
   921 branch change preserved
   916 branch change preserved
   922 
   917 
   923   $ hg up 'desc(a1)'
   918   $ hg up 'desc(a1)'
   924   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   919   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   925   $ hg amend -m 'a1_'
   920   $ hg amend -m 'a1_'
   926   2 new orphan changesets
       
   927   $ hg evolve --rev 'first(orphan())'
   921   $ hg evolve --rev 'first(orphan())'
   928   move:[4] a2
   922   move:[4] a2
   929   atop:[6] a1_
   923   atop:[6] a1_
   930   $ hg evolve
   924   $ hg evolve
   931   move:[5] a3
   925   move:[5] a3
   941   
   935   
   942 
   936 
   943 Evolve from the middle of a stack pick the right changesets.
   937 Evolve from the middle of a stack pick the right changesets.
   944 
   938 
   945   $ hg ci --amend -m 'a1__'
   939   $ hg ci --amend -m 'a1__'
   946   2 new orphan changesets
       
   947 
   940 
   948   $ hg up -r "desc('a2')"
   941   $ hg up -r "desc('a2')"
   949   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   942   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   950   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
   943   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
   951   o  9 [default] a1__
   944   o  9 [default] a1__
   952   |
   945   |
   953   | *  8 [mybranch] a3
   946   | o  8 [mybranch] a3
   954   | |
   947   | |
   955   | @  7 [mybranch] a2
   948   | @  7 [mybranch] a2
   956   | |
   949   | |
   957   | x  6 [default] a1_
   950   | x  6 [default] a1_
   958   |/
   951   |/
   981   $ glog
   974   $ glog
   982   o  10:d952e93add6f@mybranch(draft) a2
   975   o  10:d952e93add6f@mybranch(draft) a2
   983   |
   976   |
   984   @  9:9f8b83c2e7f3@default(draft) a1__
   977   @  9:9f8b83c2e7f3@default(draft) a1__
   985   |
   978   |
   986   | *  8:777c26ca5e78@mybranch(draft) a3
   979   | o  8:777c26ca5e78@mybranch(draft) a3
   987   | |
   980   | |
   988   | x  7:eb07e22a0e63@mybranch(draft) a2
   981   | x  7:eb07e22a0e63@mybranch(draft) a2
   989   | |
   982   | |
   990   | x  6:faafc6cea0ba@default(draft) a1_
   983   | x  6:faafc6cea0ba@default(draft) a1_
   991   |/
   984   |/
   999   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
   992   $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
  1000   o  10 [mybranch] a2
   993   o  10 [mybranch] a2
  1001   |
   994   |
  1002   @  9 [default] a1__
   995   @  9 [default] a1__
  1003   |
   996   |
  1004   | *  8 [mybranch] a3
   997   | o  8 [mybranch] a3
  1005   | |
   998   | |
  1006   | x  7 [mybranch] a2
   999   | x  7 [mybranch] a2
  1007   | |
  1000   | |
  1008   | x  6 [default] a1_
  1001   | x  6 [default] a1_
  1009   |/
  1002   |/
  1011   
  1004   
  1012   $ echo "hello world" > newfile
  1005   $ echo "hello world" > newfile
  1013   $ hg add newfile
  1006   $ hg add newfile
  1014   $ hg commit -m "add new file bumped" -o 10
  1007   $ hg commit -m "add new file bumped" -o 10
  1015   $ hg phase --public --hidden d952e93add6f
  1008   $ hg phase --public --hidden d952e93add6f
  1016   1 new phase-divergent changesets
       
  1017   $ hg log -G
  1009   $ hg log -G
  1018   @  11	: add new file bumped - test
  1010   @  11	: add new file bumped - test
  1019   |
  1011   |
  1020   | o  10	: a2 - test
  1012   | o  10	: a2 - test
  1021   |/
  1013   |/
  1022   o  9	testbookmark: a1__ - test
  1014   o  9	testbookmark: a1__ - test
  1023   |
  1015   |
  1024   | *  8	: a3 - test
  1016   | o  8	: a3 - test
  1025   | |
  1017   | |
  1026   | x  7	: a2 - test
  1018   | x  7	: a2 - test
  1027   | |
  1019   | |
  1028   | x  6	: a1_ - test
  1020   | x  6	: a1_ - test
  1029   |/
  1021   |/
  1038   |
  1030   |
  1039   | o  10	: a2 - test
  1031   | o  10	: a2 - test
  1040   |/
  1032   |/
  1041   o  9	testbookmark: a1__ - test
  1033   o  9	testbookmark: a1__ - test
  1042   |
  1034   |
  1043   | *  8	: a3 - test
  1035   | o  8	: a3 - test
  1044   | |
  1036   | |
  1045   | x  7	: a2 - test
  1037   | x  7	: a2 - test
  1046   | |
  1038   | |
  1047   | x  6	: a1_ - test
  1039   | x  6	: a1_ - test
  1048   |/
  1040   |/
  1093   o  9	testbookmark: a1__ - test
  1085   o  9	testbookmark: a1__ - test
  1094   |
  1086   |
  1095   o  0	: a0 - test
  1087   o  0	: a0 - test
  1096   
  1088   
  1097   $ hg amend
  1089   $ hg amend
  1098   2 new orphan changesets
       
  1099   $ glog
  1090   $ glog
  1100   @  16:0cf3707e8971@default(draft) a3
  1091   @  16:0cf3707e8971@default(draft) a3
  1101   |
  1092   |
  1102   | *  15:daa1ff1c7fbd@default(draft) add gh
  1093   | o  15:daa1ff1c7fbd@default(draft) add gh
  1103   | |
  1094   | |
  1104   | | *  14:484fb3cfa7f2@default(draft) add gg
  1095   | | o  14:484fb3cfa7f2@default(draft) add gg
  1105   | |/
  1096   | |/
  1106   | x  13:b88539ad24d7@default(draft) a3
  1097   | x  13:b88539ad24d7@default(draft) a3
  1107   |/
  1098   |/
  1108   o  12:a8bb31d4b7f2@default(draft) phase-divergent update to d952e93add6f:
  1099   o  12:a8bb31d4b7f2@default(draft) phase-divergent update to d952e93add6f:
  1109   |
  1100   |
  1238   [255]
  1229   [255]
  1239 
  1230 
  1240 Shows "use 'hg evolve' to..." hints iff the evolve command is enabled
  1231 Shows "use 'hg evolve' to..." hints iff the evolve command is enabled
  1241 
  1232 
  1242   $ hg --hidden up 14
  1233   $ hg --hidden up 14
  1243   updating to a hidden changeset 484fb3cfa7f2
  1234   2 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1244   (hidden revision '484fb3cfa7f2' was rewritten as: 98e171e2f272)
       
  1245   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1246   working directory parent is obsolete! (484fb3cfa7f2)
  1235   working directory parent is obsolete! (484fb3cfa7f2)
  1247   $ cat >> $HGRCPATH <<EOF
  1236   $ cat >> $HGRCPATH <<EOF
  1248   > [experimental]
  1237   > [experimental]
  1249   > evolutioncommands=evolve
  1238   > evolutioncommands=evolve
  1250   > EOF
  1239   > EOF
  1251   $ hg --hidden up 15
  1240   $ hg --hidden up 15
  1252   updating to a hidden changeset daa1ff1c7fbd
       
  1253   (hidden revision 'daa1ff1c7fbd' was rewritten as: 0c049e4e5422)
       
  1254   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1241   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1255   working directory parent is obsolete! (daa1ff1c7fbd)
  1242   working directory parent is obsolete! (daa1ff1c7fbd)
  1256   (use 'hg evolve' to update to its successor: 0c049e4e5422)
  1243   (use 'hg evolve' to update to its successor: 0c049e4e5422)
  1257 
  1244 
  1258 Restore all of the evolution features
  1245 Restore all of the evolution features
  1271   $ hg up .^^
  1258   $ hg up .^^
  1272   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  1259   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  1273   $ echo "hello" > j4
  1260   $ echo "hello" > j4
  1274   $ hg add j4
  1261   $ hg add j4
  1275   $ hg amend
  1262   $ hg amend
  1276   2 new orphan changesets
       
  1277   $ glog -r "0cf3707e8971::"
  1263   $ glog -r "0cf3707e8971::"
  1278   @  22:274b6cd0c101@default(draft) add j1
  1264   @  22:274b6cd0c101@default(draft) add j1
  1279   |
  1265   |
  1280   | *  21:89e4f7e8feb5@default(draft) add j3
  1266   | o  21:89e4f7e8feb5@default(draft) add j3
  1281   | |
  1267   | |
  1282   | *  20:4cd61236beca@default(draft) add j2
  1268   | o  20:4cd61236beca@default(draft) add j2
  1283   | |
  1269   | |
  1284   | x  19:0fd8bfb02de4@default(draft) add j1
  1270   | x  19:0fd8bfb02de4@default(draft) add j1
  1285   |/
  1271   |/
  1286   | o  18:0c049e4e5422@default(draft) add gh
  1272   | o  18:0c049e4e5422@default(draft) add gh
  1287   | |
  1273   | |
  1315   new changeset is empty
  1301   new changeset is empty
  1316   (use 'hg prune .' to remove it)
  1302   (use 'hg prune .' to remove it)
  1317   $ glog -r "0cf3707e8971::"
  1303   $ glog -r "0cf3707e8971::"
  1318   @  23:0ef9ff75f8e2@default(draft) add j1
  1304   @  23:0ef9ff75f8e2@default(draft) add j1
  1319   |
  1305   |
  1320   | *  21:89e4f7e8feb5@default(draft) add j3
  1306   | o  21:89e4f7e8feb5@default(draft) add j3
  1321   | |
  1307   | |
  1322   | *  20:4cd61236beca@default(draft) add j2
  1308   | o  20:4cd61236beca@default(draft) add j2
  1323   | |
  1309   | |
  1324   | x  19:0fd8bfb02de4@default(draft) add j1
  1310   | x  19:0fd8bfb02de4@default(draft) add j1
  1325   |/
  1311   |/
  1326   | o  18:0c049e4e5422@default(draft) add gh
  1312   | o  18:0c049e4e5422@default(draft) add gh
  1327   | |
  1313   | |
  1446   ~
  1432   ~
  1447 
  1433 
  1448   $ hg update -q -r "desc('will be amended')"
  1434   $ hg update -q -r "desc('will be amended')"
  1449   $ echo "amended" > newfile
  1435   $ echo "amended" > newfile
  1450   $ hg amend -m "amended"
  1436   $ hg amend -m "amended"
  1451   2 new orphan changesets
       
  1452 
  1437 
  1453   $ hg evolve --rev "desc('will be amended')::"
  1438   $ hg evolve --rev "desc('will be amended')::"
  1454   move:[30] will be evolved safely
  1439   move:[30] will be evolved safely
  1455   atop:[32] amended
  1440   atop:[32] amended
  1456   move:[31] will cause conflict at evolve
  1441   move:[31] will cause conflict at evolve
  1494 
  1479 
  1495   $ hg log -GT "{rev}:{node|short} {desc} {bookmarks}\n"
  1480   $ hg log -GT "{rev}:{node|short} {desc} {bookmarks}\n"
  1496   @  1:ab832e43dd5a added a
  1481   @  1:ab832e43dd5a added a
  1497   
  1482   
  1498   $ hg up f7ad41964313 --hidden
  1483   $ hg up f7ad41964313 --hidden
  1499   updating to a hidden changeset f7ad41964313
       
  1500   (hidden revision 'f7ad41964313' was rewritten as: ab832e43dd5a)
       
  1501   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1484   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1502   working directory parent is obsolete! (f7ad41964313)
  1485   working directory parent is obsolete! (f7ad41964313)
  1503   (use 'hg evolve' to update to its successor: ab832e43dd5a)
  1486   (use 'hg evolve' to update to its successor: ab832e43dd5a)
  1504 
  1487 
  1505   $ hg bookmark book
  1488   $ hg bookmark book