tests/test-revert.t
changeset 32940 75be14993fda
parent 30556 c059286a0f9c
child 34146 9e4f82bc2b0b
equal deleted inserted replaced
32939:cad62cb3c84c 32940:75be14993fda
   493 Write the python script to disk
   493 Write the python script to disk
   494 -------------------------------
   494 -------------------------------
   495 
   495 
   496 check list of planned files
   496 check list of planned files
   497 
   497 
   498   $ python $TESTDIR/generate-working-copy-states.py filelist 2
   498   $ $PYTHON $TESTDIR/generate-working-copy-states.py filelist 2
   499   content1_content1_content1-tracked
   499   content1_content1_content1-tracked
   500   content1_content1_content1-untracked
   500   content1_content1_content1-untracked
   501   content1_content1_content3-tracked
   501   content1_content1_content3-tracked
   502   content1_content1_content3-untracked
   502   content1_content1_content3-untracked
   503   content1_content1_missing-tracked
   503   content1_content1_missing-tracked
   548   $ hg init revert-ref
   548   $ hg init revert-ref
   549   $ cd revert-ref
   549   $ cd revert-ref
   550 
   550 
   551 Generate base changeset
   551 Generate base changeset
   552 
   552 
   553   $ python $TESTDIR/generate-working-copy-states.py state 2 1
   553   $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1
   554   $ hg addremove --similarity 0
   554   $ hg addremove --similarity 0
   555   adding content1_content1_content1-tracked
   555   adding content1_content1_content1-tracked
   556   adding content1_content1_content1-untracked
   556   adding content1_content1_content1-untracked
   557   adding content1_content1_content3-tracked
   557   adding content1_content1_content3-tracked
   558   adding content1_content1_content3-untracked
   558   adding content1_content1_content3-untracked
   595   A content1_missing_missing-untracked
   595   A content1_missing_missing-untracked
   596   $ hg commit -m 'base'
   596   $ hg commit -m 'base'
   597 
   597 
   598 (create a simple text version of the content)
   598 (create a simple text version of the content)
   599 
   599 
   600   $ python ../dircontent.py > ../content-base.txt
   600   $ $PYTHON ../dircontent.py > ../content-base.txt
   601   $ cat ../content-base.txt
   601   $ cat ../content-base.txt
   602   content1 content1_content1_content1-tracked
   602   content1 content1_content1_content1-tracked
   603   content1 content1_content1_content1-untracked
   603   content1 content1_content1_content1-untracked
   604   content1 content1_content1_content3-tracked
   604   content1 content1_content1_content3-tracked
   605   content1 content1_content1_content3-untracked
   605   content1 content1_content1_content3-untracked
   620   content1 content1_missing_missing-tracked
   620   content1 content1_missing_missing-tracked
   621   content1 content1_missing_missing-untracked
   621   content1 content1_missing_missing-untracked
   622 
   622 
   623 Create parent changeset
   623 Create parent changeset
   624 
   624 
   625   $ python $TESTDIR/generate-working-copy-states.py state 2 2
   625   $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2
   626   $ hg addremove --similarity 0
   626   $ hg addremove --similarity 0
   627   removing content1_missing_content1-tracked
   627   removing content1_missing_content1-tracked
   628   removing content1_missing_content1-untracked
   628   removing content1_missing_content1-untracked
   629   removing content1_missing_content3-tracked
   629   removing content1_missing_content3-tracked
   630   removing content1_missing_content3-untracked
   630   removing content1_missing_content3-untracked
   659   R content1_missing_missing-untracked
   659   R content1_missing_missing-untracked
   660   $ hg commit -m 'parent'
   660   $ hg commit -m 'parent'
   661 
   661 
   662 (create a simple text version of the content)
   662 (create a simple text version of the content)
   663 
   663 
   664   $ python ../dircontent.py > ../content-parent.txt
   664   $ $PYTHON ../dircontent.py > ../content-parent.txt
   665   $ cat ../content-parent.txt
   665   $ cat ../content-parent.txt
   666   content1 content1_content1_content1-tracked
   666   content1 content1_content1_content1-tracked
   667   content1 content1_content1_content1-untracked
   667   content1 content1_content1_content1-untracked
   668   content1 content1_content1_content3-tracked
   668   content1 content1_content1_content3-tracked
   669   content1 content1_content1_content3-untracked
   669   content1 content1_content1_content3-untracked
   684   content2 missing_content2_missing-tracked
   684   content2 missing_content2_missing-tracked
   685   content2 missing_content2_missing-untracked
   685   content2 missing_content2_missing-untracked
   686 
   686 
   687 Setup working directory
   687 Setup working directory
   688 
   688 
   689   $ python $TESTDIR/generate-working-copy-states.py state 2 wc
   689   $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc
   690   $ hg addremove --similarity 0
   690   $ hg addremove --similarity 0
   691   adding content1_missing_content1-tracked
   691   adding content1_missing_content1-tracked
   692   adding content1_missing_content1-untracked
   692   adding content1_missing_content1-untracked
   693   adding content1_missing_content3-tracked
   693   adding content1_missing_content3-tracked
   694   adding content1_missing_content3-untracked
   694   adding content1_missing_content3-untracked
   752   ! missing_missing_missing-tracked
   752   ! missing_missing_missing-tracked
   753   ? missing_missing_content3-untracked
   753   ? missing_missing_content3-untracked
   754 
   754 
   755 (create a simple text version of the content)
   755 (create a simple text version of the content)
   756 
   756 
   757   $ python ../dircontent.py > ../content-wc.txt
   757   $ $PYTHON ../dircontent.py > ../content-wc.txt
   758   $ cat ../content-wc.txt
   758   $ cat ../content-wc.txt
   759   content1 content1_content1_content1-tracked
   759   content1 content1_content1_content1-tracked
   760   content1 content1_content1_content1-untracked
   760   content1 content1_content1_content1-untracked
   761   content3 content1_content1_content3-tracked
   761   content3 content1_content1_content3-tracked
   762   content3 content1_content1_content3-untracked
   762   content3 content1_content1_content3-untracked
   816 Compare resulting directory with revert target.
   816 Compare resulting directory with revert target.
   817 
   817 
   818 The diff is filtered to include change only. The only difference should be
   818 The diff is filtered to include change only. The only difference should be
   819 additional `.orig` backup file when applicable.
   819 additional `.orig` backup file when applicable.
   820 
   820 
   821   $ python ../dircontent.py > ../content-parent-all.txt
   821   $ $PYTHON ../dircontent.py > ../content-parent-all.txt
   822   $ cd ..
   822   $ cd ..
   823   $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
   823   $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
   824   +content3 content1_content1_content3-tracked.orig
   824   +content3 content1_content1_content3-tracked.orig
   825   +content3 content1_content1_content3-untracked.orig
   825   +content3 content1_content1_content3-untracked.orig
   826   +content1 content1_content2_content1-tracked.orig
   826   +content1 content1_content2_content1-tracked.orig
   873 Compare resulting directory with revert target.
   873 Compare resulting directory with revert target.
   874 
   874 
   875 The diff is filtered to include change only. The only difference should be
   875 The diff is filtered to include change only. The only difference should be
   876 additional `.orig` backup file when applicable.
   876 additional `.orig` backup file when applicable.
   877 
   877 
   878   $ python ../dircontent.py > ../content-base-all.txt
   878   $ $PYTHON ../dircontent.py > ../content-base-all.txt
   879   $ cd ..
   879   $ cd ..
   880   $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
   880   $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
   881   +content3 content1_content1_content3-tracked.orig
   881   +content3 content1_content1_content3-tracked.orig
   882   +content3 content1_content1_content3-untracked.orig
   882   +content3 content1_content1_content3-untracked.orig
   883   +content2 content1_content2_content2-untracked.orig
   883   +content2 content1_content2_content2-untracked.orig
   900   $ cd revert-parent-explicit
   900   $ cd revert-parent-explicit
   901 
   901 
   902 revert all files individually and check the output
   902 revert all files individually and check the output
   903 (output is expected to be different than in the --all case)
   903 (output is expected to be different than in the --all case)
   904 
   904 
   905   $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
   905   $ for file in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 2`; do
   906   >   echo '### revert for:' $file;
   906   >   echo '### revert for:' $file;
   907   >   hg revert $file;
   907   >   hg revert $file;
   908   >   echo
   908   >   echo
   909   > done
   909   > done
   910   ### revert for: content1_content1_content1-tracked
   910   ### revert for: content1_content1_content1-tracked
   977   
   977   
   978 
   978 
   979 check resulting directory against the --all run
   979 check resulting directory against the --all run
   980 (There should be no difference)
   980 (There should be no difference)
   981 
   981 
   982   $ python ../dircontent.py > ../content-parent-explicit.txt
   982   $ $PYTHON ../dircontent.py > ../content-parent-explicit.txt
   983   $ cd ..
   983   $ cd ..
   984   $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
   984   $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
   985   [1]
   985   [1]
   986 
   986 
   987 Test revert to "base" content with explicit file name
   987 Test revert to "base" content with explicit file name
   993   $ cd revert-base-explicit
   993   $ cd revert-base-explicit
   994 
   994 
   995 revert all files individually and check the output
   995 revert all files individually and check the output
   996 (output is expected to be different than in the --all case)
   996 (output is expected to be different than in the --all case)
   997 
   997 
   998   $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
   998   $ for file in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 2`; do
   999   >   echo '### revert for:' $file;
   999   >   echo '### revert for:' $file;
  1000   >   hg revert $file --rev 'desc(base)';
  1000   >   hg revert $file --rev 'desc(base)';
  1001   >   echo
  1001   >   echo
  1002   > done
  1002   > done
  1003   ### revert for: content1_content1_content1-tracked
  1003   ### revert for: content1_content1_content1-tracked
  1070   
  1070   
  1071 
  1071 
  1072 check resulting directory against the --all run
  1072 check resulting directory against the --all run
  1073 (There should be no difference)
  1073 (There should be no difference)
  1074 
  1074 
  1075   $ python ../dircontent.py > ../content-base-explicit.txt
  1075   $ $PYTHON ../dircontent.py > ../content-base-explicit.txt
  1076   $ cd ..
  1076   $ cd ..
  1077   $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _
  1077   $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _
  1078   [1]
  1078   [1]
  1079 
  1079 
  1080 Revert to an ancestor of P2 during a merge (issue5052)
  1080 Revert to an ancestor of P2 during a merge (issue5052)