tests/test-rollback.t
changeset 49825 2f2682f40ea0
parent 46417 768056549737
child 49986 dbcc45221c1f
equal deleted inserted replaced
49824:fdd227585d5a 49825:2f2682f40ea0
     2   $ hg init t
     2   $ hg init t
     3   $ cd t
     3   $ cd t
     4   $ echo a > a
     4   $ echo a > a
     5   $ hg commit -Am'add a'
     5   $ hg commit -Am'add a'
     6   adding a
     6   adding a
     7   $ hg verify
     7   $ hg verify -q
     8   checking changesets
       
     9   checking manifests
       
    10   crosschecking files in changesets and manifests
       
    11   checking files
       
    12   checked 1 changesets with 1 changes to 1 files
       
    13   $ hg parents
     8   $ hg parents
    14   changeset:   0:1f0dee641bb7
     9   changeset:   0:1f0dee641bb7
    15   tag:         tip
    10   tag:         tip
    16   user:        test
    11   user:        test
    17   date:        Thu Jan 01 00:00:00 1970 +0000
    12   date:        Thu Jan 01 00:00:00 1970 +0000
    21 rollback to null revision
    16 rollback to null revision
    22   $ hg status
    17   $ hg status
    23   $ hg rollback
    18   $ hg rollback
    24   repository tip rolled back to revision -1 (undo commit)
    19   repository tip rolled back to revision -1 (undo commit)
    25   working directory now based on revision -1
    20   working directory now based on revision -1
    26   $ hg verify
    21   $ hg verify -q
    27   checking changesets
       
    28   checking manifests
       
    29   crosschecking files in changesets and manifests
       
    30   checking files
       
    31   checked 0 changesets with 0 changes to 0 files
       
    32   $ hg parents
    22   $ hg parents
    33   $ hg status
    23   $ hg status
    34   A a
    24   A a
    35 
    25 
    36 Two changesets this time so we rollback to a real changeset
    26 Two changesets this time so we rollback to a real changeset
   189   $ cat a
   179   $ cat a
   190   a
   180   a
   191 
   181 
   192 corrupt journal test
   182 corrupt journal test
   193   $ echo "foo" > .hg/store/journal
   183   $ echo "foo" > .hg/store/journal
   194   $ hg recover --verify
   184   $ hg recover --verify -q
   195   rolling back interrupted transaction
       
   196   couldn't read journal entry 'foo\n'!
   185   couldn't read journal entry 'foo\n'!
   197   checking changesets
       
   198   checking manifests
       
   199   crosschecking files in changesets and manifests
       
   200   checking files
       
   201   checked 2 changesets with 2 changes to 1 files
       
   202 
   186 
   203 rollback disabled by config
   187 rollback disabled by config
   204   $ cat >> $HGRCPATH <<EOF
   188   $ cat >> $HGRCPATH <<EOF
   205   > [ui]
   189   > [ui]
   206   > rollback = false
   190   > rollback = false
   431   transaction abort!
   415   transaction abort!
   432   warn during abort
   416   warn during abort
   433   abort: pretxncommit hook exited with status 1
   417   abort: pretxncommit hook exited with status 1
   434   [40]
   418   [40]
   435 
   419 
   436   $ hg verify
   420   $ hg verify -q
   437   checking changesets
       
   438   checking manifests
       
   439   crosschecking files in changesets and manifests
       
   440   checking files
       
   441   checked 1 changesets with 1 changes to 1 files
       
   442 
   421 
   443   $ cd ..
   422   $ cd ..
   444 
   423 
   445 Multiple I/O errors after transaction open are handled.
   424 Multiple I/O errors after transaction open are handled.
   446 This is effectively what happens if a peer disconnects in the middle
   425 This is effectively what happens if a peer disconnects in the middle
   456 
   435 
   457   $ echo 1 > foo
   436   $ echo 1 > foo
   458 
   437 
   459   $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors'
   438   $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors'
   460 
   439 
   461   $ hg verify
   440   $ hg verify -q
   462   checking changesets
   441 
   463   checking manifests
   442   $ cd ..
   464   crosschecking files in changesets and manifests
       
   465   checking files
       
   466   checked 2 changesets with 2 changes to 1 files
       
   467 
       
   468   $ cd ..