Show More
@@ -1,416 +1,410 b'' | |||||
1 | #require hardlink |
|
1 | #require hardlink | |
2 |
|
2 | |||
3 | $ cat > nlinks.py <<EOF |
|
3 | $ cat > nlinks.py <<EOF | |
4 | > import sys |
|
4 | > import sys | |
5 | > from mercurial import util |
|
5 | > from mercurial import util | |
6 | > for f in sorted(sys.stdin.readlines()): |
|
6 | > for f in sorted(sys.stdin.readlines()): | |
7 | > f = f[:-1] |
|
7 | > f = f[:-1] | |
8 | > print util.nlinks(f), f |
|
8 | > print util.nlinks(f), f | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | $ nlinksdir() |
|
11 | $ nlinksdir() | |
12 | > { |
|
12 | > { | |
13 | > find "$@" -type f | python $TESTTMP/nlinks.py |
|
13 | > find "$@" -type f | python $TESTTMP/nlinks.py | |
14 | > } |
|
14 | > } | |
15 |
|
15 | |||
16 | Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): |
|
16 | Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): | |
17 |
|
17 | |||
18 | $ cat > linkcp.py <<EOF |
|
18 | $ cat > linkcp.py <<EOF | |
19 | > from mercurial import util |
|
19 | > from mercurial import util | |
20 | > import sys |
|
20 | > import sys | |
21 | > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) |
|
21 | > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) | |
22 | > EOF |
|
22 | > EOF | |
23 |
|
23 | |||
24 | $ linkcp() |
|
24 | $ linkcp() | |
25 | > { |
|
25 | > { | |
26 | > python $TESTTMP/linkcp.py $1 $2 |
|
26 | > python $TESTTMP/linkcp.py $1 $2 | |
27 | > } |
|
27 | > } | |
28 |
|
28 | |||
29 | Prepare repo r1: |
|
29 | Prepare repo r1: | |
30 |
|
30 | |||
31 | $ hg init r1 |
|
31 | $ hg init r1 | |
32 | $ cd r1 |
|
32 | $ cd r1 | |
33 |
|
33 | |||
34 | $ echo c1 > f1 |
|
34 | $ echo c1 > f1 | |
35 | $ hg add f1 |
|
35 | $ hg add f1 | |
36 | $ hg ci -m0 |
|
36 | $ hg ci -m0 | |
37 |
|
37 | |||
38 | $ mkdir d1 |
|
38 | $ mkdir d1 | |
39 | $ cd d1 |
|
39 | $ cd d1 | |
40 | $ echo c2 > f2 |
|
40 | $ echo c2 > f2 | |
41 | $ hg add f2 |
|
41 | $ hg add f2 | |
42 | $ hg ci -m1 |
|
42 | $ hg ci -m1 | |
43 | $ cd ../.. |
|
43 | $ cd ../.. | |
44 |
|
44 | |||
45 | $ nlinksdir r1/.hg/store |
|
45 | $ nlinksdir r1/.hg/store | |
46 | 1 r1/.hg/store/00changelog.i |
|
46 | 1 r1/.hg/store/00changelog.i | |
47 | 1 r1/.hg/store/00manifest.i |
|
47 | 1 r1/.hg/store/00manifest.i | |
48 | 1 r1/.hg/store/data/d1/f2.i |
|
48 | 1 r1/.hg/store/data/d1/f2.i | |
49 | 1 r1/.hg/store/data/f1.i |
|
49 | 1 r1/.hg/store/data/f1.i | |
50 | 1 r1/.hg/store/fncache |
|
50 | 1 r1/.hg/store/fncache | |
51 | 1 r1/.hg/store/phaseroots |
|
51 | 1 r1/.hg/store/phaseroots | |
52 | 1 r1/.hg/store/undo |
|
52 | 1 r1/.hg/store/undo | |
53 | 1 r1/.hg/store/undo.backup.fncache |
|
53 | 1 r1/.hg/store/undo.backup.fncache | |
54 | 1 r1/.hg/store/undo.backupfiles |
|
54 | 1 r1/.hg/store/undo.backupfiles | |
55 | 1 r1/.hg/store/undo.phaseroots |
|
55 | 1 r1/.hg/store/undo.phaseroots | |
56 |
|
56 | |||
57 |
|
57 | |||
58 | Create hardlinked clone r2: |
|
58 | Create hardlinked clone r2: | |
59 |
|
59 | |||
60 | $ hg clone -U --debug r1 r2 --config progress.debug=true |
|
60 | $ hg clone -U --debug r1 r2 --config progress.debug=true | |
61 | linking: 1 |
|
61 | linking: 1 | |
62 | linking: 2 |
|
62 | linking: 2 | |
63 | linking: 3 |
|
63 | linking: 3 | |
64 | linking: 4 |
|
64 | linking: 4 | |
65 | linking: 5 |
|
65 | linking: 5 | |
66 | linking: 6 |
|
66 | linking: 6 | |
67 | linking: 7 |
|
67 | linking: 7 | |
68 | linked 7 files |
|
68 | linked 7 files | |
69 |
|
69 | |||
70 | Create non-hardlinked clone r3: |
|
70 | Create non-hardlinked clone r3: | |
71 |
|
71 | |||
72 | $ hg clone --pull r1 r3 |
|
72 | $ hg clone --pull r1 r3 | |
73 | requesting all changes |
|
73 | requesting all changes | |
74 | adding changesets |
|
74 | adding changesets | |
75 | adding manifests |
|
75 | adding manifests | |
76 | adding file changes |
|
76 | adding file changes | |
77 | added 2 changesets with 2 changes to 2 files |
|
77 | added 2 changesets with 2 changes to 2 files | |
78 | updating to branch default |
|
78 | updating to branch default | |
79 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
80 |
|
80 | |||
81 |
|
81 | |||
82 | Repos r1 and r2 should now contain hardlinked files: |
|
82 | Repos r1 and r2 should now contain hardlinked files: | |
83 |
|
83 | |||
84 | $ nlinksdir r1/.hg/store |
|
84 | $ nlinksdir r1/.hg/store | |
85 | 2 r1/.hg/store/00changelog.i |
|
85 | 2 r1/.hg/store/00changelog.i | |
86 | 2 r1/.hg/store/00manifest.i |
|
86 | 2 r1/.hg/store/00manifest.i | |
87 | 2 r1/.hg/store/data/d1/f2.i |
|
87 | 2 r1/.hg/store/data/d1/f2.i | |
88 | 2 r1/.hg/store/data/f1.i |
|
88 | 2 r1/.hg/store/data/f1.i | |
89 | 2 r1/.hg/store/fncache |
|
89 | 2 r1/.hg/store/fncache | |
90 | 1 r1/.hg/store/phaseroots |
|
90 | 1 r1/.hg/store/phaseroots | |
91 | 1 r1/.hg/store/undo |
|
91 | 1 r1/.hg/store/undo | |
92 | 1 r1/.hg/store/undo.backup.fncache |
|
92 | 1 r1/.hg/store/undo.backup.fncache | |
93 | 1 r1/.hg/store/undo.backupfiles |
|
93 | 1 r1/.hg/store/undo.backupfiles | |
94 | 1 r1/.hg/store/undo.phaseroots |
|
94 | 1 r1/.hg/store/undo.phaseroots | |
95 |
|
95 | |||
96 | $ nlinksdir r2/.hg/store |
|
96 | $ nlinksdir r2/.hg/store | |
97 | 2 r2/.hg/store/00changelog.i |
|
97 | 2 r2/.hg/store/00changelog.i | |
98 | 2 r2/.hg/store/00manifest.i |
|
98 | 2 r2/.hg/store/00manifest.i | |
99 | 2 r2/.hg/store/data/d1/f2.i |
|
99 | 2 r2/.hg/store/data/d1/f2.i | |
100 | 2 r2/.hg/store/data/f1.i |
|
100 | 2 r2/.hg/store/data/f1.i | |
101 | 2 r2/.hg/store/fncache |
|
101 | 2 r2/.hg/store/fncache | |
102 |
|
102 | |||
103 | Repo r3 should not be hardlinked: |
|
103 | Repo r3 should not be hardlinked: | |
104 |
|
104 | |||
105 | $ nlinksdir r3/.hg/store |
|
105 | $ nlinksdir r3/.hg/store | |
106 | 1 r3/.hg/store/00changelog.i |
|
106 | 1 r3/.hg/store/00changelog.i | |
107 | 1 r3/.hg/store/00manifest.i |
|
107 | 1 r3/.hg/store/00manifest.i | |
108 | 1 r3/.hg/store/data/d1/f2.i |
|
108 | 1 r3/.hg/store/data/d1/f2.i | |
109 | 1 r3/.hg/store/data/f1.i |
|
109 | 1 r3/.hg/store/data/f1.i | |
110 | 1 r3/.hg/store/fncache |
|
110 | 1 r3/.hg/store/fncache | |
111 | 1 r3/.hg/store/phaseroots |
|
111 | 1 r3/.hg/store/phaseroots | |
112 | 1 r3/.hg/store/undo |
|
112 | 1 r3/.hg/store/undo | |
113 | 1 r3/.hg/store/undo.backupfiles |
|
113 | 1 r3/.hg/store/undo.backupfiles | |
114 | 1 r3/.hg/store/undo.phaseroots |
|
114 | 1 r3/.hg/store/undo.phaseroots | |
115 |
|
115 | |||
116 |
|
116 | |||
117 | Create a non-inlined filelog in r3: |
|
117 | Create a non-inlined filelog in r3: | |
118 |
|
118 | |||
119 | $ cd r3/d1 |
|
119 | $ cd r3/d1 | |
120 | >>> f = open('data1', 'wb') |
|
120 | >>> f = open('data1', 'wb') | |
121 | >>> for x in range(10000): |
|
121 | >>> for x in range(10000): | |
122 | ... f.write("%s\n" % str(x)) |
|
122 | ... f.write("%s\n" % str(x)) | |
123 | >>> f.close() |
|
123 | >>> f.close() | |
124 | $ for j in 0 1 2 3 4 5 6 7 8 9; do |
|
124 | $ for j in 0 1 2 3 4 5 6 7 8 9; do | |
125 | > cat data1 >> f2 |
|
125 | > cat data1 >> f2 | |
126 | > hg commit -m$j |
|
126 | > hg commit -m$j | |
127 | > done |
|
127 | > done | |
128 | $ cd ../.. |
|
128 | $ cd ../.. | |
129 |
|
129 | |||
130 | $ nlinksdir r3/.hg/store |
|
130 | $ nlinksdir r3/.hg/store | |
131 | 1 r3/.hg/store/00changelog.i |
|
131 | 1 r3/.hg/store/00changelog.i | |
132 | 1 r3/.hg/store/00manifest.i |
|
132 | 1 r3/.hg/store/00manifest.i | |
133 | 1 r3/.hg/store/data/d1/f2.d |
|
133 | 1 r3/.hg/store/data/d1/f2.d | |
134 | 1 r3/.hg/store/data/d1/f2.i |
|
134 | 1 r3/.hg/store/data/d1/f2.i | |
135 | 1 r3/.hg/store/data/f1.i |
|
135 | 1 r3/.hg/store/data/f1.i | |
136 | 1 r3/.hg/store/fncache |
|
136 | 1 r3/.hg/store/fncache | |
137 | 1 r3/.hg/store/phaseroots |
|
137 | 1 r3/.hg/store/phaseroots | |
138 | 1 r3/.hg/store/undo |
|
138 | 1 r3/.hg/store/undo | |
139 | 1 r3/.hg/store/undo.backup.fncache |
|
139 | 1 r3/.hg/store/undo.backup.fncache | |
140 | 1 r3/.hg/store/undo.backup.phaseroots |
|
140 | 1 r3/.hg/store/undo.backup.phaseroots | |
141 | 1 r3/.hg/store/undo.backupfiles |
|
141 | 1 r3/.hg/store/undo.backupfiles | |
142 | 1 r3/.hg/store/undo.phaseroots |
|
142 | 1 r3/.hg/store/undo.phaseroots | |
143 |
|
143 | |||
144 | Push to repo r1 should break up most hardlinks in r2: |
|
144 | Push to repo r1 should break up most hardlinks in r2: | |
145 |
|
145 | |||
146 | $ hg -R r2 verify |
|
146 | $ hg -R r2 verify | |
147 | checking changesets |
|
147 | checking changesets | |
148 | checking manifests |
|
148 | checking manifests | |
149 | crosschecking files in changesets and manifests |
|
149 | crosschecking files in changesets and manifests | |
150 | checking files |
|
150 | checking files | |
151 | 2 files, 2 changesets, 2 total revisions |
|
151 | 2 files, 2 changesets, 2 total revisions | |
152 |
|
152 | |||
153 | $ cd r3 |
|
153 | $ cd r3 | |
154 | $ hg push |
|
154 | $ hg push | |
155 | pushing to $TESTTMP/r1 (glob) |
|
155 | pushing to $TESTTMP/r1 (glob) | |
156 | searching for changes |
|
156 | searching for changes | |
157 | adding changesets |
|
157 | adding changesets | |
158 | adding manifests |
|
158 | adding manifests | |
159 | adding file changes |
|
159 | adding file changes | |
160 | added 10 changesets with 10 changes to 1 files |
|
160 | added 10 changesets with 10 changes to 1 files | |
161 |
|
161 | |||
162 | $ cd .. |
|
162 | $ cd .. | |
163 |
|
163 | |||
164 | $ nlinksdir r2/.hg/store |
|
164 | $ nlinksdir r2/.hg/store | |
165 | 1 r2/.hg/store/00changelog.i |
|
165 | 1 r2/.hg/store/00changelog.i | |
166 | 1 r2/.hg/store/00manifest.i |
|
166 | 1 r2/.hg/store/00manifest.i | |
167 | 1 r2/.hg/store/data/d1/f2.i |
|
167 | 1 r2/.hg/store/data/d1/f2.i | |
168 | 2 r2/.hg/store/data/f1.i |
|
168 | 2 r2/.hg/store/data/f1.i | |
169 | [12] r2/\.hg/store/fncache (re) |
|
169 | [12] r2/\.hg/store/fncache (re) | |
170 |
|
170 | |||
171 | #if hardlink-whitelisted |
|
171 | #if hardlink-whitelisted | |
172 | $ nlinksdir r2/.hg/store/fncache |
|
172 | $ nlinksdir r2/.hg/store/fncache | |
173 | 2 r2/.hg/store/fncache |
|
173 | 2 r2/.hg/store/fncache | |
174 | #endif |
|
174 | #endif | |
175 |
|
175 | |||
176 | $ hg -R r2 verify |
|
176 | $ hg -R r2 verify | |
177 | checking changesets |
|
177 | checking changesets | |
178 | checking manifests |
|
178 | checking manifests | |
179 | crosschecking files in changesets and manifests |
|
179 | crosschecking files in changesets and manifests | |
180 | checking files |
|
180 | checking files | |
181 | 2 files, 2 changesets, 2 total revisions |
|
181 | 2 files, 2 changesets, 2 total revisions | |
182 |
|
182 | |||
183 |
|
183 | |||
184 | $ cd r1 |
|
184 | $ cd r1 | |
185 | $ hg up |
|
185 | $ hg up | |
186 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
186 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
187 |
|
187 | |||
188 | Committing a change to f1 in r1 must break up hardlink f1.i in r2: |
|
188 | Committing a change to f1 in r1 must break up hardlink f1.i in r2: | |
189 |
|
189 | |||
190 | $ echo c1c1 >> f1 |
|
190 | $ echo c1c1 >> f1 | |
191 | $ hg ci -m00 |
|
191 | $ hg ci -m00 | |
192 | $ cd .. |
|
192 | $ cd .. | |
193 |
|
193 | |||
194 | $ nlinksdir r2/.hg/store |
|
194 | $ nlinksdir r2/.hg/store | |
195 | 1 r2/.hg/store/00changelog.i |
|
195 | 1 r2/.hg/store/00changelog.i | |
196 | 1 r2/.hg/store/00manifest.i |
|
196 | 1 r2/.hg/store/00manifest.i | |
197 | 1 r2/.hg/store/data/d1/f2.i |
|
197 | 1 r2/.hg/store/data/d1/f2.i | |
198 | 1 r2/.hg/store/data/f1.i |
|
198 | 1 r2/.hg/store/data/f1.i | |
199 | [12] r2/\.hg/store/fncache (re) |
|
199 | [12] r2/\.hg/store/fncache (re) | |
200 |
|
200 | |||
201 | #if hardlink-whitelisted |
|
201 | #if hardlink-whitelisted | |
202 | $ nlinksdir r2/.hg/store/fncache |
|
202 | $ nlinksdir r2/.hg/store/fncache | |
203 | 2 r2/.hg/store/fncache |
|
203 | 2 r2/.hg/store/fncache | |
204 | #endif |
|
204 | #endif | |
205 |
|
205 | |||
206 | $ cd r3 |
|
206 | $ cd r3 | |
207 | $ hg tip --template '{rev}:{node|short}\n' |
|
207 | $ hg tip --template '{rev}:{node|short}\n' | |
208 | 11:a6451b6bc41f |
|
208 | 11:a6451b6bc41f | |
209 | $ echo bla > f1 |
|
209 | $ echo bla > f1 | |
210 | $ hg ci -m1 |
|
210 | $ hg ci -m1 | |
211 | $ cd .. |
|
211 | $ cd .. | |
212 |
|
212 | |||
213 | Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'): |
|
213 | Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'): | |
214 |
|
214 | |||
215 | $ linkcp r3 r4 |
|
215 | $ linkcp r3 r4 | |
216 |
|
216 | |||
217 | 'checklink' is produced by hardlinking a symlink, which is undefined whether |
|
217 | 'checklink' is produced by hardlinking a symlink, which is undefined whether | |
218 | the symlink should be followed or not. It does behave differently on Linux and |
|
218 | the symlink should be followed or not. It does behave differently on Linux and | |
219 | BSD. Just remove it so the test pass on both platforms. |
|
219 | BSD. Just remove it so the test pass on both platforms. | |
220 |
|
220 | |||
221 | $ rm -f r4/.hg/cache/checklink |
|
221 | $ rm -f r4/.hg/cache/checklink | |
222 |
|
222 | |||
223 | r4 has hardlinks in the working dir (not just inside .hg): |
|
223 | r4 has hardlinks in the working dir (not just inside .hg): | |
224 |
|
224 | |||
225 | $ nlinksdir r4 |
|
225 | $ nlinksdir r4 | |
226 | 2 r4/.hg/00changelog.i |
|
226 | 2 r4/.hg/00changelog.i | |
227 | 2 r4/.hg/branch |
|
227 | 2 r4/.hg/branch | |
|
228 | 2 r4/.hg/cache/branch2-base | |||
|
229 | 2 r4/.hg/cache/branch2-served | |||
228 | 2 r4/.hg/cache/checkisexec (execbit !) |
|
230 | 2 r4/.hg/cache/checkisexec (execbit !) | |
229 | ? r4/.hg/cache/checklink-target (glob) (symlink !) |
|
231 | ? r4/.hg/cache/checklink-target (glob) (symlink !) | |
230 | 2 r4/.hg/cache/checknoexec (execbit !) |
|
232 | 2 r4/.hg/cache/checknoexec (execbit !) | |
231 | 2 r4/.hg/cache/branch2-base |
|
|||
232 | 2 r4/.hg/cache/branch2-served |
|
|||
233 | 2 r4/.hg/cache/checkisexec |
|
|||
234 | 2 r4/.hg/cache/checklink-target |
|
|||
235 | 2 r4/.hg/cache/checknoexec |
|
|||
236 | 2 r4/.hg/cache/rbc-names-v1 |
|
233 | 2 r4/.hg/cache/rbc-names-v1 | |
237 | 2 r4/.hg/cache/rbc-revs-v1 |
|
234 | 2 r4/.hg/cache/rbc-revs-v1 | |
238 | 2 r4/.hg/dirstate |
|
235 | 2 r4/.hg/dirstate | |
239 | 2 r4/.hg/hgrc |
|
236 | 2 r4/.hg/hgrc | |
240 | 2 r4/.hg/last-message.txt |
|
237 | 2 r4/.hg/last-message.txt | |
241 | 2 r4/.hg/requires |
|
238 | 2 r4/.hg/requires | |
242 | 2 r4/.hg/store/00changelog.i |
|
239 | 2 r4/.hg/store/00changelog.i | |
243 | 2 r4/.hg/store/00manifest.i |
|
240 | 2 r4/.hg/store/00manifest.i | |
244 | 2 r4/.hg/store/data/d1/f2.d |
|
241 | 2 r4/.hg/store/data/d1/f2.d | |
245 | 2 r4/.hg/store/data/d1/f2.i |
|
242 | 2 r4/.hg/store/data/d1/f2.i | |
246 | 2 r4/.hg/store/data/f1.i |
|
243 | 2 r4/.hg/store/data/f1.i | |
247 | 2 r4/.hg/store/fncache |
|
244 | 2 r4/.hg/store/fncache | |
248 | 2 r4/.hg/store/phaseroots |
|
245 | 2 r4/.hg/store/phaseroots | |
249 | 2 r4/.hg/store/undo |
|
246 | 2 r4/.hg/store/undo | |
250 | 2 r4/.hg/store/undo.backup.fncache |
|
247 | 2 r4/.hg/store/undo.backup.fncache | |
251 | 2 r4/.hg/store/undo.backup.phaseroots |
|
248 | 2 r4/.hg/store/undo.backup.phaseroots | |
252 | 2 r4/.hg/store/undo.backupfiles |
|
249 | 2 r4/.hg/store/undo.backupfiles | |
253 | 2 r4/.hg/store/undo.phaseroots |
|
250 | 2 r4/.hg/store/undo.phaseroots | |
254 | [24] r4/\.hg/undo\.backup\.dirstate (re) |
|
251 | [24] r4/\.hg/undo\.backup\.dirstate (re) | |
255 | 2 r4/.hg/undo.bookmarks |
|
252 | 2 r4/.hg/undo.bookmarks | |
256 | 2 r4/.hg/undo.branch |
|
253 | 2 r4/.hg/undo.branch | |
257 | 2 r4/.hg/undo.desc |
|
254 | 2 r4/.hg/undo.desc | |
258 | [24] r4/\.hg/undo\.dirstate (re) |
|
255 | [24] r4/\.hg/undo\.dirstate (re) | |
259 | 2 r4/d1/data1 |
|
256 | 2 r4/d1/data1 | |
260 | 2 r4/d1/f2 |
|
257 | 2 r4/d1/f2 | |
261 | 2 r4/f1 |
|
258 | 2 r4/f1 | |
262 |
|
259 | |||
263 | #if hardlink-whitelisted |
|
260 | #if hardlink-whitelisted | |
264 | $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate |
|
261 | $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate | |
265 | 4 r4/.hg/undo.backup.dirstate |
|
262 | 4 r4/.hg/undo.backup.dirstate | |
266 | 4 r4/.hg/undo.dirstate |
|
263 | 4 r4/.hg/undo.dirstate | |
267 | #endif |
|
264 | #endif | |
268 |
|
265 | |||
269 | Update back to revision 11 in r4 should break hardlink of file f1: |
|
266 | Update back to revision 11 in r4 should break hardlink of file f1: | |
270 |
|
267 | |||
271 | $ hg -R r4 up 11 |
|
268 | $ hg -R r4 up 11 | |
272 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
269 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
273 |
|
270 | |||
274 | $ nlinksdir r4 |
|
271 | $ nlinksdir r4 | |
275 | 2 r4/.hg/00changelog.i |
|
272 | 2 r4/.hg/00changelog.i | |
276 | 1 r4/.hg/branch |
|
273 | 1 r4/.hg/branch | |
|
274 | 2 r4/.hg/cache/branch2-base | |||
|
275 | 2 r4/.hg/cache/branch2-served | |||
277 | 2 r4/.hg/cache/checkisexec (execbit !) |
|
276 | 2 r4/.hg/cache/checkisexec (execbit !) | |
278 | 2 r4/.hg/cache/checklink-target (symlink !) |
|
277 | 2 r4/.hg/cache/checklink-target (symlink !) | |
279 | 2 r4/.hg/cache/checknoexec (execbit !) |
|
278 | 2 r4/.hg/cache/checknoexec (execbit !) | |
280 | 2 r4/.hg/cache/branch2-base |
|
|||
281 | 2 r4/.hg/cache/branch2-served |
|
|||
282 | 2 r4/.hg/cache/checkisexec |
|
|||
283 | 2 r4/.hg/cache/checklink-target |
|
|||
284 | 2 r4/.hg/cache/checknoexec |
|
|||
285 | 2 r4/.hg/cache/rbc-names-v1 |
|
279 | 2 r4/.hg/cache/rbc-names-v1 | |
286 | 2 r4/.hg/cache/rbc-revs-v1 |
|
280 | 2 r4/.hg/cache/rbc-revs-v1 | |
287 | 1 r4/.hg/dirstate |
|
281 | 1 r4/.hg/dirstate | |
288 | 2 r4/.hg/hgrc |
|
282 | 2 r4/.hg/hgrc | |
289 | 2 r4/.hg/last-message.txt |
|
283 | 2 r4/.hg/last-message.txt | |
290 | 2 r4/.hg/requires |
|
284 | 2 r4/.hg/requires | |
291 | 2 r4/.hg/store/00changelog.i |
|
285 | 2 r4/.hg/store/00changelog.i | |
292 | 2 r4/.hg/store/00manifest.i |
|
286 | 2 r4/.hg/store/00manifest.i | |
293 | 2 r4/.hg/store/data/d1/f2.d |
|
287 | 2 r4/.hg/store/data/d1/f2.d | |
294 | 2 r4/.hg/store/data/d1/f2.i |
|
288 | 2 r4/.hg/store/data/d1/f2.i | |
295 | 2 r4/.hg/store/data/f1.i |
|
289 | 2 r4/.hg/store/data/f1.i | |
296 | 2 r4/.hg/store/fncache |
|
290 | 2 r4/.hg/store/fncache | |
297 | 2 r4/.hg/store/phaseroots |
|
291 | 2 r4/.hg/store/phaseroots | |
298 | 2 r4/.hg/store/undo |
|
292 | 2 r4/.hg/store/undo | |
299 | 2 r4/.hg/store/undo.backup.fncache |
|
293 | 2 r4/.hg/store/undo.backup.fncache | |
300 | 2 r4/.hg/store/undo.backup.phaseroots |
|
294 | 2 r4/.hg/store/undo.backup.phaseroots | |
301 | 2 r4/.hg/store/undo.backupfiles |
|
295 | 2 r4/.hg/store/undo.backupfiles | |
302 | 2 r4/.hg/store/undo.phaseroots |
|
296 | 2 r4/.hg/store/undo.phaseroots | |
303 | [24] r4/\.hg/undo\.backup\.dirstate (re) |
|
297 | [24] r4/\.hg/undo\.backup\.dirstate (re) | |
304 | 2 r4/.hg/undo.bookmarks |
|
298 | 2 r4/.hg/undo.bookmarks | |
305 | 2 r4/.hg/undo.branch |
|
299 | 2 r4/.hg/undo.branch | |
306 | 2 r4/.hg/undo.desc |
|
300 | 2 r4/.hg/undo.desc | |
307 | [24] r4/\.hg/undo\.dirstate (re) |
|
301 | [24] r4/\.hg/undo\.dirstate (re) | |
308 | 2 r4/d1/data1 |
|
302 | 2 r4/d1/data1 | |
309 | 2 r4/d1/f2 |
|
303 | 2 r4/d1/f2 | |
310 | 1 r4/f1 |
|
304 | 1 r4/f1 | |
311 |
|
305 | |||
312 | #if hardlink-whitelisted |
|
306 | #if hardlink-whitelisted | |
313 | $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate |
|
307 | $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate | |
314 | 4 r4/.hg/undo.backup.dirstate |
|
308 | 4 r4/.hg/undo.backup.dirstate | |
315 | 4 r4/.hg/undo.dirstate |
|
309 | 4 r4/.hg/undo.dirstate | |
316 | #endif |
|
310 | #endif | |
317 |
|
311 | |||
318 | Test hardlinking outside hg: |
|
312 | Test hardlinking outside hg: | |
319 |
|
313 | |||
320 | $ mkdir x |
|
314 | $ mkdir x | |
321 | $ echo foo > x/a |
|
315 | $ echo foo > x/a | |
322 |
|
316 | |||
323 | $ linkcp x y |
|
317 | $ linkcp x y | |
324 | $ echo bar >> y/a |
|
318 | $ echo bar >> y/a | |
325 |
|
319 | |||
326 | No diff if hardlink: |
|
320 | No diff if hardlink: | |
327 |
|
321 | |||
328 | $ diff x/a y/a |
|
322 | $ diff x/a y/a | |
329 |
|
323 | |||
330 | Test mq hardlinking: |
|
324 | Test mq hardlinking: | |
331 |
|
325 | |||
332 | $ echo "[extensions]" >> $HGRCPATH |
|
326 | $ echo "[extensions]" >> $HGRCPATH | |
333 | $ echo "mq=" >> $HGRCPATH |
|
327 | $ echo "mq=" >> $HGRCPATH | |
334 |
|
328 | |||
335 | $ hg init a |
|
329 | $ hg init a | |
336 | $ cd a |
|
330 | $ cd a | |
337 |
|
331 | |||
338 | $ hg qimport -n foo - << EOF |
|
332 | $ hg qimport -n foo - << EOF | |
339 | > # HG changeset patch |
|
333 | > # HG changeset patch | |
340 | > # Date 1 0 |
|
334 | > # Date 1 0 | |
341 | > diff -r 2588a8b53d66 a |
|
335 | > diff -r 2588a8b53d66 a | |
342 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
336 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
343 | > +++ b/a Wed Jul 23 15:54:29 2008 +0200 |
|
337 | > +++ b/a Wed Jul 23 15:54:29 2008 +0200 | |
344 | > @@ -0,0 +1,1 @@ |
|
338 | > @@ -0,0 +1,1 @@ | |
345 | > +a |
|
339 | > +a | |
346 | > EOF |
|
340 | > EOF | |
347 | adding foo to series file |
|
341 | adding foo to series file | |
348 |
|
342 | |||
349 | $ hg qpush |
|
343 | $ hg qpush | |
350 | applying foo |
|
344 | applying foo | |
351 | now at: foo |
|
345 | now at: foo | |
352 |
|
346 | |||
353 | $ cd .. |
|
347 | $ cd .. | |
354 | $ linkcp a b |
|
348 | $ linkcp a b | |
355 | $ cd b |
|
349 | $ cd b | |
356 |
|
350 | |||
357 | $ hg qimport -n bar - << EOF |
|
351 | $ hg qimport -n bar - << EOF | |
358 | > # HG changeset patch |
|
352 | > # HG changeset patch | |
359 | > # Date 2 0 |
|
353 | > # Date 2 0 | |
360 | > diff -r 2588a8b53d66 a |
|
354 | > diff -r 2588a8b53d66 a | |
361 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
355 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
362 | > +++ b/b Wed Jul 23 15:54:29 2008 +0200 |
|
356 | > +++ b/b Wed Jul 23 15:54:29 2008 +0200 | |
363 | > @@ -0,0 +1,1 @@ |
|
357 | > @@ -0,0 +1,1 @@ | |
364 | > +b |
|
358 | > +b | |
365 | > EOF |
|
359 | > EOF | |
366 | adding bar to series file |
|
360 | adding bar to series file | |
367 |
|
361 | |||
368 | $ hg qpush |
|
362 | $ hg qpush | |
369 | applying bar |
|
363 | applying bar | |
370 | now at: bar |
|
364 | now at: bar | |
371 |
|
365 | |||
372 | $ cat .hg/patches/status |
|
366 | $ cat .hg/patches/status | |
373 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo |
|
367 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo | |
374 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar |
|
368 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar | |
375 |
|
369 | |||
376 | $ cat .hg/patches/series |
|
370 | $ cat .hg/patches/series | |
377 | foo |
|
371 | foo | |
378 | bar |
|
372 | bar | |
379 |
|
373 | |||
380 | $ cat ../a/.hg/patches/status |
|
374 | $ cat ../a/.hg/patches/status | |
381 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo |
|
375 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo | |
382 |
|
376 | |||
383 | $ cat ../a/.hg/patches/series |
|
377 | $ cat ../a/.hg/patches/series | |
384 | foo |
|
378 | foo | |
385 |
|
379 | |||
386 | Test tags hardlinking: |
|
380 | Test tags hardlinking: | |
387 |
|
381 | |||
388 | $ hg qdel -r qbase:qtip |
|
382 | $ hg qdel -r qbase:qtip | |
389 | patch foo finalized without changeset message |
|
383 | patch foo finalized without changeset message | |
390 | patch bar finalized without changeset message |
|
384 | patch bar finalized without changeset message | |
391 |
|
385 | |||
392 | $ hg tag -l lfoo |
|
386 | $ hg tag -l lfoo | |
393 | $ hg tag foo |
|
387 | $ hg tag foo | |
394 |
|
388 | |||
395 | $ cd .. |
|
389 | $ cd .. | |
396 | $ linkcp b c |
|
390 | $ linkcp b c | |
397 | $ cd c |
|
391 | $ cd c | |
398 |
|
392 | |||
399 | $ hg tag -l -r 0 lbar |
|
393 | $ hg tag -l -r 0 lbar | |
400 | $ hg tag -r 0 bar |
|
394 | $ hg tag -r 0 bar | |
401 |
|
395 | |||
402 | $ cat .hgtags |
|
396 | $ cat .hgtags | |
403 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo |
|
397 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo | |
404 | 430ed4828a74fa4047bc816a25500f7472ab4bfe bar |
|
398 | 430ed4828a74fa4047bc816a25500f7472ab4bfe bar | |
405 |
|
399 | |||
406 | $ cat .hg/localtags |
|
400 | $ cat .hg/localtags | |
407 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
|
401 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo | |
408 | 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar |
|
402 | 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar | |
409 |
|
403 | |||
410 | $ cat ../b/.hgtags |
|
404 | $ cat ../b/.hgtags | |
411 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo |
|
405 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo | |
412 |
|
406 | |||
413 | $ cat ../b/.hg/localtags |
|
407 | $ cat ../b/.hg/localtags | |
414 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
|
408 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo | |
415 |
|
409 | |||
416 | $ cd .. |
|
410 | $ cd .. |
@@ -1,732 +1,726 b'' | |||||
1 | setup |
|
1 | setup | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH << EOF |
|
3 | $ cat >> $HGRCPATH << EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > blackbox= |
|
5 | > blackbox= | |
6 | > mock=$TESTDIR/mockblackbox.py |
|
6 | > mock=$TESTDIR/mockblackbox.py | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 | Helper functions: |
|
9 | Helper functions: | |
10 |
|
10 | |||
11 | $ cacheexists() { |
|
11 | $ cacheexists() { | |
12 | > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache" |
|
12 | > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache" | |
13 | > } |
|
13 | > } | |
14 |
|
14 | |||
15 | $ fnodescacheexists() { |
|
15 | $ fnodescacheexists() { | |
16 | > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache" |
|
16 | > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache" | |
17 | > } |
|
17 | > } | |
18 |
|
18 | |||
19 | $ dumptags() { |
|
19 | $ dumptags() { | |
20 | > rev=$1 |
|
20 | > rev=$1 | |
21 | > echo "rev $rev: .hgtags:" |
|
21 | > echo "rev $rev: .hgtags:" | |
22 | > hg cat -r$rev .hgtags |
|
22 | > hg cat -r$rev .hgtags | |
23 | > } |
|
23 | > } | |
24 |
|
24 | |||
25 | # XXX need to test that the tag cache works when we strip an old head |
|
25 | # XXX need to test that the tag cache works when we strip an old head | |
26 | # and add a new one rooted off non-tip: i.e. node and rev of tip are the |
|
26 | # and add a new one rooted off non-tip: i.e. node and rev of tip are the | |
27 | # same, but stuff has changed behind tip. |
|
27 | # same, but stuff has changed behind tip. | |
28 |
|
28 | |||
29 | Setup: |
|
29 | Setup: | |
30 |
|
30 | |||
31 | $ hg init t |
|
31 | $ hg init t | |
32 | $ cd t |
|
32 | $ cd t | |
33 | $ cacheexists |
|
33 | $ cacheexists | |
34 | no tag cache |
|
34 | no tag cache | |
35 | $ fnodescacheexists |
|
35 | $ fnodescacheexists | |
36 | no fnodes cache |
|
36 | no fnodes cache | |
37 | $ hg id |
|
37 | $ hg id | |
38 | 000000000000 tip |
|
38 | 000000000000 tip | |
39 | $ cacheexists |
|
39 | $ cacheexists | |
40 | no tag cache |
|
40 | no tag cache | |
41 | $ fnodescacheexists |
|
41 | $ fnodescacheexists | |
42 | no fnodes cache |
|
42 | no fnodes cache | |
43 | $ echo a > a |
|
43 | $ echo a > a | |
44 | $ hg add a |
|
44 | $ hg add a | |
45 | $ hg commit -m "test" |
|
45 | $ hg commit -m "test" | |
46 | $ hg co |
|
46 | $ hg co | |
47 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
47 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
48 | $ hg identify |
|
48 | $ hg identify | |
49 | acb14030fe0a tip |
|
49 | acb14030fe0a tip | |
50 | $ hg identify -r 'wdir()' |
|
50 | $ hg identify -r 'wdir()' | |
51 | acb14030fe0a tip |
|
51 | acb14030fe0a tip | |
52 | $ cacheexists |
|
52 | $ cacheexists | |
53 | tag cache exists |
|
53 | tag cache exists | |
54 | No fnodes cache because .hgtags file doesn't exist |
|
54 | No fnodes cache because .hgtags file doesn't exist | |
55 | (this is an implementation detail) |
|
55 | (this is an implementation detail) | |
56 | $ fnodescacheexists |
|
56 | $ fnodescacheexists | |
57 | no fnodes cache |
|
57 | no fnodes cache | |
58 |
|
58 | |||
59 | Try corrupting the cache |
|
59 | Try corrupting the cache | |
60 |
|
60 | |||
61 | $ printf 'a b' > .hg/cache/tags2-visible |
|
61 | $ printf 'a b' > .hg/cache/tags2-visible | |
62 | $ hg identify |
|
62 | $ hg identify | |
63 | acb14030fe0a tip |
|
63 | acb14030fe0a tip | |
64 | $ cacheexists |
|
64 | $ cacheexists | |
65 | tag cache exists |
|
65 | tag cache exists | |
66 | $ fnodescacheexists |
|
66 | $ fnodescacheexists | |
67 | no fnodes cache |
|
67 | no fnodes cache | |
68 | $ hg identify |
|
68 | $ hg identify | |
69 | acb14030fe0a tip |
|
69 | acb14030fe0a tip | |
70 |
|
70 | |||
71 | Create local tag with long name: |
|
71 | Create local tag with long name: | |
72 |
|
72 | |||
73 | $ T=`hg identify --debug --id` |
|
73 | $ T=`hg identify --debug --id` | |
74 | $ hg tag -l "This is a local tag with a really long name!" |
|
74 | $ hg tag -l "This is a local tag with a really long name!" | |
75 | $ hg tags |
|
75 | $ hg tags | |
76 | tip 0:acb14030fe0a |
|
76 | tip 0:acb14030fe0a | |
77 | This is a local tag with a really long name! 0:acb14030fe0a |
|
77 | This is a local tag with a really long name! 0:acb14030fe0a | |
78 | $ rm .hg/localtags |
|
78 | $ rm .hg/localtags | |
79 |
|
79 | |||
80 | Create a tag behind hg's back: |
|
80 | Create a tag behind hg's back: | |
81 |
|
81 | |||
82 | $ echo "$T first" > .hgtags |
|
82 | $ echo "$T first" > .hgtags | |
83 | $ cat .hgtags |
|
83 | $ cat .hgtags | |
84 | acb14030fe0a21b60322c440ad2d20cf7685a376 first |
|
84 | acb14030fe0a21b60322c440ad2d20cf7685a376 first | |
85 | $ hg add .hgtags |
|
85 | $ hg add .hgtags | |
86 | $ hg commit -m "add tags" |
|
86 | $ hg commit -m "add tags" | |
87 | $ hg tags |
|
87 | $ hg tags | |
88 | tip 1:b9154636be93 |
|
88 | tip 1:b9154636be93 | |
89 | first 0:acb14030fe0a |
|
89 | first 0:acb14030fe0a | |
90 | $ hg identify |
|
90 | $ hg identify | |
91 | b9154636be93 tip |
|
91 | b9154636be93 tip | |
92 |
|
92 | |||
93 | We should have a fnodes cache now that we have a real tag |
|
93 | We should have a fnodes cache now that we have a real tag | |
94 | The cache should have an empty entry for rev 0 and a valid entry for rev 1. |
|
94 | The cache should have an empty entry for rev 0 and a valid entry for rev 1. | |
95 |
|
95 | |||
96 |
|
96 | |||
97 | $ fnodescacheexists |
|
97 | $ fnodescacheexists | |
98 | fnodes cache exists |
|
98 | fnodes cache exists | |
99 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 |
|
99 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 | |
100 | .hg/cache/hgtagsfnodes1: size=48 |
|
100 | .hg/cache/hgtagsfnodes1: size=48 | |
101 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
101 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
102 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| |
|
102 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| | |
103 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| |
|
103 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| | |
104 |
|
104 | |||
105 | Repeat with cold tag cache: |
|
105 | Repeat with cold tag cache: | |
106 |
|
106 | |||
107 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 |
|
107 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 | |
108 | $ hg identify |
|
108 | $ hg identify | |
109 | b9154636be93 tip |
|
109 | b9154636be93 tip | |
110 |
|
110 | |||
111 | $ fnodescacheexists |
|
111 | $ fnodescacheexists | |
112 | fnodes cache exists |
|
112 | fnodes cache exists | |
113 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 |
|
113 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 | |
114 | .hg/cache/hgtagsfnodes1: size=48 |
|
114 | .hg/cache/hgtagsfnodes1: size=48 | |
115 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
115 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
116 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| |
|
116 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| | |
117 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| |
|
117 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| | |
118 |
|
118 | |||
119 | And again, but now unable to write tag cache or lock file: |
|
119 | And again, but now unable to write tag cache or lock file: | |
120 |
|
120 | |||
121 | #if unix-permissions |
|
121 | #if unix-permissions | |
122 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 |
|
122 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 | |
123 | $ chmod 555 .hg/cache |
|
123 | $ chmod 555 .hg/cache | |
124 | $ hg identify |
|
124 | $ hg identify | |
125 | b9154636be93 tip |
|
125 | b9154636be93 tip | |
126 | $ chmod 755 .hg/cache |
|
126 | $ chmod 755 .hg/cache | |
127 |
|
127 | |||
128 | $ chmod 555 .hg |
|
128 | $ chmod 555 .hg | |
129 | $ hg identify |
|
129 | $ hg identify | |
130 | b9154636be93 tip |
|
130 | b9154636be93 tip | |
131 | $ chmod 755 .hg |
|
131 | $ chmod 755 .hg | |
132 | #endif |
|
132 | #endif | |
133 |
|
133 | |||
134 | Tag cache debug info written to blackbox log |
|
134 | Tag cache debug info written to blackbox log | |
135 |
|
135 | |||
136 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 |
|
136 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 | |
137 | $ hg identify |
|
137 | $ hg identify | |
138 | b9154636be93 tip |
|
138 | b9154636be93 tip | |
139 | $ hg blackbox -l 6 |
|
139 | $ hg blackbox -l 6 | |
140 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify |
|
140 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify | |
141 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing 48 bytes to cache/hgtagsfnodes1 |
|
141 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing 48 bytes to cache/hgtagsfnodes1 | |
142 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob) |
|
142 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob) | |
143 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
143 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags | |
144 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob) |
|
144 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob) | |
145 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6 |
|
145 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6 | |
146 |
|
146 | |||
147 | Failure to acquire lock results in no write |
|
147 | Failure to acquire lock results in no write | |
148 |
|
148 | |||
149 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 |
|
149 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 | |
150 | $ echo 'foo:1' > .hg/wlock |
|
150 | $ echo 'foo:1' > .hg/wlock | |
151 | $ hg identify |
|
151 | $ hg identify | |
152 | b9154636be93 tip |
|
152 | b9154636be93 tip | |
153 | $ hg blackbox -l 6 |
|
153 | $ hg blackbox -l 6 | |
154 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify |
|
154 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify | |
155 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired |
|
155 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired | |
156 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob) |
|
156 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob) | |
157 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
157 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags | |
158 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob) |
|
158 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob) | |
159 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6 |
|
159 | 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6 | |
160 |
|
160 | |||
161 | $ fnodescacheexists |
|
161 | $ fnodescacheexists | |
162 | no fnodes cache |
|
162 | no fnodes cache | |
163 |
|
163 | |||
164 | $ rm .hg/wlock |
|
164 | $ rm .hg/wlock | |
165 |
|
165 | |||
166 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 |
|
166 | $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 | |
167 | $ hg identify |
|
167 | $ hg identify | |
168 | b9154636be93 tip |
|
168 | b9154636be93 tip | |
169 |
|
169 | |||
170 | Create a branch: |
|
170 | Create a branch: | |
171 |
|
171 | |||
172 | $ echo bb > a |
|
172 | $ echo bb > a | |
173 | $ hg status |
|
173 | $ hg status | |
174 | M a |
|
174 | M a | |
175 | $ hg identify |
|
175 | $ hg identify | |
176 | b9154636be93+ tip |
|
176 | b9154636be93+ tip | |
177 | $ hg co first |
|
177 | $ hg co first | |
178 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
178 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
179 | $ hg id |
|
179 | $ hg id | |
180 | acb14030fe0a+ first |
|
180 | acb14030fe0a+ first | |
181 | $ hg id -r 'wdir()' |
|
181 | $ hg id -r 'wdir()' | |
182 | acb14030fe0a+ first |
|
182 | acb14030fe0a+ first | |
183 | $ hg -v id |
|
183 | $ hg -v id | |
184 | acb14030fe0a+ first |
|
184 | acb14030fe0a+ first | |
185 | $ hg status |
|
185 | $ hg status | |
186 | M a |
|
186 | M a | |
187 | $ echo 1 > b |
|
187 | $ echo 1 > b | |
188 | $ hg add b |
|
188 | $ hg add b | |
189 | $ hg commit -m "branch" |
|
189 | $ hg commit -m "branch" | |
190 | created new head |
|
190 | created new head | |
191 |
|
191 | |||
192 | Creating a new commit shouldn't append the .hgtags fnodes cache until |
|
192 | Creating a new commit shouldn't append the .hgtags fnodes cache until | |
193 | tags info is accessed |
|
193 | tags info is accessed | |
194 |
|
194 | |||
195 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 |
|
195 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 | |
196 | .hg/cache/hgtagsfnodes1: size=48 |
|
196 | .hg/cache/hgtagsfnodes1: size=48 | |
197 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
197 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
198 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| |
|
198 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| | |
199 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| |
|
199 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| | |
200 |
|
200 | |||
201 | $ hg id |
|
201 | $ hg id | |
202 | c8edf04160c7 tip |
|
202 | c8edf04160c7 tip | |
203 |
|
203 | |||
204 | First 4 bytes of record 3 are changeset fragment |
|
204 | First 4 bytes of record 3 are changeset fragment | |
205 |
|
205 | |||
206 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 |
|
206 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 | |
207 | .hg/cache/hgtagsfnodes1: size=72 |
|
207 | .hg/cache/hgtagsfnodes1: size=72 | |
208 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
208 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
209 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| |
|
209 | 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| | |
210 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| |
|
210 | 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| | |
211 | 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............| |
|
211 | 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............| | |
212 | 0040: 00 00 00 00 00 00 00 00 |........| |
|
212 | 0040: 00 00 00 00 00 00 00 00 |........| | |
213 |
|
213 | |||
214 | Merge the two heads: |
|
214 | Merge the two heads: | |
215 |
|
215 | |||
216 | $ hg merge 1 |
|
216 | $ hg merge 1 | |
217 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
217 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
218 | (branch merge, don't forget to commit) |
|
218 | (branch merge, don't forget to commit) | |
219 | $ hg blackbox -l3 |
|
219 | $ hg blackbox -l3 | |
220 | 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28 (5000)> merge 1 |
|
220 | 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28 (5000)> merge 1 | |
221 | 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> merge 1 exited 0 after * seconds (glob) |
|
221 | 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> merge 1 exited 0 after * seconds (glob) | |
222 | 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l3 |
|
222 | 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l3 | |
223 | $ hg id |
|
223 | $ hg id | |
224 | c8edf04160c7+b9154636be93+ tip |
|
224 | c8edf04160c7+b9154636be93+ tip | |
225 | $ hg status |
|
225 | $ hg status | |
226 | M .hgtags |
|
226 | M .hgtags | |
227 | $ hg commit -m "merge" |
|
227 | $ hg commit -m "merge" | |
228 |
|
228 | |||
229 | Create a fake head, make sure tag not visible afterwards: |
|
229 | Create a fake head, make sure tag not visible afterwards: | |
230 |
|
230 | |||
231 | $ cp .hgtags tags |
|
231 | $ cp .hgtags tags | |
232 | $ hg tag last |
|
232 | $ hg tag last | |
233 | $ hg rm .hgtags |
|
233 | $ hg rm .hgtags | |
234 | $ hg commit -m "remove" |
|
234 | $ hg commit -m "remove" | |
235 |
|
235 | |||
236 | $ mv tags .hgtags |
|
236 | $ mv tags .hgtags | |
237 | $ hg add .hgtags |
|
237 | $ hg add .hgtags | |
238 | $ hg commit -m "readd" |
|
238 | $ hg commit -m "readd" | |
239 | $ |
|
239 | $ | |
240 | $ hg tags |
|
240 | $ hg tags | |
241 | tip 6:35ff301afafe |
|
241 | tip 6:35ff301afafe | |
242 | first 0:acb14030fe0a |
|
242 | first 0:acb14030fe0a | |
243 |
|
243 | |||
244 | Add invalid tags: |
|
244 | Add invalid tags: | |
245 |
|
245 | |||
246 | $ echo "spam" >> .hgtags |
|
246 | $ echo "spam" >> .hgtags | |
247 | $ echo >> .hgtags |
|
247 | $ echo >> .hgtags | |
248 | $ echo "foo bar" >> .hgtags |
|
248 | $ echo "foo bar" >> .hgtags | |
249 | $ echo "a5a5 invalid" >> .hg/localtags |
|
249 | $ echo "a5a5 invalid" >> .hg/localtags | |
250 | $ cat .hgtags |
|
250 | $ cat .hgtags | |
251 | acb14030fe0a21b60322c440ad2d20cf7685a376 first |
|
251 | acb14030fe0a21b60322c440ad2d20cf7685a376 first | |
252 | spam |
|
252 | spam | |
253 |
|
253 | |||
254 | foo bar |
|
254 | foo bar | |
255 | $ hg commit -m "tags" |
|
255 | $ hg commit -m "tags" | |
256 |
|
256 | |||
257 | Report tag parse error on other head: |
|
257 | Report tag parse error on other head: | |
258 |
|
258 | |||
259 | $ hg up 3 |
|
259 | $ hg up 3 | |
260 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
260 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
261 | $ echo 'x y' >> .hgtags |
|
261 | $ echo 'x y' >> .hgtags | |
262 | $ hg commit -m "head" |
|
262 | $ hg commit -m "head" | |
263 | created new head |
|
263 | created new head | |
264 |
|
264 | |||
265 | $ hg tags --debug |
|
265 | $ hg tags --debug | |
266 | .hgtags@75d9f02dfe28, line 2: cannot parse entry |
|
266 | .hgtags@75d9f02dfe28, line 2: cannot parse entry | |
267 | .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed |
|
267 | .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed | |
268 | .hgtags@c4be69a18c11, line 2: node 'x' is not well formed |
|
268 | .hgtags@c4be69a18c11, line 2: node 'x' is not well formed | |
269 | tip 8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663 |
|
269 | tip 8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663 | |
270 | first 0:acb14030fe0a21b60322c440ad2d20cf7685a376 |
|
270 | first 0:acb14030fe0a21b60322c440ad2d20cf7685a376 | |
271 | $ hg tip |
|
271 | $ hg tip | |
272 | changeset: 8:c4be69a18c11 |
|
272 | changeset: 8:c4be69a18c11 | |
273 | tag: tip |
|
273 | tag: tip | |
274 | parent: 3:ac5e980c4dc0 |
|
274 | parent: 3:ac5e980c4dc0 | |
275 | user: test |
|
275 | user: test | |
276 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
276 | date: Thu Jan 01 00:00:00 1970 +0000 | |
277 | summary: head |
|
277 | summary: head | |
278 |
|
278 | |||
279 |
|
279 | |||
280 | Test tag precedence rules: |
|
280 | Test tag precedence rules: | |
281 |
|
281 | |||
282 | $ cd .. |
|
282 | $ cd .. | |
283 | $ hg init t2 |
|
283 | $ hg init t2 | |
284 | $ cd t2 |
|
284 | $ cd t2 | |
285 | $ echo foo > foo |
|
285 | $ echo foo > foo | |
286 | $ hg add foo |
|
286 | $ hg add foo | |
287 | $ hg ci -m 'add foo' # rev 0 |
|
287 | $ hg ci -m 'add foo' # rev 0 | |
288 | $ hg tag bar # rev 1 |
|
288 | $ hg tag bar # rev 1 | |
289 | $ echo >> foo |
|
289 | $ echo >> foo | |
290 | $ hg ci -m 'change foo 1' # rev 2 |
|
290 | $ hg ci -m 'change foo 1' # rev 2 | |
291 | $ hg up -C 1 |
|
291 | $ hg up -C 1 | |
292 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
292 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
293 | $ hg tag -r 1 -f bar # rev 3 |
|
293 | $ hg tag -r 1 -f bar # rev 3 | |
294 | $ hg up -C 1 |
|
294 | $ hg up -C 1 | |
295 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
295 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
296 | $ echo >> foo |
|
296 | $ echo >> foo | |
297 | $ hg ci -m 'change foo 2' # rev 4 |
|
297 | $ hg ci -m 'change foo 2' # rev 4 | |
298 | created new head |
|
298 | created new head | |
299 | $ hg tags |
|
299 | $ hg tags | |
300 | tip 4:0c192d7d5e6b |
|
300 | tip 4:0c192d7d5e6b | |
301 | bar 1:78391a272241 |
|
301 | bar 1:78391a272241 | |
302 |
|
302 | |||
303 | Repeat in case of cache effects: |
|
303 | Repeat in case of cache effects: | |
304 |
|
304 | |||
305 | $ hg tags |
|
305 | $ hg tags | |
306 | tip 4:0c192d7d5e6b |
|
306 | tip 4:0c192d7d5e6b | |
307 | bar 1:78391a272241 |
|
307 | bar 1:78391a272241 | |
308 |
|
308 | |||
309 | Detailed dump of tag info: |
|
309 | Detailed dump of tag info: | |
310 |
|
310 | |||
311 | $ hg heads -q # expect 4, 3, 2 |
|
311 | $ hg heads -q # expect 4, 3, 2 | |
312 | 4:0c192d7d5e6b |
|
312 | 4:0c192d7d5e6b | |
313 | 3:6fa450212aeb |
|
313 | 3:6fa450212aeb | |
314 | 2:7a94127795a3 |
|
314 | 2:7a94127795a3 | |
315 | $ dumptags 2 |
|
315 | $ dumptags 2 | |
316 | rev 2: .hgtags: |
|
316 | rev 2: .hgtags: | |
317 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
317 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
318 | $ dumptags 3 |
|
318 | $ dumptags 3 | |
319 | rev 3: .hgtags: |
|
319 | rev 3: .hgtags: | |
320 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
320 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
321 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
321 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
322 | 78391a272241d70354aa14c874552cad6b51bb42 bar |
|
322 | 78391a272241d70354aa14c874552cad6b51bb42 bar | |
323 | $ dumptags 4 |
|
323 | $ dumptags 4 | |
324 | rev 4: .hgtags: |
|
324 | rev 4: .hgtags: | |
325 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
325 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
326 |
|
326 | |||
327 | Dump cache: |
|
327 | Dump cache: | |
328 |
|
328 | |||
329 | $ cat .hg/cache/tags2-visible |
|
329 | $ cat .hg/cache/tags2-visible | |
330 | 4 0c192d7d5e6b78a714de54a2e9627952a877e25a |
|
330 | 4 0c192d7d5e6b78a714de54a2e9627952a877e25a | |
331 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
331 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
332 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
332 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
333 | 78391a272241d70354aa14c874552cad6b51bb42 bar |
|
333 | 78391a272241d70354aa14c874552cad6b51bb42 bar | |
334 |
|
334 | |||
335 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 |
|
335 | $ f --size --hexdump .hg/cache/hgtagsfnodes1 | |
336 | .hg/cache/hgtagsfnodes1: size=120 |
|
336 | .hg/cache/hgtagsfnodes1: size=120 | |
337 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
337 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
338 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
338 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
339 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
339 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
340 | 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(| |
|
340 | 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(| | |
341 | 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.| |
|
341 | 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.| | |
342 | 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..| |
|
342 | 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..| | |
343 | 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(| |
|
343 | 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(| | |
344 | 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=| |
|
344 | 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=| | |
345 |
|
345 | |||
346 | Corrupt the .hgtags fnodes cache |
|
346 | Corrupt the .hgtags fnodes cache | |
347 | Extra junk data at the end should get overwritten on next cache update |
|
347 | Extra junk data at the end should get overwritten on next cache update | |
348 |
|
348 | |||
349 | $ echo extra >> .hg/cache/hgtagsfnodes1 |
|
349 | $ echo extra >> .hg/cache/hgtagsfnodes1 | |
350 | $ echo dummy1 > foo |
|
350 | $ echo dummy1 > foo | |
351 | $ hg commit -m throwaway1 |
|
351 | $ hg commit -m throwaway1 | |
352 |
|
352 | |||
353 | $ hg tags |
|
353 | $ hg tags | |
354 | tip 5:8dbfe60eff30 |
|
354 | tip 5:8dbfe60eff30 | |
355 | bar 1:78391a272241 |
|
355 | bar 1:78391a272241 | |
356 |
|
356 | |||
357 | $ hg blackbox -l 6 |
|
357 | $ hg blackbox -l 6 | |
358 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags |
|
358 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags | |
359 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing 24 bytes to cache/hgtagsfnodes1 |
|
359 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing 24 bytes to cache/hgtagsfnodes1 | |
360 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> 2/3 cache hits/lookups in * seconds (glob) |
|
360 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> 2/3 cache hits/lookups in * seconds (glob) | |
361 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
361 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing .hg/cache/tags2-visible with 1 tags | |
362 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob) |
|
362 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob) | |
363 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6 |
|
363 | 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6 | |
364 |
|
364 | |||
365 | #if unix-permissions no-root |
|
365 | #if unix-permissions no-root | |
366 | Errors writing to .hgtags fnodes cache are silently ignored |
|
366 | Errors writing to .hgtags fnodes cache are silently ignored | |
367 |
|
367 | |||
368 | $ echo dummy2 > foo |
|
368 | $ echo dummy2 > foo | |
369 | $ hg commit -m throwaway2 |
|
369 | $ hg commit -m throwaway2 | |
370 |
|
370 | |||
371 | $ chmod a-w .hg/cache/hgtagsfnodes1 |
|
371 | $ chmod a-w .hg/cache/hgtagsfnodes1 | |
372 | $ rm -f .hg/cache/tags2-visible |
|
372 | $ rm -f .hg/cache/tags2-visible | |
373 |
|
373 | |||
374 | $ hg tags |
|
374 | $ hg tags | |
375 | tip 6:b968051b5cf3 |
|
375 | tip 6:b968051b5cf3 | |
376 | bar 1:78391a272241 |
|
376 | bar 1:78391a272241 | |
377 |
|
377 | |||
378 | $ hg blackbox -l 6 |
|
378 | $ hg blackbox -l 6 | |
379 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags |
|
379 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags | |
380 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1' |
|
380 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1' | |
381 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob) |
|
381 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob) | |
382 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
382 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags | |
383 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob) |
|
383 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob) | |
384 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6 |
|
384 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6 | |
385 |
|
385 | |||
386 | $ chmod a+w .hg/cache/hgtagsfnodes1 |
|
386 | $ chmod a+w .hg/cache/hgtagsfnodes1 | |
387 |
|
387 | |||
388 | $ rm -f .hg/cache/tags2-visible |
|
388 | $ rm -f .hg/cache/tags2-visible | |
389 | $ hg tags |
|
389 | $ hg tags | |
390 | tip 6:b968051b5cf3 |
|
390 | tip 6:b968051b5cf3 | |
391 | bar 1:78391a272241 |
|
391 | bar 1:78391a272241 | |
392 |
|
392 | |||
393 | $ hg blackbox -l 6 |
|
393 | $ hg blackbox -l 6 | |
394 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags |
|
394 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags | |
395 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing 24 bytes to cache/hgtagsfnodes1 |
|
395 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing 24 bytes to cache/hgtagsfnodes1 | |
396 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob) |
|
396 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob) | |
397 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
397 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags | |
398 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob) |
|
398 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob) | |
399 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6 |
|
399 | 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6 | |
400 |
|
400 | |||
401 | $ f --size .hg/cache/hgtagsfnodes1 |
|
401 | $ f --size .hg/cache/hgtagsfnodes1 | |
402 | .hg/cache/hgtagsfnodes1: size=168 |
|
402 | .hg/cache/hgtagsfnodes1: size=168 | |
403 |
|
403 | |||
404 | $ hg -q --config extensions.strip= strip -r 6 --no-backup |
|
404 | $ hg -q --config extensions.strip= strip -r 6 --no-backup | |
405 | #endif |
|
405 | #endif | |
406 |
|
406 | |||
407 | Stripping doesn't truncate the tags cache until new data is available |
|
407 | Stripping doesn't truncate the tags cache until new data is available | |
408 |
|
408 | |||
409 | $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible |
|
409 | $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible | |
410 | $ hg tags |
|
410 | $ hg tags | |
411 | tip 5:8dbfe60eff30 |
|
411 | tip 5:8dbfe60eff30 | |
412 | bar 1:78391a272241 |
|
412 | bar 1:78391a272241 | |
413 |
|
413 | |||
414 | $ f --size .hg/cache/hgtagsfnodes1 |
|
414 | $ f --size .hg/cache/hgtagsfnodes1 | |
415 | .hg/cache/hgtagsfnodes1: size=144 |
|
415 | .hg/cache/hgtagsfnodes1: size=144 | |
416 |
|
416 | |||
417 | $ hg -q --config extensions.strip= strip -r 5 --no-backup |
|
417 | $ hg -q --config extensions.strip= strip -r 5 --no-backup | |
418 | $ hg tags |
|
418 | $ hg tags | |
419 | tip 4:0c192d7d5e6b |
|
419 | tip 4:0c192d7d5e6b | |
420 | bar 1:78391a272241 |
|
420 | bar 1:78391a272241 | |
421 |
|
421 | |||
422 | $ hg blackbox -l 5 |
|
422 | $ hg blackbox -l 5 | |
423 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing 24 bytes to cache/hgtagsfnodes1 |
|
423 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing 24 bytes to cache/hgtagsfnodes1 | |
424 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> 2/3 cache hits/lookups in * seconds (glob) |
|
424 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> 2/3 cache hits/lookups in * seconds (glob) | |
425 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
425 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing .hg/cache/tags2-visible with 1 tags | |
426 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> tags exited 0 after * seconds (glob) |
|
426 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> tags exited 0 after * seconds (glob) | |
427 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> blackbox -l 5 |
|
427 | 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> blackbox -l 5 | |
428 |
|
428 | |||
429 | $ f --size .hg/cache/hgtagsfnodes1 |
|
429 | $ f --size .hg/cache/hgtagsfnodes1 | |
430 | .hg/cache/hgtagsfnodes1: size=120 |
|
430 | .hg/cache/hgtagsfnodes1: size=120 | |
431 |
|
431 | |||
432 | $ echo dummy > foo |
|
432 | $ echo dummy > foo | |
433 | $ hg commit -m throwaway3 |
|
433 | $ hg commit -m throwaway3 | |
434 |
|
434 | |||
435 | $ hg tags |
|
435 | $ hg tags | |
436 | tip 5:035f65efb448 |
|
436 | tip 5:035f65efb448 | |
437 | bar 1:78391a272241 |
|
437 | bar 1:78391a272241 | |
438 |
|
438 | |||
439 | $ hg blackbox -l 6 |
|
439 | $ hg blackbox -l 6 | |
440 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags |
|
440 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags | |
441 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing 24 bytes to cache/hgtagsfnodes1 |
|
441 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing 24 bytes to cache/hgtagsfnodes1 | |
442 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> 2/3 cache hits/lookups in * seconds (glob) |
|
442 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> 2/3 cache hits/lookups in * seconds (glob) | |
443 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing .hg/cache/tags2-visible with 1 tags |
|
443 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing .hg/cache/tags2-visible with 1 tags | |
444 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags exited 0 after * seconds (glob) |
|
444 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags exited 0 after * seconds (glob) | |
445 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> blackbox -l 6 |
|
445 | 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> blackbox -l 6 | |
446 | $ f --size .hg/cache/hgtagsfnodes1 |
|
446 | $ f --size .hg/cache/hgtagsfnodes1 | |
447 | .hg/cache/hgtagsfnodes1: size=144 |
|
447 | .hg/cache/hgtagsfnodes1: size=144 | |
448 |
|
448 | |||
449 | $ hg -q --config extensions.strip= strip -r 5 --no-backup |
|
449 | $ hg -q --config extensions.strip= strip -r 5 --no-backup | |
450 |
|
450 | |||
451 | Test tag removal: |
|
451 | Test tag removal: | |
452 |
|
452 | |||
453 | $ hg tag --remove bar # rev 5 |
|
453 | $ hg tag --remove bar # rev 5 | |
454 | $ hg tip -vp |
|
454 | $ hg tip -vp | |
455 | changeset: 5:5f6e8655b1c7 |
|
455 | changeset: 5:5f6e8655b1c7 | |
456 | tag: tip |
|
456 | tag: tip | |
457 | user: test |
|
457 | user: test | |
458 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
458 | date: Thu Jan 01 00:00:00 1970 +0000 | |
459 | files: .hgtags |
|
459 | files: .hgtags | |
460 | description: |
|
460 | description: | |
461 | Removed tag bar |
|
461 | Removed tag bar | |
462 |
|
462 | |||
463 |
|
463 | |||
464 | diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags |
|
464 | diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags | |
465 | --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
465 | --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
466 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 |
|
466 | +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 | |
467 | @@ -1,1 +1,3 @@ |
|
467 | @@ -1,1 +1,3 @@ | |
468 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar |
|
468 | bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar | |
469 | +78391a272241d70354aa14c874552cad6b51bb42 bar |
|
469 | +78391a272241d70354aa14c874552cad6b51bb42 bar | |
470 | +0000000000000000000000000000000000000000 bar |
|
470 | +0000000000000000000000000000000000000000 bar | |
471 |
|
471 | |||
472 | $ hg tags |
|
472 | $ hg tags | |
473 | tip 5:5f6e8655b1c7 |
|
473 | tip 5:5f6e8655b1c7 | |
474 | $ hg tags # again, try to expose cache bugs |
|
474 | $ hg tags # again, try to expose cache bugs | |
475 | tip 5:5f6e8655b1c7 |
|
475 | tip 5:5f6e8655b1c7 | |
476 |
|
476 | |||
477 | Remove nonexistent tag: |
|
477 | Remove nonexistent tag: | |
478 |
|
478 | |||
479 | $ hg tag --remove foobar |
|
479 | $ hg tag --remove foobar | |
480 | abort: tag 'foobar' does not exist |
|
480 | abort: tag 'foobar' does not exist | |
481 | [255] |
|
481 | [255] | |
482 | $ hg tip |
|
482 | $ hg tip | |
483 | changeset: 5:5f6e8655b1c7 |
|
483 | changeset: 5:5f6e8655b1c7 | |
484 | tag: tip |
|
484 | tag: tip | |
485 | user: test |
|
485 | user: test | |
486 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
486 | date: Thu Jan 01 00:00:00 1970 +0000 | |
487 | summary: Removed tag bar |
|
487 | summary: Removed tag bar | |
488 |
|
488 | |||
489 |
|
489 | |||
490 | Undo a tag with rollback: |
|
490 | Undo a tag with rollback: | |
491 |
|
491 | |||
492 | $ hg rollback # destroy rev 5 (restore bar) |
|
492 | $ hg rollback # destroy rev 5 (restore bar) | |
493 | repository tip rolled back to revision 4 (undo commit) |
|
493 | repository tip rolled back to revision 4 (undo commit) | |
494 | working directory now based on revision 4 |
|
494 | working directory now based on revision 4 | |
495 | $ hg tags |
|
495 | $ hg tags | |
496 | tip 4:0c192d7d5e6b |
|
496 | tip 4:0c192d7d5e6b | |
497 | bar 1:78391a272241 |
|
497 | bar 1:78391a272241 | |
498 | $ hg tags |
|
498 | $ hg tags | |
499 | tip 4:0c192d7d5e6b |
|
499 | tip 4:0c192d7d5e6b | |
500 | bar 1:78391a272241 |
|
500 | bar 1:78391a272241 | |
501 |
|
501 | |||
502 | Test tag rank: |
|
502 | Test tag rank: | |
503 |
|
503 | |||
504 | $ cd .. |
|
504 | $ cd .. | |
505 | $ hg init t3 |
|
505 | $ hg init t3 | |
506 | $ cd t3 |
|
506 | $ cd t3 | |
507 | $ echo foo > foo |
|
507 | $ echo foo > foo | |
508 | $ hg add foo |
|
508 | $ hg add foo | |
509 | $ hg ci -m 'add foo' # rev 0 |
|
509 | $ hg ci -m 'add foo' # rev 0 | |
510 | $ hg tag -f bar # rev 1 bar -> 0 |
|
510 | $ hg tag -f bar # rev 1 bar -> 0 | |
511 | $ hg tag -f bar # rev 2 bar -> 1 |
|
511 | $ hg tag -f bar # rev 2 bar -> 1 | |
512 | $ hg tag -fr 0 bar # rev 3 bar -> 0 |
|
512 | $ hg tag -fr 0 bar # rev 3 bar -> 0 | |
513 | $ hg tag -fr 1 bar # rev 4 bar -> 1 |
|
513 | $ hg tag -fr 1 bar # rev 4 bar -> 1 | |
514 | $ hg tag -fr 0 bar # rev 5 bar -> 0 |
|
514 | $ hg tag -fr 0 bar # rev 5 bar -> 0 | |
515 | $ hg tags |
|
515 | $ hg tags | |
516 | tip 5:85f05169d91d |
|
516 | tip 5:85f05169d91d | |
517 | bar 0:bbd179dfa0a7 |
|
517 | bar 0:bbd179dfa0a7 | |
518 | $ hg co 3 |
|
518 | $ hg co 3 | |
519 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
519 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
520 | $ echo barbar > foo |
|
520 | $ echo barbar > foo | |
521 | $ hg ci -m 'change foo' # rev 6 |
|
521 | $ hg ci -m 'change foo' # rev 6 | |
522 | created new head |
|
522 | created new head | |
523 | $ hg tags |
|
523 | $ hg tags | |
524 | tip 6:735c3ca72986 |
|
524 | tip 6:735c3ca72986 | |
525 | bar 0:bbd179dfa0a7 |
|
525 | bar 0:bbd179dfa0a7 | |
526 |
|
526 | |||
527 | Don't allow moving tag without -f: |
|
527 | Don't allow moving tag without -f: | |
528 |
|
528 | |||
529 | $ hg tag -r 3 bar |
|
529 | $ hg tag -r 3 bar | |
530 | abort: tag 'bar' already exists (use -f to force) |
|
530 | abort: tag 'bar' already exists (use -f to force) | |
531 | [255] |
|
531 | [255] | |
532 | $ hg tags |
|
532 | $ hg tags | |
533 | tip 6:735c3ca72986 |
|
533 | tip 6:735c3ca72986 | |
534 | bar 0:bbd179dfa0a7 |
|
534 | bar 0:bbd179dfa0a7 | |
535 |
|
535 | |||
536 | Strip 1: expose an old head: |
|
536 | Strip 1: expose an old head: | |
537 |
|
537 | |||
538 | $ hg --config extensions.mq= strip 5 |
|
538 | $ hg --config extensions.mq= strip 5 | |
539 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) |
|
539 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) | |
540 | $ hg tags # partly stale cache |
|
540 | $ hg tags # partly stale cache | |
541 | tip 5:735c3ca72986 |
|
541 | tip 5:735c3ca72986 | |
542 | bar 1:78391a272241 |
|
542 | bar 1:78391a272241 | |
543 | $ hg tags # up-to-date cache |
|
543 | $ hg tags # up-to-date cache | |
544 | tip 5:735c3ca72986 |
|
544 | tip 5:735c3ca72986 | |
545 | bar 1:78391a272241 |
|
545 | bar 1:78391a272241 | |
546 |
|
546 | |||
547 | Strip 2: destroy whole branch, no old head exposed |
|
547 | Strip 2: destroy whole branch, no old head exposed | |
548 |
|
548 | |||
549 | $ hg --config extensions.mq= strip 4 |
|
549 | $ hg --config extensions.mq= strip 4 | |
550 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) |
|
550 | saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob) | |
551 | $ hg tags # partly stale |
|
551 | $ hg tags # partly stale | |
552 | tip 4:735c3ca72986 |
|
552 | tip 4:735c3ca72986 | |
553 | bar 0:bbd179dfa0a7 |
|
553 | bar 0:bbd179dfa0a7 | |
554 | $ rm -f .hg/cache/tags2-visible |
|
554 | $ rm -f .hg/cache/tags2-visible | |
555 | $ hg tags # cold cache |
|
555 | $ hg tags # cold cache | |
556 | tip 4:735c3ca72986 |
|
556 | tip 4:735c3ca72986 | |
557 | bar 0:bbd179dfa0a7 |
|
557 | bar 0:bbd179dfa0a7 | |
558 |
|
558 | |||
559 | Test tag rank with 3 heads: |
|
559 | Test tag rank with 3 heads: | |
560 |
|
560 | |||
561 | $ cd .. |
|
561 | $ cd .. | |
562 | $ hg init t4 |
|
562 | $ hg init t4 | |
563 | $ cd t4 |
|
563 | $ cd t4 | |
564 | $ echo foo > foo |
|
564 | $ echo foo > foo | |
565 | $ hg add |
|
565 | $ hg add | |
566 | adding foo |
|
566 | adding foo | |
567 | $ hg ci -m 'add foo' # rev 0 |
|
567 | $ hg ci -m 'add foo' # rev 0 | |
568 | $ hg tag bar # rev 1 bar -> 0 |
|
568 | $ hg tag bar # rev 1 bar -> 0 | |
569 | $ hg tag -f bar # rev 2 bar -> 1 |
|
569 | $ hg tag -f bar # rev 2 bar -> 1 | |
570 | $ hg up -qC 0 |
|
570 | $ hg up -qC 0 | |
571 | $ hg tag -fr 2 bar # rev 3 bar -> 2 |
|
571 | $ hg tag -fr 2 bar # rev 3 bar -> 2 | |
572 | $ hg tags |
|
572 | $ hg tags | |
573 | tip 3:197c21bbbf2c |
|
573 | tip 3:197c21bbbf2c | |
574 | bar 2:6fa450212aeb |
|
574 | bar 2:6fa450212aeb | |
575 | $ hg up -qC 0 |
|
575 | $ hg up -qC 0 | |
576 | $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 |
|
576 | $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 | |
577 |
|
577 | |||
578 | Bar should still point to rev 2: |
|
578 | Bar should still point to rev 2: | |
579 |
|
579 | |||
580 | $ hg tags |
|
580 | $ hg tags | |
581 | tip 4:3b4b14ed0202 |
|
581 | tip 4:3b4b14ed0202 | |
582 | bar 2:6fa450212aeb |
|
582 | bar 2:6fa450212aeb | |
583 |
|
583 | |||
584 | Test that removing global/local tags does not get confused when trying |
|
584 | Test that removing global/local tags does not get confused when trying | |
585 | to remove a tag of type X which actually only exists as a type Y: |
|
585 | to remove a tag of type X which actually only exists as a type Y: | |
586 |
|
586 | |||
587 | $ cd .. |
|
587 | $ cd .. | |
588 | $ hg init t5 |
|
588 | $ hg init t5 | |
589 | $ cd t5 |
|
589 | $ cd t5 | |
590 | $ echo foo > foo |
|
590 | $ echo foo > foo | |
591 | $ hg add |
|
591 | $ hg add | |
592 | adding foo |
|
592 | adding foo | |
593 | $ hg ci -m 'add foo' # rev 0 |
|
593 | $ hg ci -m 'add foo' # rev 0 | |
594 |
|
594 | |||
595 | $ hg tag -r 0 -l localtag |
|
595 | $ hg tag -r 0 -l localtag | |
596 | $ hg tag --remove localtag |
|
596 | $ hg tag --remove localtag | |
597 | abort: tag 'localtag' is not a global tag |
|
597 | abort: tag 'localtag' is not a global tag | |
598 | [255] |
|
598 | [255] | |
599 | $ |
|
599 | $ | |
600 | $ hg tag -r 0 globaltag |
|
600 | $ hg tag -r 0 globaltag | |
601 | $ hg tag --remove -l globaltag |
|
601 | $ hg tag --remove -l globaltag | |
602 | abort: tag 'globaltag' is not a local tag |
|
602 | abort: tag 'globaltag' is not a local tag | |
603 | [255] |
|
603 | [255] | |
604 | $ hg tags -v |
|
604 | $ hg tags -v | |
605 | tip 1:a0b6fe111088 |
|
605 | tip 1:a0b6fe111088 | |
606 | localtag 0:bbd179dfa0a7 local |
|
606 | localtag 0:bbd179dfa0a7 local | |
607 | globaltag 0:bbd179dfa0a7 |
|
607 | globaltag 0:bbd179dfa0a7 | |
608 |
|
608 | |||
609 | Test for issue3911 |
|
609 | Test for issue3911 | |
610 |
|
610 | |||
611 | $ hg tag -r 0 -l localtag2 |
|
611 | $ hg tag -r 0 -l localtag2 | |
612 | $ hg tag -l --remove localtag2 |
|
612 | $ hg tag -l --remove localtag2 | |
613 | $ hg tags -v |
|
613 | $ hg tags -v | |
614 | tip 1:a0b6fe111088 |
|
614 | tip 1:a0b6fe111088 | |
615 | localtag 0:bbd179dfa0a7 local |
|
615 | localtag 0:bbd179dfa0a7 local | |
616 | globaltag 0:bbd179dfa0a7 |
|
616 | globaltag 0:bbd179dfa0a7 | |
617 |
|
617 | |||
618 | $ hg tag -r 1 -f localtag |
|
618 | $ hg tag -r 1 -f localtag | |
619 | $ hg tags -v |
|
619 | $ hg tags -v | |
620 | tip 2:5c70a037bb37 |
|
620 | tip 2:5c70a037bb37 | |
621 | localtag 1:a0b6fe111088 |
|
621 | localtag 1:a0b6fe111088 | |
622 | globaltag 0:bbd179dfa0a7 |
|
622 | globaltag 0:bbd179dfa0a7 | |
623 |
|
623 | |||
624 | $ hg tags -v |
|
624 | $ hg tags -v | |
625 | tip 2:5c70a037bb37 |
|
625 | tip 2:5c70a037bb37 | |
626 | localtag 1:a0b6fe111088 |
|
626 | localtag 1:a0b6fe111088 | |
627 | globaltag 0:bbd179dfa0a7 |
|
627 | globaltag 0:bbd179dfa0a7 | |
628 |
|
628 | |||
629 | $ hg tag -r 1 localtag2 |
|
629 | $ hg tag -r 1 localtag2 | |
630 | $ hg tags -v |
|
630 | $ hg tags -v | |
631 | tip 3:bbfb8cd42be2 |
|
631 | tip 3:bbfb8cd42be2 | |
632 | localtag2 1:a0b6fe111088 |
|
632 | localtag2 1:a0b6fe111088 | |
633 | localtag 1:a0b6fe111088 |
|
633 | localtag 1:a0b6fe111088 | |
634 | globaltag 0:bbd179dfa0a7 |
|
634 | globaltag 0:bbd179dfa0a7 | |
635 |
|
635 | |||
636 | $ hg tags -v |
|
636 | $ hg tags -v | |
637 | tip 3:bbfb8cd42be2 |
|
637 | tip 3:bbfb8cd42be2 | |
638 | localtag2 1:a0b6fe111088 |
|
638 | localtag2 1:a0b6fe111088 | |
639 | localtag 1:a0b6fe111088 |
|
639 | localtag 1:a0b6fe111088 | |
640 | globaltag 0:bbd179dfa0a7 |
|
640 | globaltag 0:bbd179dfa0a7 | |
641 |
|
641 | |||
642 | $ cd .. |
|
642 | $ cd .. | |
643 |
|
643 | |||
644 | Create a repository with tags data to test .hgtags fnodes transfer |
|
644 | Create a repository with tags data to test .hgtags fnodes transfer | |
645 |
|
645 | |||
646 | $ hg init tagsserver |
|
646 | $ hg init tagsserver | |
647 | $ cd tagsserver |
|
647 | $ cd tagsserver | |
648 | $ touch foo |
|
648 | $ touch foo | |
649 | $ hg -q commit -A -m initial |
|
649 | $ hg -q commit -A -m initial | |
650 | $ hg tag -m 'tag 0.1' 0.1 |
|
650 | $ hg tag -m 'tag 0.1' 0.1 | |
651 | $ echo second > foo |
|
651 | $ echo second > foo | |
652 | $ hg commit -m second |
|
652 | $ hg commit -m second | |
653 | $ hg tag -m 'tag 0.2' 0.2 |
|
653 | $ hg tag -m 'tag 0.2' 0.2 | |
654 | $ hg tags |
|
654 | $ hg tags | |
655 | tip 3:40f0358cb314 |
|
655 | tip 3:40f0358cb314 | |
656 | 0.2 2:f63cc8fe54e4 |
|
656 | 0.2 2:f63cc8fe54e4 | |
657 | 0.1 0:96ee1d7354c4 |
|
657 | 0.1 0:96ee1d7354c4 | |
658 | $ cd .. |
|
658 | $ cd .. | |
659 |
|
659 | |||
660 | Cloning should pull down hgtags fnodes mappings and write the cache file |
|
660 | Cloning should pull down hgtags fnodes mappings and write the cache file | |
661 |
|
661 | |||
662 | $ hg clone --pull tagsserver tagsclient |
|
662 | $ hg clone --pull tagsserver tagsclient | |
663 | requesting all changes |
|
663 | requesting all changes | |
664 | adding changesets |
|
664 | adding changesets | |
665 | adding manifests |
|
665 | adding manifests | |
666 | adding file changes |
|
666 | adding file changes | |
667 | added 4 changesets with 4 changes to 2 files |
|
667 | added 4 changesets with 4 changes to 2 files | |
668 | updating to branch default |
|
668 | updating to branch default | |
669 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
669 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
670 |
|
670 | |||
671 | Missing tags2* files means the cache wasn't written through the normal mechanism. |
|
671 | Missing tags2* files means the cache wasn't written through the normal mechanism. | |
672 |
|
672 | |||
673 | $ ls tagsclient/.hg/cache |
|
673 | $ ls tagsclient/.hg/cache | |
|
674 | branch2-base | |||
674 | checkisexec (execbit !) |
|
675 | checkisexec (execbit !) | |
675 | checklink (symlink !) |
|
676 | checklink (symlink !) | |
676 | checklink-target (symlink !) |
|
677 | checklink-target (symlink !) | |
677 | branch2-base |
|
|||
678 | checkisexec |
|
|||
679 | checklink |
|
|||
680 | checklink-target |
|
|||
681 | hgtagsfnodes1 |
|
678 | hgtagsfnodes1 | |
682 |
|
679 | |||
683 | Cache should contain the head only, even though other nodes have tags data |
|
680 | Cache should contain the head only, even though other nodes have tags data | |
684 |
|
681 | |||
685 | $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1 |
|
682 | $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1 | |
686 | tagsclient/.hg/cache/hgtagsfnodes1: size=96 |
|
683 | tagsclient/.hg/cache/hgtagsfnodes1: size=96 | |
687 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
684 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
688 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
685 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
689 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
686 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
690 | 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
687 | 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
691 | 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....| |
|
688 | 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....| | |
692 | 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.| |
|
689 | 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.| | |
693 |
|
690 | |||
694 | Running hg tags should produce tags2* file and not change cache |
|
691 | Running hg tags should produce tags2* file and not change cache | |
695 |
|
692 | |||
696 | $ hg -R tagsclient tags |
|
693 | $ hg -R tagsclient tags | |
697 | tip 3:40f0358cb314 |
|
694 | tip 3:40f0358cb314 | |
698 | 0.2 2:f63cc8fe54e4 |
|
695 | 0.2 2:f63cc8fe54e4 | |
699 | 0.1 0:96ee1d7354c4 |
|
696 | 0.1 0:96ee1d7354c4 | |
700 |
|
697 | |||
701 | $ ls tagsclient/.hg/cache |
|
698 | $ ls tagsclient/.hg/cache | |
|
699 | branch2-base | |||
702 | checkisexec (execbit !) |
|
700 | checkisexec (execbit !) | |
703 | checklink (symlink !) |
|
701 | checklink (symlink !) | |
704 | checklink-target (symlink !) |
|
702 | checklink-target (symlink !) | |
705 | branch2-base |
|
|||
706 | checkisexec |
|
|||
707 | checklink |
|
|||
708 | checklink-target |
|
|||
709 | hgtagsfnodes1 |
|
703 | hgtagsfnodes1 | |
710 | tags2-visible |
|
704 | tags2-visible | |
711 |
|
705 | |||
712 | $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1 |
|
706 | $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1 | |
713 | tagsclient/.hg/cache/hgtagsfnodes1: size=96 |
|
707 | tagsclient/.hg/cache/hgtagsfnodes1: size=96 | |
714 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
708 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
715 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
709 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
716 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
710 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
717 | 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
711 | 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
718 | 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....| |
|
712 | 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....| | |
719 | 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.| |
|
713 | 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.| | |
720 |
|
714 | |||
721 | Check that the bundle includes cache data |
|
715 | Check that the bundle includes cache data | |
722 |
|
716 | |||
723 | $ hg -R tagsclient bundle --all ./test-cache-in-bundle-all-rev.hg |
|
717 | $ hg -R tagsclient bundle --all ./test-cache-in-bundle-all-rev.hg | |
724 | 4 changesets found |
|
718 | 4 changesets found | |
725 | $ hg debugbundle ./test-cache-in-bundle-all-rev.hg |
|
719 | $ hg debugbundle ./test-cache-in-bundle-all-rev.hg | |
726 | Stream params: sortdict([('Compression', 'BZ')]) |
|
720 | Stream params: sortdict([('Compression', 'BZ')]) | |
727 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])" |
|
721 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])" | |
728 | 96ee1d7354c4ad7372047672c36a1f561e3a6a4c |
|
722 | 96ee1d7354c4ad7372047672c36a1f561e3a6a4c | |
729 | c4dab0c2fd337eb9191f80c3024830a4889a8f34 |
|
723 | c4dab0c2fd337eb9191f80c3024830a4889a8f34 | |
730 | f63cc8fe54e4d326f8d692805d70e092f851ddb1 |
|
724 | f63cc8fe54e4d326f8d692805d70e092f851ddb1 | |
731 | 40f0358cb314c824a5929ee527308d90e023bc10 |
|
725 | 40f0358cb314c824a5929ee527308d90e023bc10 | |
732 | hgtagsfnodes -- 'sortdict()' |
|
726 | hgtagsfnodes -- 'sortdict()' |
General Comments 0
You need to be logged in to leave comments.
Login now