Mercurial > hg
annotate tests/test-git-import @ 3589:1c9b6f1237e0
test for git empty new files
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Mon, 30 Oct 2006 16:14:38 -0800 |
parents | e2b69dbb2daa |
children | 05c8704a3743 |
rev | line source |
---|---|
2864 | 1 #!/bin/sh |
2 | |
3 hg init a | |
4 cd a | |
5 | |
6 echo % new file | |
7 hg import -mnew - <<EOF | |
8 diff --git a/new b/new | |
9 new file mode 100644 | |
10 index 0000000..7898192 | |
11 --- /dev/null | |
12 +++ b/new | |
13 @@ -0,0 +1 @@ | |
14 +a | |
15 EOF | |
16 | |
3589
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
17 echo % new empty file |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
18 hg import -mempty - <<EOF |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
19 diff --git a/empty b/empty |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
20 new file mode 100644 |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
21 EOF |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
22 hg locate empty |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
23 |
2864 | 24 echo % chmod +x |
25 hg import -msetx - <<EOF | |
26 diff --git a/new b/new | |
27 old mode 100644 | |
28 new mode 100755 | |
29 EOF | |
30 | |
31 test -x new || echo failed | |
32 | |
33 echo % copy | |
34 hg import -mcopy - <<EOF | |
35 diff --git a/new b/copy | |
36 old mode 100755 | |
37 new mode 100644 | |
38 similarity index 100% | |
39 copy from new | |
40 copy to copy | |
41 diff --git a/new b/copyx | |
42 similarity index 100% | |
43 copy from new | |
44 copy to copyx | |
45 EOF | |
46 | |
47 test -f copy -a ! -x copy || echo failed | |
48 test -x copyx || echo failed | |
49 cat copy | |
50 hg cat copy | |
51 | |
52 echo % rename | |
53 hg import -mrename - <<EOF | |
54 diff --git a/copy b/rename | |
55 similarity index 100% | |
56 rename from copy | |
57 rename to rename | |
58 EOF | |
59 | |
60 hg locate | |
61 | |
62 echo % delete | |
63 hg import -mdelete - <<EOF | |
64 diff --git a/copyx b/copyx | |
65 deleted file mode 100755 | |
66 index 7898192..0000000 | |
67 --- a/copyx | |
68 +++ /dev/null | |
69 @@ -1 +0,0 @@ | |
70 -a | |
71 EOF | |
72 | |
73 hg locate | |
74 test -f copyx && echo failed || true | |
75 | |
76 echo % regular diff | |
77 hg import -mregular - <<EOF | |
78 diff --git a/rename b/rename | |
79 index 7898192..72e1fe3 100644 | |
80 --- a/rename | |
81 +++ b/rename | |
82 @@ -1 +1,5 @@ | |
83 a | |
84 +a | |
85 +a | |
86 +a | |
87 +a | |
88 EOF | |
89 | |
90 echo % copy and modify | |
91 hg import -mcopymod - <<EOF | |
92 diff --git a/rename b/copy2 | |
93 similarity index 80% | |
94 copy from rename | |
95 copy to copy2 | |
96 index 72e1fe3..b53c148 100644 | |
97 --- a/rename | |
98 +++ b/copy2 | |
99 @@ -1,5 +1,5 @@ | |
100 a | |
101 a | |
102 -a | |
103 +b | |
104 a | |
105 a | |
106 EOF | |
107 | |
108 hg cat copy2 | |
109 | |
110 echo % rename and modify | |
111 hg import -mrenamemod - <<EOF | |
112 diff --git a/copy2 b/rename2 | |
113 similarity index 80% | |
114 rename from copy2 | |
115 rename to rename2 | |
116 index b53c148..8f81e29 100644 | |
117 --- a/copy2 | |
118 +++ b/rename2 | |
119 @@ -1,5 +1,5 @@ | |
120 a | |
121 a | |
122 b | |
123 -a | |
124 +c | |
125 a | |
126 EOF | |
127 | |
128 hg locate copy2 | |
129 hg cat rename2 |