##// END OF EJS Templates
py3: convert filename to bytes in test-hardlinks.t...
Matt Harbison -
r40904:f79659e1 default
parent child Browse files
Show More
@@ -1,432 +1,432 b''
1 #require hardlink reporevlogstore
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > from __future__ import print_function
4 > from __future__ import print_function
5 > import sys
5 > import sys
6 > from mercurial import util
6 > from mercurial import pycompat, util
7 > for f in sorted(sys.stdin.readlines()):
7 > for f in sorted(sys.stdin.readlines()):
8 > f = f[:-1]
8 > f = f[:-1]
9 > print(util.nlinks(f), f)
9 > print(util.nlinks(pycompat.fsencode(f)), f)
10 > EOF
10 > EOF
11
11
12 $ nlinksdir()
12 $ nlinksdir()
13 > {
13 > {
14 > find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
14 > find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
15 > }
15 > }
16
16
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
18
18
19 $ cat > linkcp.py <<EOF
19 $ cat > linkcp.py <<EOF
20 > from __future__ import absolute_import
20 > from __future__ import absolute_import
21 > import sys
21 > import sys
22 > from mercurial import pycompat, util
22 > from mercurial import pycompat, util
23 > util.copyfiles(pycompat.fsencode(sys.argv[1]),
23 > util.copyfiles(pycompat.fsencode(sys.argv[1]),
24 > pycompat.fsencode(sys.argv[2]), hardlink=True)
24 > pycompat.fsencode(sys.argv[2]), hardlink=True)
25 > EOF
25 > EOF
26
26
27 $ linkcp()
27 $ linkcp()
28 > {
28 > {
29 > "$PYTHON" $TESTTMP/linkcp.py $1 $2
29 > "$PYTHON" $TESTTMP/linkcp.py $1 $2
30 > }
30 > }
31
31
32 Prepare repo r1:
32 Prepare repo r1:
33
33
34 $ hg init r1
34 $ hg init r1
35 $ cd r1
35 $ cd r1
36
36
37 $ echo c1 > f1
37 $ echo c1 > f1
38 $ hg add f1
38 $ hg add f1
39 $ hg ci -m0
39 $ hg ci -m0
40
40
41 $ mkdir d1
41 $ mkdir d1
42 $ cd d1
42 $ cd d1
43 $ echo c2 > f2
43 $ echo c2 > f2
44 $ hg add f2
44 $ hg add f2
45 $ hg ci -m1
45 $ hg ci -m1
46 $ cd ../..
46 $ cd ../..
47
47
48 $ nlinksdir r1/.hg/store
48 $ nlinksdir r1/.hg/store
49 1 r1/.hg/store/00changelog.i
49 1 r1/.hg/store/00changelog.i
50 1 r1/.hg/store/00manifest.i
50 1 r1/.hg/store/00manifest.i
51 1 r1/.hg/store/data/d1/f2.i
51 1 r1/.hg/store/data/d1/f2.i
52 1 r1/.hg/store/data/f1.i
52 1 r1/.hg/store/data/f1.i
53 1 r1/.hg/store/fncache (repofncache !)
53 1 r1/.hg/store/fncache (repofncache !)
54 1 r1/.hg/store/phaseroots
54 1 r1/.hg/store/phaseroots
55 1 r1/.hg/store/undo
55 1 r1/.hg/store/undo
56 1 r1/.hg/store/undo.backup.fncache (repofncache !)
56 1 r1/.hg/store/undo.backup.fncache (repofncache !)
57 1 r1/.hg/store/undo.backupfiles
57 1 r1/.hg/store/undo.backupfiles
58 1 r1/.hg/store/undo.phaseroots
58 1 r1/.hg/store/undo.phaseroots
59
59
60
60
61 Create hardlinked clone r2:
61 Create hardlinked clone r2:
62
62
63 $ hg clone -U --debug r1 r2 --config progress.debug=true
63 $ hg clone -U --debug r1 r2 --config progress.debug=true
64 linking: 1 files
64 linking: 1 files
65 linking: 2 files
65 linking: 2 files
66 linking: 3 files
66 linking: 3 files
67 linking: 4 files
67 linking: 4 files
68 linking: 5 files
68 linking: 5 files
69 linking: 6 files
69 linking: 6 files
70 linking: 7 files
70 linking: 7 files
71 linked 7 files
71 linked 7 files
72
72
73 Create non-hardlinked clone r3:
73 Create non-hardlinked clone r3:
74
74
75 $ hg clone --pull r1 r3
75 $ hg clone --pull r1 r3
76 requesting all changes
76 requesting all changes
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 2 changesets with 2 changes to 2 files
80 added 2 changesets with 2 changes to 2 files
81 new changesets 40d85e9847f2:7069c422939c
81 new changesets 40d85e9847f2:7069c422939c
82 updating to branch default
82 updating to branch default
83 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
84
84
85
85
86 Repos r1 and r2 should now contain hardlinked files:
86 Repos r1 and r2 should now contain hardlinked files:
87
87
88 $ nlinksdir r1/.hg/store
88 $ nlinksdir r1/.hg/store
89 2 r1/.hg/store/00changelog.i
89 2 r1/.hg/store/00changelog.i
90 2 r1/.hg/store/00manifest.i
90 2 r1/.hg/store/00manifest.i
91 2 r1/.hg/store/data/d1/f2.i
91 2 r1/.hg/store/data/d1/f2.i
92 2 r1/.hg/store/data/f1.i
92 2 r1/.hg/store/data/f1.i
93 2 r1/.hg/store/fncache (repofncache !)
93 2 r1/.hg/store/fncache (repofncache !)
94 1 r1/.hg/store/phaseroots
94 1 r1/.hg/store/phaseroots
95 1 r1/.hg/store/undo
95 1 r1/.hg/store/undo
96 1 r1/.hg/store/undo.backup.fncache (repofncache !)
96 1 r1/.hg/store/undo.backup.fncache (repofncache !)
97 1 r1/.hg/store/undo.backupfiles
97 1 r1/.hg/store/undo.backupfiles
98 1 r1/.hg/store/undo.phaseroots
98 1 r1/.hg/store/undo.phaseroots
99
99
100 $ nlinksdir r2/.hg/store
100 $ nlinksdir r2/.hg/store
101 2 r2/.hg/store/00changelog.i
101 2 r2/.hg/store/00changelog.i
102 2 r2/.hg/store/00manifest.i
102 2 r2/.hg/store/00manifest.i
103 2 r2/.hg/store/data/d1/f2.i
103 2 r2/.hg/store/data/d1/f2.i
104 2 r2/.hg/store/data/f1.i
104 2 r2/.hg/store/data/f1.i
105 2 r2/.hg/store/fncache (repofncache !)
105 2 r2/.hg/store/fncache (repofncache !)
106
106
107 Repo r3 should not be hardlinked:
107 Repo r3 should not be hardlinked:
108
108
109 $ nlinksdir r3/.hg/store
109 $ nlinksdir r3/.hg/store
110 1 r3/.hg/store/00changelog.i
110 1 r3/.hg/store/00changelog.i
111 1 r3/.hg/store/00manifest.i
111 1 r3/.hg/store/00manifest.i
112 1 r3/.hg/store/data/d1/f2.i
112 1 r3/.hg/store/data/d1/f2.i
113 1 r3/.hg/store/data/f1.i
113 1 r3/.hg/store/data/f1.i
114 1 r3/.hg/store/fncache (repofncache !)
114 1 r3/.hg/store/fncache (repofncache !)
115 1 r3/.hg/store/phaseroots
115 1 r3/.hg/store/phaseroots
116 1 r3/.hg/store/undo
116 1 r3/.hg/store/undo
117 1 r3/.hg/store/undo.backupfiles
117 1 r3/.hg/store/undo.backupfiles
118 1 r3/.hg/store/undo.phaseroots
118 1 r3/.hg/store/undo.phaseroots
119
119
120
120
121 Create a non-inlined filelog in r3:
121 Create a non-inlined filelog in r3:
122
122
123 $ cd r3/d1
123 $ cd r3/d1
124 >>> f = open('data1', 'wb')
124 >>> f = open('data1', 'wb')
125 >>> for x in range(10000):
125 >>> for x in range(10000):
126 ... f.write(b"%d\n" % x) and None
126 ... f.write(b"%d\n" % x) and None
127 >>> f.close()
127 >>> f.close()
128 $ for j in 0 1 2 3 4 5 6 7 8 9; do
128 $ for j in 0 1 2 3 4 5 6 7 8 9; do
129 > cat data1 >> f2
129 > cat data1 >> f2
130 > hg commit -m$j
130 > hg commit -m$j
131 > done
131 > done
132 $ cd ../..
132 $ cd ../..
133
133
134 $ nlinksdir r3/.hg/store
134 $ nlinksdir r3/.hg/store
135 1 r3/.hg/store/00changelog.i
135 1 r3/.hg/store/00changelog.i
136 1 r3/.hg/store/00manifest.i
136 1 r3/.hg/store/00manifest.i
137 1 r3/.hg/store/data/d1/f2.d
137 1 r3/.hg/store/data/d1/f2.d
138 1 r3/.hg/store/data/d1/f2.i
138 1 r3/.hg/store/data/d1/f2.i
139 1 r3/.hg/store/data/f1.i
139 1 r3/.hg/store/data/f1.i
140 1 r3/.hg/store/fncache (repofncache !)
140 1 r3/.hg/store/fncache (repofncache !)
141 1 r3/.hg/store/phaseroots
141 1 r3/.hg/store/phaseroots
142 1 r3/.hg/store/undo
142 1 r3/.hg/store/undo
143 1 r3/.hg/store/undo.backup.fncache (repofncache !)
143 1 r3/.hg/store/undo.backup.fncache (repofncache !)
144 1 r3/.hg/store/undo.backup.phaseroots
144 1 r3/.hg/store/undo.backup.phaseroots
145 1 r3/.hg/store/undo.backupfiles
145 1 r3/.hg/store/undo.backupfiles
146 1 r3/.hg/store/undo.phaseroots
146 1 r3/.hg/store/undo.phaseroots
147
147
148 Push to repo r1 should break up most hardlinks in r2:
148 Push to repo r1 should break up most hardlinks in r2:
149
149
150 $ hg -R r2 verify
150 $ hg -R r2 verify
151 checking changesets
151 checking changesets
152 checking manifests
152 checking manifests
153 crosschecking files in changesets and manifests
153 crosschecking files in changesets and manifests
154 checking files
154 checking files
155 checked 2 changesets with 2 changes to 2 files
155 checked 2 changesets with 2 changes to 2 files
156
156
157 $ cd r3
157 $ cd r3
158 $ hg push
158 $ hg push
159 pushing to $TESTTMP/r1
159 pushing to $TESTTMP/r1
160 searching for changes
160 searching for changes
161 adding changesets
161 adding changesets
162 adding manifests
162 adding manifests
163 adding file changes
163 adding file changes
164 added 10 changesets with 10 changes to 1 files
164 added 10 changesets with 10 changes to 1 files
165
165
166 $ cd ..
166 $ cd ..
167
167
168 $ nlinksdir r2/.hg/store
168 $ nlinksdir r2/.hg/store
169 1 r2/.hg/store/00changelog.i
169 1 r2/.hg/store/00changelog.i
170 1 r2/.hg/store/00manifest.i
170 1 r2/.hg/store/00manifest.i
171 1 r2/.hg/store/data/d1/f2.i
171 1 r2/.hg/store/data/d1/f2.i
172 2 r2/.hg/store/data/f1.i
172 2 r2/.hg/store/data/f1.i
173 [12] r2/\.hg/store/fncache (re) (repofncache !)
173 [12] r2/\.hg/store/fncache (re) (repofncache !)
174
174
175 #if hardlink-whitelisted repofncache
175 #if hardlink-whitelisted repofncache
176 $ nlinksdir r2/.hg/store/fncache
176 $ nlinksdir r2/.hg/store/fncache
177 2 r2/.hg/store/fncache
177 2 r2/.hg/store/fncache
178 #endif
178 #endif
179
179
180 $ hg -R r2 verify
180 $ hg -R r2 verify
181 checking changesets
181 checking changesets
182 checking manifests
182 checking manifests
183 crosschecking files in changesets and manifests
183 crosschecking files in changesets and manifests
184 checking files
184 checking files
185 checked 2 changesets with 2 changes to 2 files
185 checked 2 changesets with 2 changes to 2 files
186
186
187
187
188 $ cd r1
188 $ cd r1
189 $ hg up
189 $ hg up
190 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191
191
192 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
192 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
193
193
194 $ echo c1c1 >> f1
194 $ echo c1c1 >> f1
195 $ hg ci -m00
195 $ hg ci -m00
196 $ cd ..
196 $ cd ..
197
197
198 $ nlinksdir r2/.hg/store
198 $ nlinksdir r2/.hg/store
199 1 r2/.hg/store/00changelog.i
199 1 r2/.hg/store/00changelog.i
200 1 r2/.hg/store/00manifest.i
200 1 r2/.hg/store/00manifest.i
201 1 r2/.hg/store/data/d1/f2.i
201 1 r2/.hg/store/data/d1/f2.i
202 1 r2/.hg/store/data/f1.i
202 1 r2/.hg/store/data/f1.i
203 [12] r2/\.hg/store/fncache (re) (repofncache !)
203 [12] r2/\.hg/store/fncache (re) (repofncache !)
204
204
205 #if hardlink-whitelisted repofncache
205 #if hardlink-whitelisted repofncache
206 $ nlinksdir r2/.hg/store/fncache
206 $ nlinksdir r2/.hg/store/fncache
207 2 r2/.hg/store/fncache
207 2 r2/.hg/store/fncache
208 #endif
208 #endif
209
209
210 Create a file which exec permissions we will change
210 Create a file which exec permissions we will change
211 $ cd r3
211 $ cd r3
212 $ echo "echo hello world" > f3
212 $ echo "echo hello world" > f3
213 $ hg add f3
213 $ hg add f3
214 $ hg ci -mf3
214 $ hg ci -mf3
215 $ cd ..
215 $ cd ..
216
216
217 $ cd r3
217 $ cd r3
218 $ hg tip --template '{rev}:{node|short}\n'
218 $ hg tip --template '{rev}:{node|short}\n'
219 12:d3b77733a28a
219 12:d3b77733a28a
220 $ echo bla > f1
220 $ echo bla > f1
221 $ chmod +x f3
221 $ chmod +x f3
222 $ hg ci -m1
222 $ hg ci -m1
223 $ cd ..
223 $ cd ..
224
224
225 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
225 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
226
226
227 $ linkcp r3 r4
227 $ linkcp r3 r4
228
228
229 'checklink' is produced by hardlinking a symlink, which is undefined whether
229 'checklink' is produced by hardlinking a symlink, which is undefined whether
230 the symlink should be followed or not. It does behave differently on Linux and
230 the symlink should be followed or not. It does behave differently on Linux and
231 BSD. Just remove it so the test pass on both platforms.
231 BSD. Just remove it so the test pass on both platforms.
232
232
233 $ rm -f r4/.hg/wcache/checklink
233 $ rm -f r4/.hg/wcache/checklink
234
234
235 r4 has hardlinks in the working dir (not just inside .hg):
235 r4 has hardlinks in the working dir (not just inside .hg):
236
236
237 $ nlinksdir r4
237 $ nlinksdir r4
238 2 r4/.hg/00changelog.i
238 2 r4/.hg/00changelog.i
239 2 r4/.hg/branch
239 2 r4/.hg/branch
240 2 r4/.hg/cache/branch2-base
240 2 r4/.hg/cache/branch2-base
241 2 r4/.hg/cache/branch2-served
241 2 r4/.hg/cache/branch2-served
242 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
242 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
243 2 r4/.hg/cache/rbc-names-v1
243 2 r4/.hg/cache/rbc-names-v1
244 2 r4/.hg/cache/rbc-revs-v1
244 2 r4/.hg/cache/rbc-revs-v1
245 2 r4/.hg/dirstate
245 2 r4/.hg/dirstate
246 2 r4/.hg/fsmonitor.state (fsmonitor !)
246 2 r4/.hg/fsmonitor.state (fsmonitor !)
247 2 r4/.hg/hgrc
247 2 r4/.hg/hgrc
248 2 r4/.hg/last-message.txt
248 2 r4/.hg/last-message.txt
249 2 r4/.hg/requires
249 2 r4/.hg/requires
250 2 r4/.hg/store/00changelog.i
250 2 r4/.hg/store/00changelog.i
251 2 r4/.hg/store/00manifest.i
251 2 r4/.hg/store/00manifest.i
252 2 r4/.hg/store/data/d1/f2.d
252 2 r4/.hg/store/data/d1/f2.d
253 2 r4/.hg/store/data/d1/f2.i
253 2 r4/.hg/store/data/d1/f2.i
254 2 r4/.hg/store/data/f1.i
254 2 r4/.hg/store/data/f1.i
255 2 r4/.hg/store/data/f3.i
255 2 r4/.hg/store/data/f3.i
256 2 r4/.hg/store/fncache (repofncache !)
256 2 r4/.hg/store/fncache (repofncache !)
257 2 r4/.hg/store/phaseroots
257 2 r4/.hg/store/phaseroots
258 2 r4/.hg/store/undo
258 2 r4/.hg/store/undo
259 2 r4/.hg/store/undo.backup.fncache (repofncache !)
259 2 r4/.hg/store/undo.backup.fncache (repofncache !)
260 2 r4/.hg/store/undo.backup.phaseroots
260 2 r4/.hg/store/undo.backup.phaseroots
261 2 r4/.hg/store/undo.backupfiles
261 2 r4/.hg/store/undo.backupfiles
262 2 r4/.hg/store/undo.phaseroots
262 2 r4/.hg/store/undo.phaseroots
263 [24] r4/\.hg/undo\.backup\.dirstate (re)
263 [24] r4/\.hg/undo\.backup\.dirstate (re)
264 2 r4/.hg/undo.bookmarks
264 2 r4/.hg/undo.bookmarks
265 2 r4/.hg/undo.branch
265 2 r4/.hg/undo.branch
266 2 r4/.hg/undo.desc
266 2 r4/.hg/undo.desc
267 [24] r4/\.hg/undo\.dirstate (re)
267 [24] r4/\.hg/undo\.dirstate (re)
268 2 r4/.hg/wcache/checkisexec (execbit !)
268 2 r4/.hg/wcache/checkisexec (execbit !)
269 2 r4/.hg/wcache/checklink-target (symlink !)
269 2 r4/.hg/wcache/checklink-target (symlink !)
270 2 r4/.hg/wcache/checknoexec (execbit !)
270 2 r4/.hg/wcache/checknoexec (execbit !)
271 2 r4/d1/data1
271 2 r4/d1/data1
272 2 r4/d1/f2
272 2 r4/d1/f2
273 2 r4/f1
273 2 r4/f1
274 2 r4/f3
274 2 r4/f3
275
275
276 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
276 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
277 #if hardlink-whitelisted
277 #if hardlink-whitelisted
278 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
278 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
279 4 r4/.hg/undo.backup.dirstate
279 4 r4/.hg/undo.backup.dirstate
280 4 r4/.hg/undo.dirstate
280 4 r4/.hg/undo.dirstate
281 #endif
281 #endif
282
282
283
283
284 $ hg -R r4 up 12
284 $ hg -R r4 up 12
285 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
285 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
287
287
288 $ nlinksdir r4
288 $ nlinksdir r4
289 2 r4/.hg/00changelog.i
289 2 r4/.hg/00changelog.i
290 1 r4/.hg/branch
290 1 r4/.hg/branch
291 2 r4/.hg/cache/branch2-base
291 2 r4/.hg/cache/branch2-base
292 2 r4/.hg/cache/branch2-served
292 2 r4/.hg/cache/branch2-served
293 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
293 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
294 2 r4/.hg/cache/rbc-names-v1
294 2 r4/.hg/cache/rbc-names-v1
295 2 r4/.hg/cache/rbc-revs-v1
295 2 r4/.hg/cache/rbc-revs-v1
296 1 r4/.hg/dirstate
296 1 r4/.hg/dirstate
297 1 r4/.hg/fsmonitor.state (fsmonitor !)
297 1 r4/.hg/fsmonitor.state (fsmonitor !)
298 2 r4/.hg/hgrc
298 2 r4/.hg/hgrc
299 2 r4/.hg/last-message.txt
299 2 r4/.hg/last-message.txt
300 2 r4/.hg/requires
300 2 r4/.hg/requires
301 2 r4/.hg/store/00changelog.i
301 2 r4/.hg/store/00changelog.i
302 2 r4/.hg/store/00manifest.i
302 2 r4/.hg/store/00manifest.i
303 2 r4/.hg/store/data/d1/f2.d
303 2 r4/.hg/store/data/d1/f2.d
304 2 r4/.hg/store/data/d1/f2.i
304 2 r4/.hg/store/data/d1/f2.i
305 2 r4/.hg/store/data/f1.i
305 2 r4/.hg/store/data/f1.i
306 2 r4/.hg/store/data/f3.i
306 2 r4/.hg/store/data/f3.i
307 2 r4/.hg/store/fncache
307 2 r4/.hg/store/fncache
308 2 r4/.hg/store/phaseroots
308 2 r4/.hg/store/phaseroots
309 2 r4/.hg/store/undo
309 2 r4/.hg/store/undo
310 2 r4/.hg/store/undo.backup.fncache (repofncache !)
310 2 r4/.hg/store/undo.backup.fncache (repofncache !)
311 2 r4/.hg/store/undo.backup.phaseroots
311 2 r4/.hg/store/undo.backup.phaseroots
312 2 r4/.hg/store/undo.backupfiles
312 2 r4/.hg/store/undo.backupfiles
313 2 r4/.hg/store/undo.phaseroots
313 2 r4/.hg/store/undo.phaseroots
314 [24] r4/\.hg/undo\.backup\.dirstate (re)
314 [24] r4/\.hg/undo\.backup\.dirstate (re)
315 2 r4/.hg/undo.bookmarks
315 2 r4/.hg/undo.bookmarks
316 2 r4/.hg/undo.branch
316 2 r4/.hg/undo.branch
317 2 r4/.hg/undo.desc
317 2 r4/.hg/undo.desc
318 [24] r4/\.hg/undo\.dirstate (re)
318 [24] r4/\.hg/undo\.dirstate (re)
319 2 r4/.hg/wcache/checkisexec (execbit !)
319 2 r4/.hg/wcache/checkisexec (execbit !)
320 2 r4/.hg/wcache/checklink-target (symlink !)
320 2 r4/.hg/wcache/checklink-target (symlink !)
321 2 r4/.hg/wcache/checknoexec (execbit !)
321 2 r4/.hg/wcache/checknoexec (execbit !)
322 2 r4/d1/data1
322 2 r4/d1/data1
323 2 r4/d1/f2
323 2 r4/d1/f2
324 1 r4/f1
324 1 r4/f1
325 1 r4/f3 (execbit !)
325 1 r4/f3 (execbit !)
326 2 r4/f3 (no-execbit !)
326 2 r4/f3 (no-execbit !)
327
327
328 #if hardlink-whitelisted
328 #if hardlink-whitelisted
329 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
329 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
330 4 r4/.hg/undo.backup.dirstate
330 4 r4/.hg/undo.backup.dirstate
331 4 r4/.hg/undo.dirstate
331 4 r4/.hg/undo.dirstate
332 #endif
332 #endif
333
333
334 Test hardlinking outside hg:
334 Test hardlinking outside hg:
335
335
336 $ mkdir x
336 $ mkdir x
337 $ echo foo > x/a
337 $ echo foo > x/a
338
338
339 $ linkcp x y
339 $ linkcp x y
340 $ echo bar >> y/a
340 $ echo bar >> y/a
341
341
342 No diff if hardlink:
342 No diff if hardlink:
343
343
344 $ diff x/a y/a
344 $ diff x/a y/a
345
345
346 Test mq hardlinking:
346 Test mq hardlinking:
347
347
348 $ echo "[extensions]" >> $HGRCPATH
348 $ echo "[extensions]" >> $HGRCPATH
349 $ echo "mq=" >> $HGRCPATH
349 $ echo "mq=" >> $HGRCPATH
350
350
351 $ hg init a
351 $ hg init a
352 $ cd a
352 $ cd a
353
353
354 $ hg qimport -n foo - << EOF
354 $ hg qimport -n foo - << EOF
355 > # HG changeset patch
355 > # HG changeset patch
356 > # Date 1 0
356 > # Date 1 0
357 > diff -r 2588a8b53d66 a
357 > diff -r 2588a8b53d66 a
358 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
358 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
359 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
359 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
360 > @@ -0,0 +1,1 @@
360 > @@ -0,0 +1,1 @@
361 > +a
361 > +a
362 > EOF
362 > EOF
363 adding foo to series file
363 adding foo to series file
364
364
365 $ hg qpush
365 $ hg qpush
366 applying foo
366 applying foo
367 now at: foo
367 now at: foo
368
368
369 $ cd ..
369 $ cd ..
370 $ linkcp a b
370 $ linkcp a b
371 $ cd b
371 $ cd b
372
372
373 $ hg qimport -n bar - << EOF
373 $ hg qimport -n bar - << EOF
374 > # HG changeset patch
374 > # HG changeset patch
375 > # Date 2 0
375 > # Date 2 0
376 > diff -r 2588a8b53d66 a
376 > diff -r 2588a8b53d66 a
377 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
377 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
378 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
378 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
379 > @@ -0,0 +1,1 @@
379 > @@ -0,0 +1,1 @@
380 > +b
380 > +b
381 > EOF
381 > EOF
382 adding bar to series file
382 adding bar to series file
383
383
384 $ hg qpush
384 $ hg qpush
385 applying bar
385 applying bar
386 now at: bar
386 now at: bar
387
387
388 $ cat .hg/patches/status
388 $ cat .hg/patches/status
389 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
389 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
390 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
390 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
391
391
392 $ cat .hg/patches/series
392 $ cat .hg/patches/series
393 foo
393 foo
394 bar
394 bar
395
395
396 $ cat ../a/.hg/patches/status
396 $ cat ../a/.hg/patches/status
397 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
397 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
398
398
399 $ cat ../a/.hg/patches/series
399 $ cat ../a/.hg/patches/series
400 foo
400 foo
401
401
402 Test tags hardlinking:
402 Test tags hardlinking:
403
403
404 $ hg qdel -r qbase:qtip
404 $ hg qdel -r qbase:qtip
405 patch foo finalized without changeset message
405 patch foo finalized without changeset message
406 patch bar finalized without changeset message
406 patch bar finalized without changeset message
407
407
408 $ hg tag -l lfoo
408 $ hg tag -l lfoo
409 $ hg tag foo
409 $ hg tag foo
410
410
411 $ cd ..
411 $ cd ..
412 $ linkcp b c
412 $ linkcp b c
413 $ cd c
413 $ cd c
414
414
415 $ hg tag -l -r 0 lbar
415 $ hg tag -l -r 0 lbar
416 $ hg tag -r 0 bar
416 $ hg tag -r 0 bar
417
417
418 $ cat .hgtags
418 $ cat .hgtags
419 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
419 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
420 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
420 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
421
421
422 $ cat .hg/localtags
422 $ cat .hg/localtags
423 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
423 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
424 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
424 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
425
425
426 $ cat ../b/.hgtags
426 $ cat ../b/.hgtags
427 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
427 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
428
428
429 $ cat ../b/.hg/localtags
429 $ cat ../b/.hg/localtags
430 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
430 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
431
431
432 $ cd ..
432 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now