tests/test-evolve-public-content-divergent.t
changeset 4417 b86413cfca4a
parent 4416 b2a8e67b0933
child 4418 0ec30a7d9e12
equal deleted inserted replaced
4416:b2a8e67b0933 4417:b86413cfca4a
   973   $ hg res -m
   973   $ hg res -m
   974   (no more unresolved files)
   974   (no more unresolved files)
   975   continue: hg evolve --continue
   975   continue: hg evolve --continue
   976 
   976 
   977   $ hg evolve --continue
   977   $ hg evolve --continue
   978   computing new diff
   978   working directory is now at f7c1071f1e7c
   979   transaction abort!
       
   980   rollback completed
       
   981   abort: cannot obsolete public changeset: f7c1071f1e7c
       
   982   (see 'hg help phases' for details)
       
   983   [255]
       
   984 
   979 
   985   $ hg evolve -l
   980   $ hg evolve -l
   986   229da2719b19: added ch
       
   987     content-divergent: f7c1071f1e7c (public) (precursor 155349b645be)
       
   988   
       
   989 
   981 
   990   $ hg par
   982   $ hg par
   991   changeset:   4:f7c1071f1e7c
   983   changeset:   4:f7c1071f1e7c
   992   tag:         tip
   984   tag:         tip
   993   parent:      1:5f6d8a4bf34a
   985   parent:      1:5f6d8a4bf34a
   994   user:        test
   986   user:        test
   995   date:        Thu Jan 01 00:00:00 1970 +0000
   987   date:        Thu Jan 01 00:00:00 1970 +0000
   996   summary:     added c
   988   summary:     added c
   997   
   989   
   998   changeset:   3:229da2719b19
   990 Testing the case when "merging results in same as public cset" where:
   999   parent:      1:5f6d8a4bf34a
   991 both the csets are on different parent and relocation leads to conflict but merging won't.
       
   992 ------------------------------------------------------------------------------------------
       
   993 Prepare the repo:
       
   994 
       
   995   $ cd ..
       
   996   $ hg init pubdiv8
       
   997   $ cd pubdiv8
       
   998   $ for ch in a b c d; do
       
   999   >   echo $ch > $ch;
       
  1000   >   hg ci -Am "added "$ch;
       
  1001   > done;
       
  1002   adding a
       
  1003   adding b
       
  1004   adding c
       
  1005   adding d
       
  1006 
       
  1007   $ hg up 1
       
  1008   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
  1009   $ echo dh > dh
       
  1010   $ echo cc > c
       
  1011   $ hg add dh c
       
  1012   $ hg ci -m "added dh"
       
  1013   created new head
       
  1014 
       
  1015   $ hg up 2
       
  1016   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
  1017   $ echo dh > dh
       
  1018   $ hg add dh
       
  1019   $ hg ci -m "added d"
       
  1020   created new head
       
  1021 
       
  1022   $ hg glog
       
  1023   @  5:e800202333a4 added d
       
  1024   |   draft
       
  1025   |
       
  1026   | o  4:f89a8e2f86ac added dh
       
  1027   | |   draft
       
  1028   | |
       
  1029   +---o  3:9150fe93bec6 added d
       
  1030   | |     draft
       
  1031   | |
       
  1032   o |  2:155349b645be added c
       
  1033   |/    draft
       
  1034   |
       
  1035   o  1:5f6d8a4bf34a added b
       
  1036   |   draft
       
  1037   |
       
  1038   o  0:9092f1db7931 added a
       
  1039       draft
       
  1040   
       
  1041 
       
  1042   $ hg prune 3 -s 4
       
  1043   1 changesets pruned
       
  1044   $ hg prune 3 -s 5 --hidden
       
  1045   1 changesets pruned
       
  1046   2 new content-divergent changesets
       
  1047   $ hg phase --public -r 5
       
  1048 
       
  1049   $ hg glog
       
  1050   @  5:e800202333a4 added d
       
  1051   |   public
       
  1052   |
       
  1053   | *  4:f89a8e2f86ac added dh
       
  1054   | |   draft content-divergent
       
  1055   | |
       
  1056   o |  2:155349b645be added c
       
  1057   |/    public
       
  1058   |
       
  1059   o  1:5f6d8a4bf34a added b
       
  1060   |   public
       
  1061   |
       
  1062   o  0:9092f1db7931 added a
       
  1063       public
       
  1064   
       
  1065   $ hg evolve --content-divergent --any
       
  1066   merge:[5] added d
       
  1067   with: [4] added dh
       
  1068   base: [3] added d
       
  1069   rebasing "other" content-divergent changeset f89a8e2f86ac on 155349b645be
       
  1070   merging c
       
  1071   warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
       
  1072   fix conflicts and see `hg help evolve.interrupted`
       
  1073   [1]
       
  1074 
       
  1075   $ echo c > c
       
  1076   $ hg res -m
       
  1077   (no more unresolved files)
       
  1078   continue: hg evolve --continue
       
  1079 
       
  1080   $ hg evolve --continue
       
  1081   evolving 4:f89a8e2f86ac "added dh"
       
  1082   updating to "local" side of the conflict: e800202333a4
       
  1083   merging "other" content-divergent changeset 'bc309da55b88'
       
  1084   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1085   working directory is now at e800202333a4
       
  1086 
       
  1087   $ hg evolve -l
       
  1088 
       
  1089   $ hg par
       
  1090   changeset:   5:e800202333a4
       
  1091   tag:         tip
       
  1092   parent:      2:155349b645be
  1000   user:        test
  1093   user:        test
  1001   date:        Thu Jan 01 00:00:00 1970 +0000
  1094   date:        Thu Jan 01 00:00:00 1970 +0000
  1002   instability: content-divergent
  1095   summary:     added d
  1003   summary:     added ch
  1096   
  1004   
  1097 Testing the case when "merging results in same as public cset" where:
       
  1098 both the csets are on different parent and merging leads to conflict but relocation won't.
       
  1099 ------------------------------------------------------------------------------------------
       
  1100 Prepare the repo:
       
  1101 
       
  1102   $ cd ..
       
  1103   $ hg init pubdiv9
       
  1104   $ cd pubdiv9
       
  1105   $ for ch in a b c d; do
       
  1106   >   echo $ch > $ch;
       
  1107   >   hg ci -Am "added "$ch;
       
  1108   > done;
       
  1109   adding a
       
  1110   adding b
       
  1111   adding c
       
  1112   adding d
       
  1113 
       
  1114   $ hg up 1
       
  1115   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
  1116   $ echo dhconflict > dh
       
  1117   $ hg add dh
       
  1118   $ hg ci -m "added dh"
       
  1119   created new head
       
  1120 
       
  1121   $ hg up 2
       
  1122   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
  1123   $ echo dh > dh
       
  1124   $ hg add dh
       
  1125   $ hg ci -m "added d"
       
  1126   created new head
       
  1127 
       
  1128   $ hg glog
       
  1129   @  5:e800202333a4 added d
       
  1130   |   draft
       
  1131   |
       
  1132   | o  4:db0b7bba0aae added dh
       
  1133   | |   draft
       
  1134   | |
       
  1135   +---o  3:9150fe93bec6 added d
       
  1136   | |     draft
       
  1137   | |
       
  1138   o |  2:155349b645be added c
       
  1139   |/    draft
       
  1140   |
       
  1141   o  1:5f6d8a4bf34a added b
       
  1142   |   draft
       
  1143   |
       
  1144   o  0:9092f1db7931 added a
       
  1145       draft
       
  1146   
       
  1147 
       
  1148   $ hg prune 3 -s 4
       
  1149   1 changesets pruned
       
  1150   $ hg prune 3 -s 5 --hidden
       
  1151   1 changesets pruned
       
  1152   2 new content-divergent changesets
       
  1153   $ hg phase --public -r 5
       
  1154 
       
  1155   $ hg glog
       
  1156   @  5:e800202333a4 added d
       
  1157   |   public
       
  1158   |
       
  1159   | *  4:db0b7bba0aae added dh
       
  1160   | |   draft content-divergent
       
  1161   | |
       
  1162   o |  2:155349b645be added c
       
  1163   |/    public
       
  1164   |
       
  1165   o  1:5f6d8a4bf34a added b
       
  1166   |   public
       
  1167   |
       
  1168   o  0:9092f1db7931 added a
       
  1169       public
       
  1170   
       
  1171   $ hg evolve --content-divergent --any
       
  1172   merge:[5] added d
       
  1173   with: [4] added dh
       
  1174   base: [3] added d
       
  1175   rebasing "other" content-divergent changeset db0b7bba0aae on 155349b645be
       
  1176   updating to "local" side of the conflict: e800202333a4
       
  1177   merging "other" content-divergent changeset 'a5bbf2042450'
       
  1178   merging dh
       
  1179   warning: conflicts while merging dh! (edit, then use 'hg resolve --mark')
       
  1180   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
       
  1181   fix conflicts and see `hg help evolve.interrupted`
       
  1182   [1]
       
  1183 
       
  1184   $ echo dh > dh
       
  1185   $ hg res -m
       
  1186   (no more unresolved files)
       
  1187   continue: hg evolve --continue
       
  1188 
       
  1189   $ hg evolve --continue
       
  1190   working directory is now at e800202333a4
       
  1191 
       
  1192   $ hg evolve -l
       
  1193 
       
  1194   $ hg par
       
  1195   changeset:   5:e800202333a4
       
  1196   tag:         tip
       
  1197   parent:      2:155349b645be
       
  1198   user:        test
       
  1199   date:        Thu Jan 01 00:00:00 1970 +0000
       
  1200   summary:     added d
       
  1201   
       
  1202 
       
  1203 Testing the case when "merging results in same as public cset" where:
       
  1204 both the csets are on different parent and relocation and merging both leads to conflict:
       
  1205 -----------------------------------------------------------------------------------------
       
  1206 Prepare the repo:
       
  1207 
       
  1208   $ cd ..
       
  1209   $ hg init pubdiv10
       
  1210   $ cd pubdiv10
       
  1211   $ for ch in a b c d; do
       
  1212   >   echo $ch > $ch;
       
  1213   >   hg ci -Am "added "$ch;
       
  1214   > done;
       
  1215   adding a
       
  1216   adding b
       
  1217   adding c
       
  1218   adding d
       
  1219 
       
  1220   $ hg up 1
       
  1221   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
  1222   $ echo dhconflict > dh
       
  1223   $ echo cc > c
       
  1224   $ hg add dh c
       
  1225   $ hg ci -m "added dh"
       
  1226   created new head
       
  1227 
       
  1228   $ hg up 2
       
  1229   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
  1230   $ echo dh > dh
       
  1231   $ hg add dh
       
  1232   $ hg ci -m "added d"
       
  1233   created new head
       
  1234 
       
  1235   $ hg glog
       
  1236   @  5:e800202333a4 added d
       
  1237   |   draft
       
  1238   |
       
  1239   | o  4:67b19bbd770f added dh
       
  1240   | |   draft
       
  1241   | |
       
  1242   +---o  3:9150fe93bec6 added d
       
  1243   | |     draft
       
  1244   | |
       
  1245   o |  2:155349b645be added c
       
  1246   |/    draft
       
  1247   |
       
  1248   o  1:5f6d8a4bf34a added b
       
  1249   |   draft
       
  1250   |
       
  1251   o  0:9092f1db7931 added a
       
  1252       draft
       
  1253   
       
  1254 
       
  1255   $ hg prune 3 -s 4
       
  1256   1 changesets pruned
       
  1257   $ hg prune 3 -s 5 --hidden
       
  1258   1 changesets pruned
       
  1259   2 new content-divergent changesets
       
  1260   $ hg phase --public -r 5
       
  1261 
       
  1262   $ hg glog
       
  1263   @  5:e800202333a4 added d
       
  1264   |   public
       
  1265   |
       
  1266   | *  4:67b19bbd770f added dh
       
  1267   | |   draft content-divergent
       
  1268   | |
       
  1269   o |  2:155349b645be added c
       
  1270   |/    public
       
  1271   |
       
  1272   o  1:5f6d8a4bf34a added b
       
  1273   |   public
       
  1274   |
       
  1275   o  0:9092f1db7931 added a
       
  1276       public
       
  1277   
       
  1278   $ hg evolve --content-divergent --any
       
  1279   merge:[5] added d
       
  1280   with: [4] added dh
       
  1281   base: [3] added d
       
  1282   rebasing "other" content-divergent changeset 67b19bbd770f on 155349b645be
       
  1283   merging c
       
  1284   warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
       
  1285   fix conflicts and see `hg help evolve.interrupted`
       
  1286   [1]
       
  1287 
       
  1288   $ echo c > c
       
  1289   $ hg res -m
       
  1290   (no more unresolved files)
       
  1291   continue: hg evolve --continue
       
  1292 
       
  1293   $ hg evolve --continue
       
  1294   evolving 4:67b19bbd770f "added dh"
       
  1295   updating to "local" side of the conflict: e800202333a4
       
  1296   merging "other" content-divergent changeset '09054d1f3c97'
       
  1297   merging dh
       
  1298   warning: conflicts while merging dh! (edit, then use 'hg resolve --mark')
       
  1299   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
       
  1300   fix conflicts and see `hg help evolve.interrupted`
       
  1301   [1]
       
  1302 
       
  1303   $ echo dh > dh
       
  1304   $ hg res -m
       
  1305   (no more unresolved files)
       
  1306   continue: hg evolve --continue
       
  1307 
       
  1308   $ hg evolve --continue
       
  1309   working directory is now at e800202333a4
       
  1310 
       
  1311   $ hg evolve -l
       
  1312 
       
  1313   $ hg par
       
  1314   changeset:   5:e800202333a4
       
  1315   tag:         tip
       
  1316   parent:      2:155349b645be
       
  1317   user:        test
       
  1318   date:        Thu Jan 01 00:00:00 1970 +0000
       
  1319   summary:     added d
       
  1320