tests/test-git-export
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Thu, 07 Sep 2006 14:12:39 +0200
changeset 3066 035fd2029575
parent 2935 1c66aad252f9
child 3199 096f1c73cdc3
permissions -rwxr-xr-x
git --diff: fix traceback when getting mode change - use the manifest instead of the mode in the working dir if the diff is against two revisions - add a testcase
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     1
#!/bin/sh
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     3
hg init a
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     4
cd a
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     5
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     6
echo start > start
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     7
hg ci -Amstart -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     8
echo new > new
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     9
hg ci -Amnew -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    10
echo '% new file'
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    11
hg diff --git -r 0 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    12
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    14
hg cp new copy
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    15
hg ci -mcopy -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    16
echo '% copy'
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    17
hg diff --git -r 1:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    18
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    19
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    20
hg mv copy rename
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    21
hg ci -mrename -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    22
echo '% rename'
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    23
hg diff --git -r 2:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    24
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    25
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    26
hg rm rename
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    27
hg ci -mdelete -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    28
echo '% delete'
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    29
hg diff --git -r 3:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    30
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    31
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    32
cat > src <<EOF
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    33
1
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    34
2
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    35
3
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    36
4
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    37
5
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    38
EOF
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    39
hg ci -Amsrc -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    40
chmod +x src
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    41
hg ci -munexec -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    42
echo '% chmod 644'
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    43
hg diff --git -r 5:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    44
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    45
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    46
hg mv src dst
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    47
chmod -x dst
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    48
echo a >> dst
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    49
hg ci -mrenamemod -d '0 0'
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    50
echo '% rename+mod+chmod'
2935
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    51
hg diff --git -r 6:tip | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
1c66aad252f9 sed portability fixes
Brendan Cully <brendan@kublai.com>
parents: 2907
diff changeset
    52
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
3066
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
    53
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
    54
echo '% nonexistent in tip+chmod'
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
    55
hg diff --git -r 5:6 | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
    56
    -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"