tests/test-prev-next.t
branchmercurial-4.4
changeset 3817 5ca297e78f2c
parent 3590 d5adce52cef4
parent 3813 27e7ed2d13a6
child 3818 f8677cb11dcb
child 4076 f9a850018daa
equal deleted inserted replaced
3723:e70ad3983872 3817:5ca297e78f2c
   352   got lock after [4-6] seconds (re)
   352   got lock after [4-6] seconds (re)
   353   move:[2] two
   353   move:[2] two
   354   atop:[3] one
   354   atop:[3] one
   355   working directory now at a7d885c75614
   355   working directory now at a7d885c75614
   356   $ wait
   356   $ wait
       
   357 
       
   358 testing next --evolve when working directory is dirty
       
   359 
       
   360   $ hg log -GT "{rev}:{node|short} {desc|firstline}"
       
   361   @  4:a7d885c75614 two
       
   362   |
       
   363   o  3:c741983992fc one
       
   364   
       
   365 
       
   366   $ hg up .^
       
   367   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   368 
       
   369   $ echo foobar > bar
       
   370   $ hg add bar
       
   371   $ hg amend
       
   372   1 new orphan changesets
       
   373 
       
   374   $ echo babar > bar
       
   375 
       
   376   $ hg next --evolve
       
   377   abort: uncommitted changes
       
   378   [255]
       
   379 
       
   380   $ cd ..
       
   381 
       
   382 Testing that `next` and `prev` respects `commands.update.check=noconflict`
       
   383 
       
   384   $ hg init noconflict
       
   385   $ cd noconflict
       
   386   $ echo "[commands]" >> .hg/hgrc
       
   387   $ echo "update.check=noconflict" >> .hg/hgrc
       
   388 
       
   389   $ echo hi > wat
       
   390   $ hg ci -Aqm "added wat"
       
   391   $ echo hi > foo
       
   392   $ hg ci -Aqm "added foo"
       
   393   $ echo hi > bar
       
   394   $ hg ci -Aqm "added bar"
       
   395 
       
   396 testing for `hg prev`
       
   397 
       
   398   $ echo bar > wat
       
   399   $ hg prev
       
   400   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   401   [1] added foo
       
   402   $ hg diff
       
   403   diff -r cf959ce4e1ff wat
       
   404   --- a/wat	Thu Jan 01 00:00:00 1970 +0000
       
   405   +++ b/wat	Thu Jan 01 00:00:00 1970 +0000
       
   406   @@ -1,1 +1,1 @@
       
   407   -hi
       
   408   +bar
       
   409 
       
   410 testing for `hg next`
       
   411 
       
   412   $ hg next
       
   413   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   414   [2] added bar
       
   415   $ hg diff
       
   416   diff -r ac3de1218820 wat
       
   417   --- a/wat	Thu Jan 01 00:00:00 1970 +0000
       
   418   +++ b/wat	Thu Jan 01 00:00:00 1970 +0000
       
   419   @@ -1,1 +1,1 @@
       
   420   -hi
       
   421   +bar
       
   422 
       
   423 test that we dont end up in merge conflicts
       
   424 
       
   425   $ echo bar > bar
       
   426   $ hg prev
       
   427   abort: conflicting changes
       
   428   (do you want --merge?)
       
   429   [255]
       
   430 
       
   431   $ echo hi > bar
       
   432   $ hg prev
       
   433   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   434   [1] added foo
       
   435   $ echo bar > bar
       
   436   $ hg add bar
       
   437 
       
   438   $ hg next
       
   439   abort: conflicting changes
       
   440   (do you want --merge?)
       
   441   [255]
       
   442 
       
   443 Test that --merge still works fine with commands.update.check set
       
   444 
       
   445 XXX: yes we want --merge and we passed that!
       
   446   $ echo hi > bar
       
   447   $ echo bar >> bar
       
   448   $ hg next --merge
       
   449   merging bar
       
   450   warning: conflicts while merging bar! (edit, then use 'hg resolve --mark')
       
   451   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
       
   452   use 'hg resolve' to retry unresolved file merges
       
   453   [2] added bar
       
   454 
       
   455   $ echo babar > bar
       
   456   $ hg resolve -m
       
   457   (no more unresolved files)
       
   458 
       
   459 Testing --merge works with other values of commands.update.check also
       
   460 
       
   461 XXX: things are broken!
       
   462   $ hg prev --merge --config commands.update.check=abort
       
   463   local [working copy] changed bar which other [destination] deleted
       
   464   use (c)hanged version, (d)elete, or leave (u)nresolved? 
       
   465   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
       
   466   use 'hg resolve' to retry unresolved file merges
       
   467   [1] added foo
       
   468 
       
   469   $ hg revert --all
       
   470   forgetting bar
       
   471   reverting wat
       
   472   $ hg resolve -m
       
   473   (no more unresolved files)
       
   474 
       
   475   $ echo bar > bar
       
   476   $ hg add bar
       
   477 
       
   478   $ hg next --merge --config commands.update.check=abort
       
   479   merging bar
       
   480   warning: conflicts while merging bar! (edit, then use 'hg resolve --mark')
       
   481   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
       
   482   use 'hg resolve' to retry unresolved file merges
       
   483   [2] added bar