tests/test-mq-qdiff
changeset 12325 5f6231861e09
parent 12323 f00953d9533c
parent 12324 b701610f6c56
child 12326 9d932e8e9546
equal deleted inserted replaced
12323:f00953d9533c 12325:5f6231861e09
     1 #!/bin/sh
       
     2 
       
     3 echo "[extensions]" >> $HGRCPATH
       
     4 echo "mq=" >> $HGRCPATH
       
     5 echo "[mq]" >> $HGRCPATH
       
     6 echo "git=keep" >> $HGRCPATH
       
     7 
       
     8 echo % init
       
     9 hg init a
       
    10 cd a
       
    11 
       
    12 echo % commit
       
    13 echo 'base' > base
       
    14 hg ci -Ambase -d '1 0'
       
    15 
       
    16 echo % qnew mqbase
       
    17 hg qnew -mmqbase mqbase
       
    18 
       
    19 echo % qrefresh
       
    20 echo 'patched' > base
       
    21 hg qrefresh
       
    22 
       
    23 echo % qdiff
       
    24 hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
       
    25                -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
       
    26 
       
    27 echo % qdiff dirname
       
    28 hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
       
    29                  -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
       
    30 
       
    31 echo % qdiff filename
       
    32 hg qdiff --nodates base
       
    33 
       
    34 echo % revert
       
    35 hg revert -a
       
    36 
       
    37 echo % qpop
       
    38 hg qpop
       
    39 
       
    40 echo % qdelete mqbase
       
    41 hg qdelete mqbase
       
    42 
       
    43 echo % commit 2
       
    44 printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines
       
    45 hg ci -Amlines -d '2 0'
       
    46 
       
    47 echo % qnew 2
       
    48 hg qnew -mmqbase2 mqbase2
       
    49 printf '\n\n1\n2\n3\n4\nhello  world\n     goodbye world\n7\n8\n9\n' > lines
       
    50 
       
    51 echo % qdiff -U 1
       
    52 hg qdiff --nodates -U 1
       
    53 
       
    54 echo % qdiff -b
       
    55 hg qdiff --nodates -b
       
    56 
       
    57 echo % qdiff -U 1 -B
       
    58 hg qdiff --nodates -U 1 -B
       
    59 
       
    60 echo % qdiff -w
       
    61 hg qdiff --nodates -w
       
    62 
       
    63 echo % qdiff --reverse
       
    64 hg qdiff --nodates --reverse
       
    65 
       
    66 echo % qdiff preserve existing git flag
       
    67 hg qrefresh --git
       
    68 echo a >> lines
       
    69 hg qdiff
       
    70 
       
    71 echo % qdiff --stat
       
    72 hg qdiff --stat