tests/test-censor.t
changeset 47457 f8330a3fc39f
parent 47392 8089d0fa8400
child 48324 95ea181d9bdd
equal deleted inserted replaced
47456:93f4e183b3f5 47457:f8330a3fc39f
     1 #require no-reposimplestore
     1 #require no-reposimplestore
       
     2 #testcases revlogv1 revlogv2
       
     3 
       
     4 #if revlogv2
       
     5 
       
     6   $ cat >> $HGRCPATH <<EOF
       
     7   > [experimental]
       
     8   > revlogv2=enable-unstable-format-and-corrupt-my-data
       
     9   > EOF
       
    10 
       
    11 #endif
     2 
    12 
     3   $ cat >> $HGRCPATH <<EOF
    13   $ cat >> $HGRCPATH <<EOF
     4   > [extensions]
    14   > [extensions]
     5   > censor=
    15   > censor=
     6   > EOF
    16   > EOF
   503   adding file changes
   513   adding file changes
   504   added 1 changesets with 2 changes to 2 files
   514   added 1 changesets with 2 changes to 2 files
   505   new changesets e97f55b2665a (1 drafts)
   515   new changesets e97f55b2665a (1 drafts)
   506   (run 'hg update' to get a working copy)
   516   (run 'hg update' to get a working copy)
   507   $ hg cat -r 0 target | head -n 10
   517   $ hg cat -r 0 target | head -n 10
       
   518 
       
   519 #if revlogv2
       
   520 
       
   521 Testing feature that does not work in revlog v1
       
   522 ===============================================
       
   523 
       
   524 Censoring a revision that is used as delta base
       
   525 -----------------------------------------------
       
   526 
       
   527   $ cd ..
       
   528   $ hg init censor-with-delta
       
   529   $ cd censor-with-delta
       
   530   $ echo root > target
       
   531   $ hg add target
       
   532   $ hg commit -m root
       
   533   $ B0=`hg id --debug -i`
       
   534   $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
       
   535   > do
       
   536   >   echo "Password: hunter$x" >> target
       
   537   > done
       
   538   $ hg ci -m 'write a long file'
       
   539   $ B1=`hg id --debug -i`
       
   540   $ echo 'small change (should create a delta)' >> target
       
   541   $ hg ci -m 'create a delta over the password'
       
   542 (should show that the last revision is a delta, not a snapshot)
       
   543   $ B2=`hg id --debug -i`
       
   544 
       
   545 Make sure the last revision is a delta against the revision we will censor
       
   546 
       
   547   $ hg debugdeltachain target -T '{rev} {chainid} {chainlen} {prevrev}\n'
       
   548   0 1 1 -1
       
   549   1 2 1 -1
       
   550   2 2 2 1
       
   551 
       
   552 Censor the file
       
   553 
       
   554   $ hg cat -r $B1 target | wc -l
       
   555   50002 (re)
       
   556   $ hg censor -r $B1 target
       
   557   $ hg cat -r $B1 target | wc -l
       
   558   0 (re)
       
   559 
       
   560 Check the children is fine
       
   561 
       
   562   $ hg cat -r $B2 target | wc -l
       
   563   50003 (re)
       
   564 
       
   565 #endif