tests/test-git-import
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 06 Oct 2006 16:24:14 +0200
changeset 3275 7ae37d99d47e
parent 2864 e2b69dbb2daa
child 3589 1c9b6f1237e0
permissions -rwxr-xr-x
ssh: make the error message more clear, add a testcase
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2864
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     1
#!/bin/sh
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     3
hg init a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     4
cd a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     5
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     6
echo % new file
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     7
hg import -mnew - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     8
diff --git a/new b/new
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     9
new file mode 100644
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    10
index 0000000..7898192
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    11
--- /dev/null
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    12
+++ b/new
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
@@ -0,0 +1 @@
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    14
+a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    15
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    16
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    17
echo % chmod +x
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    18
hg import -msetx - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    19
diff --git a/new b/new
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    20
old mode 100644
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    21
new mode 100755
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    22
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    23
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    24
test -x new || echo failed
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    25
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    26
echo % copy
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    27
hg import -mcopy - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    28
diff --git a/new b/copy
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    29
old mode 100755
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    30
new mode 100644
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    31
similarity index 100%
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    32
copy from new
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    33
copy to copy
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    34
diff --git a/new b/copyx
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    35
similarity index 100%
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    36
copy from new
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    37
copy to copyx
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    38
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    39
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    40
test -f copy -a ! -x copy || echo failed
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    41
test -x copyx || echo failed
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    42
cat copy
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    43
hg cat copy
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    44
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    45
echo % rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    46
hg import -mrename - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    47
diff --git a/copy b/rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    48
similarity index 100%
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    49
rename from copy
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    50
rename to rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    51
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    52
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    53
hg locate
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    54
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    55
echo % delete
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    56
hg import -mdelete - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    57
diff --git a/copyx b/copyx
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    58
deleted file mode 100755
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    59
index 7898192..0000000
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    60
--- a/copyx
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    61
+++ /dev/null
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    62
@@ -1 +0,0 @@
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    63
-a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    64
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    65
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    66
hg locate
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    67
test -f copyx && echo failed || true
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    68
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    69
echo % regular diff
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    70
hg import -mregular - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    71
diff --git a/rename b/rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    72
index 7898192..72e1fe3 100644
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    73
--- a/rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    74
+++ b/rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    75
@@ -1 +1,5 @@
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    76
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    77
+a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    78
+a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    79
+a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    80
+a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    81
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    82
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    83
echo % copy and modify
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    84
hg import -mcopymod - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    85
diff --git a/rename b/copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    86
similarity index 80%
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    87
copy from rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    88
copy to copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    89
index 72e1fe3..b53c148 100644
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    90
--- a/rename
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    91
+++ b/copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    92
@@ -1,5 +1,5 @@
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    93
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    94
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    95
-a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    96
+b
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    97
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    98
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    99
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   100
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   101
hg cat copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   102
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   103
echo % rename and modify
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   104
hg import -mrenamemod - <<EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   105
diff --git a/copy2 b/rename2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   106
similarity index 80%
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   107
rename from copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   108
rename to rename2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   109
index b53c148..8f81e29 100644
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   110
--- a/copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   111
+++ b/rename2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   112
@@ -1,5 +1,5 @@
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   113
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   114
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   115
 b
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   116
-a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   117
+c
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   118
 a
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   119
EOF
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   120
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   121
hg locate copy2
e2b69dbb2daa Tests for git import
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   122
hg cat rename2