##// END OF EJS Templates
test-hardlinks: add testcase for repo copied with 'cp -al'...
Adrian Buehlmann -
r13019:42ac864e default
parent child Browse files
Show More
@@ -10,6 +10,19 b''
10 > find $1 -type f | python $TESTTMP/nlinks.py
10 > find $1 -type f | python $TESTTMP/nlinks.py
11 > }
11 > }
12
12
13 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
14
15 $ cat > linkcp.py <<EOF
16 > from mercurial import util
17 > import sys
18 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
19 > EOF
20
21 $ linkcp()
22 > {
23 > python $TESTTMP/linkcp.py $1 $2
24 > }
25
13 Prepare repo r1:
26 Prepare repo r1:
14
27
15 $ mkdir r1
28 $ mkdir r1
@@ -152,3 +165,68 b' Committing a change to f1 in r1 must bre'
152 1 r2/.hg/store/data/f1.i
165 1 r2/.hg/store/data/f1.i
153 1 r2/.hg/store/fncache
166 1 r2/.hg/store/fncache
154
167
168
169 $ cd r3
170 $ hg tip --template '{rev}:{node|short}\n'
171 11:a6451b6bc41f
172 $ echo bla > f1
173 $ hg ci -m1
174 $ cd ..
175
176 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
177
178 $ linkcp r3 r4
179
180 r4 has hardlinks in the working dir (not just inside .hg):
181
182 $ nlinksdir r4
183 2 r4/.hg/00changelog.i
184 2 r4/.hg/branch
185 2 r4/.hg/branchheads.cache
186 2 r4/.hg/dirstate
187 2 r4/.hg/hgrc
188 2 r4/.hg/last-message.txt
189 2 r4/.hg/requires
190 2 r4/.hg/store/00changelog.i
191 2 r4/.hg/store/00manifest.i
192 2 r4/.hg/store/data/d1/f2.d
193 2 r4/.hg/store/data/d1/f2.i
194 2 r4/.hg/store/data/f1.i
195 2 r4/.hg/store/fncache
196 2 r4/.hg/store/undo
197 2 r4/.hg/tags.cache
198 2 r4/.hg/undo.branch
199 2 r4/.hg/undo.desc
200 2 r4/.hg/undo.dirstate
201 2 r4/d1/data1
202 2 r4/d1/f2
203 2 r4/f1
204
205 Update back to revision 11 in r4 should break hardlink of file f1:
206
207 $ hg -R r4 up 11
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209
210 $ nlinksdir r4
211 2 r4/.hg/00changelog.i
212 1 r4/.hg/branch
213 2 r4/.hg/branchheads.cache
214 1 r4/.hg/dirstate
215 2 r4/.hg/hgrc
216 2 r4/.hg/last-message.txt
217 2 r4/.hg/requires
218 2 r4/.hg/store/00changelog.i
219 2 r4/.hg/store/00manifest.i
220 2 r4/.hg/store/data/d1/f2.d
221 2 r4/.hg/store/data/d1/f2.i
222 2 r4/.hg/store/data/f1.i
223 2 r4/.hg/store/fncache
224 2 r4/.hg/store/undo
225 2 r4/.hg/tags.cache
226 2 r4/.hg/undo.branch
227 2 r4/.hg/undo.desc
228 2 r4/.hg/undo.dirstate
229 2 r4/d1/data1
230 2 r4/d1/f2
231 1 r4/f1
232
General Comments 0
You need to be logged in to leave comments. Login now