tests/test-rebase-rename
changeset 7954 b969611064ae
child 11198 b345b1cc124f
equal deleted inserted replaced
7953:8c6f823efcc9 7954:b969611064ae
       
     1 #!/bin/sh
       
     2 
       
     3 echo "[extensions]" >> $HGRCPATH
       
     4 echo "rebase=" >> $HGRCPATH
       
     5 echo "[diff]" >> $HGRCPATH
       
     6 echo "git=1" >> $HGRCPATH
       
     7 
       
     8 BASE=`pwd`
       
     9 
       
    10 cleanoutput () {
       
    11     sed -e 's/\(Rebase status stored to\).*/\1/'  \
       
    12         -e 's/\(Rebase status restored from\).*/\1/' \
       
    13         -e 's/\(saving bundle to \).*/\1/'
       
    14 }
       
    15 
       
    16 hg init repo1
       
    17 cd repo1
       
    18 echo "a">a
       
    19 hg commit -Am "A" --date '0 0'
       
    20 echo "b"> b
       
    21 hg commit -Am "B" --date '1 0'
       
    22 hg up -C 0
       
    23 hg mv a a-renamed
       
    24 hg commit -m 'rename A' --date '2 0'
       
    25 
       
    26 echo
       
    27 echo '% Rename is tracked'
       
    28 hg log -p -r tip --template '{rev}:{desc}\n'
       
    29 
       
    30 echo '% Rebase the revision containing the rename'
       
    31 hg rebase -s 2 -d 1 --quiet 2>&1 | cleanoutput
       
    32 
       
    33 echo
       
    34 echo '% Rename is not lost'
       
    35 hg log -p -r tip --template '{rev}:{desc}\n'
       
    36 
       
    37 cd $BASE
       
    38 rm -rf repo1
       
    39 hg init repo1
       
    40 cd repo1
       
    41 echo "a">a
       
    42 hg commit -Am "A" --date '0 0'
       
    43 echo "b"> b
       
    44 hg commit -Am "B" --date '1 0'
       
    45 hg up -C 0
       
    46 hg cp a a-copied
       
    47 hg commit -m 'copy A' --date '2 0'
       
    48 
       
    49 echo
       
    50 echo '% Copy is tracked'
       
    51 hg log -p -r tip --template '{rev}:{desc}\n'
       
    52 
       
    53 echo '% Rebase the revision containing the copy'
       
    54 hg rebase -s 2 -d 1 --quiet 2>&1 | cleanoutput
       
    55 
       
    56 echo
       
    57 echo '% Copy is not lost'
       
    58 hg log -p -r tip --template '{rev}:{desc}\n'
       
    59