Show More
@@ -1,14 +1,8 b'' | |||
|
1 | Test bug regarding symlinks that showed up in hg 0.7 | |
|
2 | Author: Matthew Elder <sseses@gmail.com> | |
|
3 | ||
|
4 | 1 |
|
|
5 | 2 | |
|
6 | make and initialize repo | |
|
3 | == tests added in 0.7 == | |
|
7 | 4 | |
|
8 | $ hg init test; cd test; | |
|
9 | ||
|
10 | make a file and a symlink | |
|
11 | ||
|
5 | $ hg init test-symlinks-0.7; cd test-symlinks-0.7; | |
|
12 | 6 | $ touch foo; ln -s foo bar; |
|
13 | 7 | |
|
14 | 8 | import with addremove -- symlink walking should _not_ screwup. |
@@ -21,8 +15,6 b' commit -- the symlink should _not_ appea' | |||
|
21 | 15 | |
|
22 | 16 | $ hg commit -m 'initial' |
|
23 | 17 | |
|
24 | add a new file so hg will let me commit again | |
|
25 | ||
|
26 | 18 | $ touch bomb |
|
27 | 19 | |
|
28 | 20 | again, symlink should _not_ show up on dir state |
@@ -33,8 +25,11 b' again, symlink should _not_ show up on d' | |||
|
33 | 25 | Assert screamed here before, should go by without consequence |
|
34 | 26 | |
|
35 | 27 | $ hg commit -m 'is there a bug?' |
|
28 | $ cd .. | |
|
36 | 29 | |
|
37 | $ cd .. ; rm -r test | |
|
30 | ||
|
31 | == fifo & ignore == | |
|
32 | ||
|
38 | 33 | $ hg init test; cd test; |
|
39 | 34 | |
|
40 | 35 | $ mkdir dir |
@@ -64,10 +59,13 b' it should show a.c, dir/a.o and dir/b.o ' | |||
|
64 | 59 | $ hg status a.c |
|
65 | 60 | a.c: unsupported file type (type is fifo) |
|
66 | 61 | ! a.c |
|
62 | $ cd .. | |
|
63 | ||
|
64 | ||
|
65 | == symlinks from outside the tree == | |
|
67 | 66 | |
|
68 | 67 | test absolute path through symlink outside repo |
|
69 | 68 | |
|
70 | $ cd .. | |
|
71 | 69 | $ p=`pwd` |
|
72 | 70 | $ hg init x |
|
73 | 71 | $ ln -s x y |
@@ -85,9 +83,11 b' this should fail' | |||
|
85 | 83 | |
|
86 | 84 | $ hg status ../z && { echo hg mistakenly exited with status 0; exit 1; } || : |
|
87 | 85 | abort: ../z not under root |
|
86 | $ cd .. | |
|
88 | 87 | |
|
89 | $ cd .. ; rm -r test | |
|
90 | $ hg init test; cd test; | |
|
88 | ||
|
89 | == cloning symlinks == | |
|
90 | $ hg init clone; cd clone; | |
|
91 | 91 | |
|
92 | 92 | try cloning symlink in a subdir |
|
93 | 93 | 1. commit a symlink |
@@ -104,13 +104,16 b' 1. commit a symlink' | |||
|
104 | 104 | 2. clone it |
|
105 | 105 | |
|
106 | 106 | $ cd .. |
|
107 |
$ hg clone |
|
|
107 | $ hg clone clone clonedest | |
|
108 | 108 | updating to branch default |
|
109 | 109 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | |
|
111 | ||
|
112 | == symlink and git diffs == | |
|
113 | ||
|
111 | 114 |
|
|
112 | 115 | |
|
113 |
$ cd |
|
|
116 | $ cd clonedest | |
|
114 | 117 | $ hg diff --git -r null:tip |
|
115 | 118 | diff --git a/a/b/c/demo b/a/b/c/demo |
|
116 | 119 | new file mode 120000 |
@@ -135,3 +138,116 b' import git symlink diff' | |||
|
135 | 138 | @@ -0,0 +1,1 @@ |
|
136 | 139 | +/path/to/symlink/source |
|
137 | 140 | \ No newline at end of file |
|
141 | ||
|
142 | == symlinks and addremove == | |
|
143 | ||
|
144 | directory moved and symlinked | |
|
145 | ||
|
146 | $ mkdir foo | |
|
147 | $ touch foo/a | |
|
148 | $ hg ci -Ama | |
|
149 | adding foo/a | |
|
150 | $ mv foo bar | |
|
151 | $ ln -s bar foo | |
|
152 | ||
|
153 | now addremove should remove old files | |
|
154 | ||
|
155 | $ hg addremove | |
|
156 | adding bar/a | |
|
157 | adding foo | |
|
158 | removing foo/a | |
|
159 | $ cd .. | |
|
160 | ||
|
161 | == root of repository is symlinked == | |
|
162 | ||
|
163 | $ hg init root | |
|
164 | $ ln -s root link | |
|
165 | $ cd root | |
|
166 | $ echo foo > foo | |
|
167 | $ hg status | |
|
168 | ? foo | |
|
169 | $ hg status ../link | |
|
170 | ? foo | |
|
171 | $ cd .. | |
|
172 | ||
|
173 | ||
|
174 | ||
|
175 | ||
|
176 | $ hg init b | |
|
177 | $ cd b | |
|
178 | $ ln -s nothing dangling | |
|
179 | $ hg commit -m 'commit symlink without adding' dangling | |
|
180 | abort: dangling: file not tracked! | |
|
181 | $ hg add dangling | |
|
182 | $ hg commit -m 'add symlink' | |
|
183 | ||
|
184 | $ hg tip -v | |
|
185 | changeset: 0:cabd88b706fc | |
|
186 | tag: tip | |
|
187 | user: test | |
|
188 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
189 | files: dangling | |
|
190 | description: | |
|
191 | add symlink | |
|
192 | ||
|
193 | ||
|
194 | $ hg manifest --debug | |
|
195 | 2564acbe54bbbedfbf608479340b359f04597f80 644 @ dangling | |
|
196 | $ $TESTDIR/readlink.py dangling | |
|
197 | dangling -> nothing | |
|
198 | ||
|
199 | $ rm dangling | |
|
200 | $ ln -s void dangling | |
|
201 | $ hg commit -m 'change symlink' | |
|
202 | $ $TESTDIR/readlink.py dangling | |
|
203 | dangling -> void | |
|
204 | ||
|
205 | ||
|
206 | modifying link | |
|
207 | ||
|
208 | $ rm dangling | |
|
209 | $ ln -s empty dangling | |
|
210 | $ $TESTDIR/readlink.py dangling | |
|
211 | dangling -> empty | |
|
212 | ||
|
213 | ||
|
214 | reverting to rev 0: | |
|
215 | ||
|
216 | $ hg revert -r 0 -a | |
|
217 | reverting dangling | |
|
218 | $ $TESTDIR/readlink.py dangling | |
|
219 | dangling -> nothing | |
|
220 | ||
|
221 | ||
|
222 | backups: | |
|
223 | ||
|
224 | $ $TESTDIR/readlink.py *.orig | |
|
225 | dangling.orig -> empty | |
|
226 | $ rm *.orig | |
|
227 | $ hg up -C | |
|
228 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
229 | ||
|
230 | copies | |
|
231 | ||
|
232 | $ hg cp -v dangling dangling2 | |
|
233 | copying dangling to dangling2 | |
|
234 | $ hg st -Cmard | |
|
235 | A dangling2 | |
|
236 | dangling | |
|
237 | $ $TESTDIR/readlink.py dangling dangling2 | |
|
238 | dangling -> void | |
|
239 | dangling2 -> void | |
|
240 | ||
|
241 | ||
|
242 | issue995 | |
|
243 | ||
|
244 | $ hg up -C | |
|
245 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
246 | $ mkdir dir | |
|
247 | $ ln -s dir dirlink | |
|
248 | $ hg ci -qAm 'add dirlink' | |
|
249 | $ mkdir newdir | |
|
250 | $ mv dir newdir/dir | |
|
251 | $ mv dirlink newdir/dirlink | |
|
252 | $ hg mv -A dirlink newdir/dirlink | |
|
253 |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now