##// END OF EJS Templates
upgrade: write nodemap for manifests too...
Pulkit Goyal -
r47275:63685334 default
parent child Browse files
Show More
@@ -1,556 +1,563 b''
1 # upgrade.py - functions for in place upgrade of Mercurial repository
1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 #
2 #
3 # Copyright (c) 2016-present, Gregory Szorc
3 # Copyright (c) 2016-present, Gregory Szorc
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import stat
10 import stat
11
11
12 from ..i18n import _
12 from ..i18n import _
13 from ..pycompat import getattr
13 from ..pycompat import getattr
14 from .. import (
14 from .. import (
15 changelog,
15 changelog,
16 error,
16 error,
17 filelog,
17 filelog,
18 manifest,
18 manifest,
19 metadata,
19 metadata,
20 pycompat,
20 pycompat,
21 requirements,
21 requirements,
22 revlog,
22 revlog,
23 scmutil,
23 scmutil,
24 util,
24 util,
25 vfs as vfsmod,
25 vfs as vfsmod,
26 )
26 )
27 from ..revlogutils import nodemap
27 from ..revlogutils import nodemap
28
28
29
29
30 def _revlogfrompath(repo, path):
30 def _revlogfrompath(repo, path):
31 """Obtain a revlog from a repo path.
31 """Obtain a revlog from a repo path.
32
32
33 An instance of the appropriate class is returned.
33 An instance of the appropriate class is returned.
34 """
34 """
35 if path == b'00changelog.i':
35 if path == b'00changelog.i':
36 return changelog.changelog(repo.svfs)
36 return changelog.changelog(repo.svfs)
37 elif path.endswith(b'00manifest.i'):
37 elif path.endswith(b'00manifest.i'):
38 mandir = path[: -len(b'00manifest.i')]
38 mandir = path[: -len(b'00manifest.i')]
39 return manifest.manifestrevlog(repo.svfs, tree=mandir)
39 return manifest.manifestrevlog(repo.svfs, tree=mandir)
40 else:
40 else:
41 # reverse of "/".join(("data", path + ".i"))
41 # reverse of "/".join(("data", path + ".i"))
42 return filelog.filelog(repo.svfs, path[5:-2])
42 return filelog.filelog(repo.svfs, path[5:-2])
43
43
44
44
45 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
45 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
46 """copy all relevant files for `oldrl` into `destrepo` store
46 """copy all relevant files for `oldrl` into `destrepo` store
47
47
48 Files are copied "as is" without any transformation. The copy is performed
48 Files are copied "as is" without any transformation. The copy is performed
49 without extra checks. Callers are responsible for making sure the copied
49 without extra checks. Callers are responsible for making sure the copied
50 content is compatible with format of the destination repository.
50 content is compatible with format of the destination repository.
51 """
51 """
52 oldrl = getattr(oldrl, '_revlog', oldrl)
52 oldrl = getattr(oldrl, '_revlog', oldrl)
53 newrl = _revlogfrompath(destrepo, unencodedname)
53 newrl = _revlogfrompath(destrepo, unencodedname)
54 newrl = getattr(newrl, '_revlog', newrl)
54 newrl = getattr(newrl, '_revlog', newrl)
55
55
56 oldvfs = oldrl.opener
56 oldvfs = oldrl.opener
57 newvfs = newrl.opener
57 newvfs = newrl.opener
58 oldindex = oldvfs.join(oldrl.indexfile)
58 oldindex = oldvfs.join(oldrl.indexfile)
59 newindex = newvfs.join(newrl.indexfile)
59 newindex = newvfs.join(newrl.indexfile)
60 olddata = oldvfs.join(oldrl.datafile)
60 olddata = oldvfs.join(oldrl.datafile)
61 newdata = newvfs.join(newrl.datafile)
61 newdata = newvfs.join(newrl.datafile)
62
62
63 with newvfs(newrl.indexfile, b'w'):
63 with newvfs(newrl.indexfile, b'w'):
64 pass # create all the directories
64 pass # create all the directories
65
65
66 util.copyfile(oldindex, newindex)
66 util.copyfile(oldindex, newindex)
67 copydata = oldrl.opener.exists(oldrl.datafile)
67 copydata = oldrl.opener.exists(oldrl.datafile)
68 if copydata:
68 if copydata:
69 util.copyfile(olddata, newdata)
69 util.copyfile(olddata, newdata)
70
70
71 if not (
71 if not (
72 unencodedname.endswith(b'00changelog.i')
72 unencodedname.endswith(b'00changelog.i')
73 or unencodedname.endswith(b'00manifest.i')
73 or unencodedname.endswith(b'00manifest.i')
74 ):
74 ):
75 destrepo.svfs.fncache.add(unencodedname)
75 destrepo.svfs.fncache.add(unencodedname)
76 if copydata:
76 if copydata:
77 destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d')
77 destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d')
78
78
79
79
80 UPGRADE_CHANGELOG = b"changelog"
80 UPGRADE_CHANGELOG = b"changelog"
81 UPGRADE_MANIFEST = b"manifest"
81 UPGRADE_MANIFEST = b"manifest"
82 UPGRADE_FILELOGS = b"all-filelogs"
82 UPGRADE_FILELOGS = b"all-filelogs"
83
83
84 UPGRADE_ALL_REVLOGS = frozenset(
84 UPGRADE_ALL_REVLOGS = frozenset(
85 [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOGS]
85 [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOGS]
86 )
86 )
87
87
88
88
89 def getsidedatacompanion(srcrepo, dstrepo):
89 def getsidedatacompanion(srcrepo, dstrepo):
90 sidedatacompanion = None
90 sidedatacompanion = None
91 removedreqs = srcrepo.requirements - dstrepo.requirements
91 removedreqs = srcrepo.requirements - dstrepo.requirements
92 addedreqs = dstrepo.requirements - srcrepo.requirements
92 addedreqs = dstrepo.requirements - srcrepo.requirements
93 if requirements.SIDEDATA_REQUIREMENT in removedreqs:
93 if requirements.SIDEDATA_REQUIREMENT in removedreqs:
94
94
95 def sidedatacompanion(rl, rev):
95 def sidedatacompanion(rl, rev):
96 rl = getattr(rl, '_revlog', rl)
96 rl = getattr(rl, '_revlog', rl)
97 if rl.flags(rev) & revlog.REVIDX_SIDEDATA:
97 if rl.flags(rev) & revlog.REVIDX_SIDEDATA:
98 return True, (), {}, 0, 0
98 return True, (), {}, 0, 0
99 return False, (), {}, 0, 0
99 return False, (), {}, 0, 0
100
100
101 elif requirements.COPIESSDC_REQUIREMENT in addedreqs:
101 elif requirements.COPIESSDC_REQUIREMENT in addedreqs:
102 sidedatacompanion = metadata.getsidedataadder(srcrepo, dstrepo)
102 sidedatacompanion = metadata.getsidedataadder(srcrepo, dstrepo)
103 elif requirements.COPIESSDC_REQUIREMENT in removedreqs:
103 elif requirements.COPIESSDC_REQUIREMENT in removedreqs:
104 sidedatacompanion = metadata.getsidedataremover(srcrepo, dstrepo)
104 sidedatacompanion = metadata.getsidedataremover(srcrepo, dstrepo)
105 return sidedatacompanion
105 return sidedatacompanion
106
106
107
107
108 def matchrevlog(revlogfilter, entry):
108 def matchrevlog(revlogfilter, entry):
109 """check if a revlog is selected for cloning.
109 """check if a revlog is selected for cloning.
110
110
111 In other words, are there any updates which need to be done on revlog
111 In other words, are there any updates which need to be done on revlog
112 or it can be blindly copied.
112 or it can be blindly copied.
113
113
114 The store entry is checked against the passed filter"""
114 The store entry is checked against the passed filter"""
115 if entry.endswith(b'00changelog.i'):
115 if entry.endswith(b'00changelog.i'):
116 return UPGRADE_CHANGELOG in revlogfilter
116 return UPGRADE_CHANGELOG in revlogfilter
117 elif entry.endswith(b'00manifest.i'):
117 elif entry.endswith(b'00manifest.i'):
118 return UPGRADE_MANIFEST in revlogfilter
118 return UPGRADE_MANIFEST in revlogfilter
119 return UPGRADE_FILELOGS in revlogfilter
119 return UPGRADE_FILELOGS in revlogfilter
120
120
121
121
122 def _perform_clone(
122 def _perform_clone(
123 ui,
123 ui,
124 dstrepo,
124 dstrepo,
125 tr,
125 tr,
126 old_revlog,
126 old_revlog,
127 unencoded,
127 unencoded,
128 upgrade_op,
128 upgrade_op,
129 sidedatacompanion,
129 sidedatacompanion,
130 oncopiedrevision,
130 oncopiedrevision,
131 ):
131 ):
132 """ returns the new revlog object created"""
132 """ returns the new revlog object created"""
133 newrl = None
133 newrl = None
134 if matchrevlog(upgrade_op.revlogs_to_process, unencoded):
134 if matchrevlog(upgrade_op.revlogs_to_process, unencoded):
135 ui.note(
135 ui.note(
136 _(b'cloning %d revisions from %s\n') % (len(old_revlog), unencoded)
136 _(b'cloning %d revisions from %s\n') % (len(old_revlog), unencoded)
137 )
137 )
138 newrl = _revlogfrompath(dstrepo, unencoded)
138 newrl = _revlogfrompath(dstrepo, unencoded)
139 old_revlog.clone(
139 old_revlog.clone(
140 tr,
140 tr,
141 newrl,
141 newrl,
142 addrevisioncb=oncopiedrevision,
142 addrevisioncb=oncopiedrevision,
143 deltareuse=upgrade_op.delta_reuse_mode,
143 deltareuse=upgrade_op.delta_reuse_mode,
144 forcedeltabothparents=upgrade_op.force_re_delta_both_parents,
144 forcedeltabothparents=upgrade_op.force_re_delta_both_parents,
145 sidedatacompanion=sidedatacompanion,
145 sidedatacompanion=sidedatacompanion,
146 )
146 )
147 else:
147 else:
148 msg = _(b'blindly copying %s containing %i revisions\n')
148 msg = _(b'blindly copying %s containing %i revisions\n')
149 ui.note(msg % (unencoded, len(old_revlog)))
149 ui.note(msg % (unencoded, len(old_revlog)))
150 _copyrevlog(tr, dstrepo, old_revlog, unencoded)
150 _copyrevlog(tr, dstrepo, old_revlog, unencoded)
151
151
152 newrl = _revlogfrompath(dstrepo, unencoded)
152 newrl = _revlogfrompath(dstrepo, unencoded)
153 return newrl
153 return newrl
154
154
155
155
156 def _clonerevlogs(
156 def _clonerevlogs(
157 ui,
157 ui,
158 srcrepo,
158 srcrepo,
159 dstrepo,
159 dstrepo,
160 tr,
160 tr,
161 upgrade_op,
161 upgrade_op,
162 ):
162 ):
163 """Copy revlogs between 2 repos."""
163 """Copy revlogs between 2 repos."""
164 revcount = 0
164 revcount = 0
165 srcsize = 0
165 srcsize = 0
166 srcrawsize = 0
166 srcrawsize = 0
167 dstsize = 0
167 dstsize = 0
168 fcount = 0
168 fcount = 0
169 frevcount = 0
169 frevcount = 0
170 fsrcsize = 0
170 fsrcsize = 0
171 frawsize = 0
171 frawsize = 0
172 fdstsize = 0
172 fdstsize = 0
173 mcount = 0
173 mcount = 0
174 mrevcount = 0
174 mrevcount = 0
175 msrcsize = 0
175 msrcsize = 0
176 mrawsize = 0
176 mrawsize = 0
177 mdstsize = 0
177 mdstsize = 0
178 crevcount = 0
178 crevcount = 0
179 csrcsize = 0
179 csrcsize = 0
180 crawsize = 0
180 crawsize = 0
181 cdstsize = 0
181 cdstsize = 0
182
182
183 alldatafiles = list(srcrepo.store.walk())
183 alldatafiles = list(srcrepo.store.walk())
184 # mapping of data files which needs to be cloned
184 # mapping of data files which needs to be cloned
185 # key is unencoded filename
185 # key is unencoded filename
186 # value is revlog_object_from_srcrepo
186 # value is revlog_object_from_srcrepo
187 manifests = {}
187 manifests = {}
188 changelogs = {}
188 changelogs = {}
189 filelogs = {}
189 filelogs = {}
190
190
191 # Perform a pass to collect metadata. This validates we can open all
191 # Perform a pass to collect metadata. This validates we can open all
192 # source files and allows a unified progress bar to be displayed.
192 # source files and allows a unified progress bar to be displayed.
193 for unencoded, encoded, size in alldatafiles:
193 for unencoded, encoded, size in alldatafiles:
194 if not unencoded.endswith(b'.i'):
194 if not unencoded.endswith(b'.i'):
195 continue
195 continue
196
196
197 rl = _revlogfrompath(srcrepo, unencoded)
197 rl = _revlogfrompath(srcrepo, unencoded)
198
198
199 info = rl.storageinfo(
199 info = rl.storageinfo(
200 exclusivefiles=True,
200 exclusivefiles=True,
201 revisionscount=True,
201 revisionscount=True,
202 trackedsize=True,
202 trackedsize=True,
203 storedsize=True,
203 storedsize=True,
204 )
204 )
205
205
206 revcount += info[b'revisionscount'] or 0
206 revcount += info[b'revisionscount'] or 0
207 datasize = info[b'storedsize'] or 0
207 datasize = info[b'storedsize'] or 0
208 rawsize = info[b'trackedsize'] or 0
208 rawsize = info[b'trackedsize'] or 0
209
209
210 srcsize += datasize
210 srcsize += datasize
211 srcrawsize += rawsize
211 srcrawsize += rawsize
212
212
213 # This is for the separate progress bars.
213 # This is for the separate progress bars.
214 if isinstance(rl, changelog.changelog):
214 if isinstance(rl, changelog.changelog):
215 changelogs[unencoded] = rl
215 changelogs[unencoded] = rl
216 crevcount += len(rl)
216 crevcount += len(rl)
217 csrcsize += datasize
217 csrcsize += datasize
218 crawsize += rawsize
218 crawsize += rawsize
219 elif isinstance(rl, manifest.manifestrevlog):
219 elif isinstance(rl, manifest.manifestrevlog):
220 manifests[unencoded] = rl
220 manifests[unencoded] = rl
221 mcount += 1
221 mcount += 1
222 mrevcount += len(rl)
222 mrevcount += len(rl)
223 msrcsize += datasize
223 msrcsize += datasize
224 mrawsize += rawsize
224 mrawsize += rawsize
225 elif isinstance(rl, filelog.filelog):
225 elif isinstance(rl, filelog.filelog):
226 filelogs[unencoded] = rl
226 filelogs[unencoded] = rl
227 fcount += 1
227 fcount += 1
228 frevcount += len(rl)
228 frevcount += len(rl)
229 fsrcsize += datasize
229 fsrcsize += datasize
230 frawsize += rawsize
230 frawsize += rawsize
231 else:
231 else:
232 error.ProgrammingError(b'unknown revlog type')
232 error.ProgrammingError(b'unknown revlog type')
233
233
234 if not revcount:
234 if not revcount:
235 return
235 return
236
236
237 ui.status(
237 ui.status(
238 _(
238 _(
239 b'migrating %d total revisions (%d in filelogs, %d in manifests, '
239 b'migrating %d total revisions (%d in filelogs, %d in manifests, '
240 b'%d in changelog)\n'
240 b'%d in changelog)\n'
241 )
241 )
242 % (revcount, frevcount, mrevcount, crevcount)
242 % (revcount, frevcount, mrevcount, crevcount)
243 )
243 )
244 ui.status(
244 ui.status(
245 _(b'migrating %s in store; %s tracked data\n')
245 _(b'migrating %s in store; %s tracked data\n')
246 % ((util.bytecount(srcsize), util.bytecount(srcrawsize)))
246 % ((util.bytecount(srcsize), util.bytecount(srcrawsize)))
247 )
247 )
248
248
249 # Used to keep track of progress.
249 # Used to keep track of progress.
250 progress = None
250 progress = None
251
251
252 def oncopiedrevision(rl, rev, node):
252 def oncopiedrevision(rl, rev, node):
253 progress.increment()
253 progress.increment()
254
254
255 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
255 sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
256
256
257 # Migrating filelogs
257 # Migrating filelogs
258 ui.status(
258 ui.status(
259 _(
259 _(
260 b'migrating %d filelogs containing %d revisions '
260 b'migrating %d filelogs containing %d revisions '
261 b'(%s in store; %s tracked data)\n'
261 b'(%s in store; %s tracked data)\n'
262 )
262 )
263 % (
263 % (
264 fcount,
264 fcount,
265 frevcount,
265 frevcount,
266 util.bytecount(fsrcsize),
266 util.bytecount(fsrcsize),
267 util.bytecount(frawsize),
267 util.bytecount(frawsize),
268 )
268 )
269 )
269 )
270 progress = srcrepo.ui.makeprogress(_(b'file revisions'), total=frevcount)
270 progress = srcrepo.ui.makeprogress(_(b'file revisions'), total=frevcount)
271 for unencoded, oldrl in sorted(filelogs.items()):
271 for unencoded, oldrl in sorted(filelogs.items()):
272 newrl = _perform_clone(
272 newrl = _perform_clone(
273 ui,
273 ui,
274 dstrepo,
274 dstrepo,
275 tr,
275 tr,
276 oldrl,
276 oldrl,
277 unencoded,
277 unencoded,
278 upgrade_op,
278 upgrade_op,
279 sidedatacompanion,
279 sidedatacompanion,
280 oncopiedrevision,
280 oncopiedrevision,
281 )
281 )
282 info = newrl.storageinfo(storedsize=True)
282 info = newrl.storageinfo(storedsize=True)
283 fdstsize += info[b'storedsize'] or 0
283 fdstsize += info[b'storedsize'] or 0
284 ui.status(
284 ui.status(
285 _(
285 _(
286 b'finished migrating %d filelog revisions across %d '
286 b'finished migrating %d filelog revisions across %d '
287 b'filelogs; change in size: %s\n'
287 b'filelogs; change in size: %s\n'
288 )
288 )
289 % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
289 % (frevcount, fcount, util.bytecount(fdstsize - fsrcsize))
290 )
290 )
291
291
292 # Migrating manifests
292 # Migrating manifests
293 ui.status(
293 ui.status(
294 _(
294 _(
295 b'migrating %d manifests containing %d revisions '
295 b'migrating %d manifests containing %d revisions '
296 b'(%s in store; %s tracked data)\n'
296 b'(%s in store; %s tracked data)\n'
297 )
297 )
298 % (
298 % (
299 mcount,
299 mcount,
300 mrevcount,
300 mrevcount,
301 util.bytecount(msrcsize),
301 util.bytecount(msrcsize),
302 util.bytecount(mrawsize),
302 util.bytecount(mrawsize),
303 )
303 )
304 )
304 )
305 if progress:
305 if progress:
306 progress.complete()
306 progress.complete()
307 progress = srcrepo.ui.makeprogress(
307 progress = srcrepo.ui.makeprogress(
308 _(b'manifest revisions'), total=mrevcount
308 _(b'manifest revisions'), total=mrevcount
309 )
309 )
310 for unencoded, oldrl in sorted(manifests.items()):
310 for unencoded, oldrl in sorted(manifests.items()):
311 newrl = _perform_clone(
311 newrl = _perform_clone(
312 ui,
312 ui,
313 dstrepo,
313 dstrepo,
314 tr,
314 tr,
315 oldrl,
315 oldrl,
316 unencoded,
316 unencoded,
317 upgrade_op,
317 upgrade_op,
318 sidedatacompanion,
318 sidedatacompanion,
319 oncopiedrevision,
319 oncopiedrevision,
320 )
320 )
321 info = newrl.storageinfo(storedsize=True)
321 info = newrl.storageinfo(storedsize=True)
322 mdstsize += info[b'storedsize'] or 0
322 mdstsize += info[b'storedsize'] or 0
323 ui.status(
323 ui.status(
324 _(
324 _(
325 b'finished migrating %d manifest revisions across %d '
325 b'finished migrating %d manifest revisions across %d '
326 b'manifests; change in size: %s\n'
326 b'manifests; change in size: %s\n'
327 )
327 )
328 % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
328 % (mrevcount, mcount, util.bytecount(mdstsize - msrcsize))
329 )
329 )
330
330
331 # Migrating changelog
331 # Migrating changelog
332 ui.status(
332 ui.status(
333 _(
333 _(
334 b'migrating changelog containing %d revisions '
334 b'migrating changelog containing %d revisions '
335 b'(%s in store; %s tracked data)\n'
335 b'(%s in store; %s tracked data)\n'
336 )
336 )
337 % (
337 % (
338 crevcount,
338 crevcount,
339 util.bytecount(csrcsize),
339 util.bytecount(csrcsize),
340 util.bytecount(crawsize),
340 util.bytecount(crawsize),
341 )
341 )
342 )
342 )
343 if progress:
343 if progress:
344 progress.complete()
344 progress.complete()
345 progress = srcrepo.ui.makeprogress(
345 progress = srcrepo.ui.makeprogress(
346 _(b'changelog revisions'), total=crevcount
346 _(b'changelog revisions'), total=crevcount
347 )
347 )
348 for unencoded, oldrl in sorted(changelogs.items()):
348 for unencoded, oldrl in sorted(changelogs.items()):
349 newrl = _perform_clone(
349 newrl = _perform_clone(
350 ui,
350 ui,
351 dstrepo,
351 dstrepo,
352 tr,
352 tr,
353 oldrl,
353 oldrl,
354 unencoded,
354 unencoded,
355 upgrade_op,
355 upgrade_op,
356 sidedatacompanion,
356 sidedatacompanion,
357 oncopiedrevision,
357 oncopiedrevision,
358 )
358 )
359 info = newrl.storageinfo(storedsize=True)
359 info = newrl.storageinfo(storedsize=True)
360 cdstsize += info[b'storedsize'] or 0
360 cdstsize += info[b'storedsize'] or 0
361 progress.complete()
361 progress.complete()
362 ui.status(
362 ui.status(
363 _(
363 _(
364 b'finished migrating %d changelog revisions; change in size: '
364 b'finished migrating %d changelog revisions; change in size: '
365 b'%s\n'
365 b'%s\n'
366 )
366 )
367 % (crevcount, util.bytecount(cdstsize - csrcsize))
367 % (crevcount, util.bytecount(cdstsize - csrcsize))
368 )
368 )
369
369
370 dstsize = fdstsize + mdstsize + cdstsize
370 dstsize = fdstsize + mdstsize + cdstsize
371 ui.status(
371 ui.status(
372 _(
372 _(
373 b'finished migrating %d total revisions; total change in store '
373 b'finished migrating %d total revisions; total change in store '
374 b'size: %s\n'
374 b'size: %s\n'
375 )
375 )
376 % (revcount, util.bytecount(dstsize - srcsize))
376 % (revcount, util.bytecount(dstsize - srcsize))
377 )
377 )
378
378
379
379
380 def _files_to_copy_post_revlog_clone(srcrepo):
380 def _files_to_copy_post_revlog_clone(srcrepo):
381 """yields files which should be copied to destination after revlogs
381 """yields files which should be copied to destination after revlogs
382 are cloned"""
382 are cloned"""
383 for path, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
383 for path, kind, st in sorted(srcrepo.store.vfs.readdir(b'', stat=True)):
384 # don't copy revlogs as they are already cloned
384 # don't copy revlogs as they are already cloned
385 if path.endswith((b'.i', b'.d', b'.n', b'.nd')):
385 if path.endswith((b'.i', b'.d', b'.n', b'.nd')):
386 continue
386 continue
387 # Skip transaction related files.
387 # Skip transaction related files.
388 if path.startswith(b'undo'):
388 if path.startswith(b'undo'):
389 continue
389 continue
390 # Only copy regular files.
390 # Only copy regular files.
391 if kind != stat.S_IFREG:
391 if kind != stat.S_IFREG:
392 continue
392 continue
393 # Skip other skipped files.
393 # Skip other skipped files.
394 if path in (b'lock', b'fncache'):
394 if path in (b'lock', b'fncache'):
395 continue
395 continue
396 # TODO: should we skip cache too?
396 # TODO: should we skip cache too?
397
397
398 yield path
398 yield path
399
399
400
400
401 def _replacestores(currentrepo, upgradedrepo, backupvfs, upgrade_op):
401 def _replacestores(currentrepo, upgradedrepo, backupvfs, upgrade_op):
402 """Replace the stores after current repository is upgraded
402 """Replace the stores after current repository is upgraded
403
403
404 Creates a backup of current repository store at backup path
404 Creates a backup of current repository store at backup path
405 Replaces upgraded store files in current repo from upgraded one
405 Replaces upgraded store files in current repo from upgraded one
406
406
407 Arguments:
407 Arguments:
408 currentrepo: repo object of current repository
408 currentrepo: repo object of current repository
409 upgradedrepo: repo object of the upgraded data
409 upgradedrepo: repo object of the upgraded data
410 backupvfs: vfs object for the backup path
410 backupvfs: vfs object for the backup path
411 upgrade_op: upgrade operation object
411 upgrade_op: upgrade operation object
412 to be used to decide what all is upgraded
412 to be used to decide what all is upgraded
413 """
413 """
414 # TODO: don't blindly rename everything in store
414 # TODO: don't blindly rename everything in store
415 # There can be upgrades where store is not touched at all
415 # There can be upgrades where store is not touched at all
416 if upgrade_op.backup_store:
416 if upgrade_op.backup_store:
417 util.rename(currentrepo.spath, backupvfs.join(b'store'))
417 util.rename(currentrepo.spath, backupvfs.join(b'store'))
418 else:
418 else:
419 currentrepo.vfs.rmtree(b'store', forcibly=True)
419 currentrepo.vfs.rmtree(b'store', forcibly=True)
420 util.rename(upgradedrepo.spath, currentrepo.spath)
420 util.rename(upgradedrepo.spath, currentrepo.spath)
421
421
422
422
423 def finishdatamigration(ui, srcrepo, dstrepo, requirements):
423 def finishdatamigration(ui, srcrepo, dstrepo, requirements):
424 """Hook point for extensions to perform additional actions during upgrade.
424 """Hook point for extensions to perform additional actions during upgrade.
425
425
426 This function is called after revlogs and store files have been copied but
426 This function is called after revlogs and store files have been copied but
427 before the new store is swapped into the original location.
427 before the new store is swapped into the original location.
428 """
428 """
429
429
430
430
431 def upgrade(ui, srcrepo, dstrepo, upgrade_op):
431 def upgrade(ui, srcrepo, dstrepo, upgrade_op):
432 """Do the low-level work of upgrading a repository.
432 """Do the low-level work of upgrading a repository.
433
433
434 The upgrade is effectively performed as a copy between a source
434 The upgrade is effectively performed as a copy between a source
435 repository and a temporary destination repository.
435 repository and a temporary destination repository.
436
436
437 The source repository is unmodified for as long as possible so the
437 The source repository is unmodified for as long as possible so the
438 upgrade can abort at any time without causing loss of service for
438 upgrade can abort at any time without causing loss of service for
439 readers and without corrupting the source repository.
439 readers and without corrupting the source repository.
440 """
440 """
441 assert srcrepo.currentwlock()
441 assert srcrepo.currentwlock()
442 assert dstrepo.currentwlock()
442 assert dstrepo.currentwlock()
443 backuppath = None
443 backuppath = None
444 backupvfs = None
444 backupvfs = None
445
445
446 ui.status(
446 ui.status(
447 _(
447 _(
448 b'(it is safe to interrupt this process any time before '
448 b'(it is safe to interrupt this process any time before '
449 b'data migration completes)\n'
449 b'data migration completes)\n'
450 )
450 )
451 )
451 )
452
452
453 if upgrade_op.requirements_only:
453 if upgrade_op.requirements_only:
454 ui.status(_(b'upgrading repository requirements\n'))
454 ui.status(_(b'upgrading repository requirements\n'))
455 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
455 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
456 # if there is only one action and that is persistent nodemap upgrade
456 # if there is only one action and that is persistent nodemap upgrade
457 # directly write the nodemap file and update requirements instead of going
457 # directly write the nodemap file and update requirements instead of going
458 # through the whole cloning process
458 # through the whole cloning process
459 elif (
459 elif (
460 len(upgrade_op.upgrade_actions) == 1
460 len(upgrade_op.upgrade_actions) == 1
461 and b'persistent-nodemap' in upgrade_op._upgrade_actions_names
461 and b'persistent-nodemap' in upgrade_op._upgrade_actions_names
462 and not upgrade_op.removed_actions
462 and not upgrade_op.removed_actions
463 ):
463 ):
464 ui.status(
464 ui.status(
465 _(b'upgrading repository to use persistent nodemap feature\n')
465 _(b'upgrading repository to use persistent nodemap feature\n')
466 )
466 )
467 with srcrepo.transaction(b'upgrade') as tr:
467 with srcrepo.transaction(b'upgrade') as tr:
468 unfi = srcrepo.unfiltered()
468 unfi = srcrepo.unfiltered()
469 cl = unfi.changelog
469 cl = unfi.changelog
470 nodemap.persist_nodemap(tr, cl, force=True)
470 nodemap.persist_nodemap(tr, cl, force=True)
471 # we want to directly operate on the underlying revlog to force
472 # create a nodemap file. This is fine since this is upgrade code
473 # and it heavily relies on repository being revlog based
474 # hence accessing private attributes can be justified
475 nodemap.persist_nodemap(
476 tr, unfi.manifestlog._rootstore._revlog, force=True
477 )
471 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
478 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
472 else:
479 else:
473 with dstrepo.transaction(b'upgrade') as tr:
480 with dstrepo.transaction(b'upgrade') as tr:
474 _clonerevlogs(
481 _clonerevlogs(
475 ui,
482 ui,
476 srcrepo,
483 srcrepo,
477 dstrepo,
484 dstrepo,
478 tr,
485 tr,
479 upgrade_op,
486 upgrade_op,
480 )
487 )
481
488
482 # Now copy other files in the store directory.
489 # Now copy other files in the store directory.
483 for p in _files_to_copy_post_revlog_clone(srcrepo):
490 for p in _files_to_copy_post_revlog_clone(srcrepo):
484 srcrepo.ui.status(_(b'copying %s\n') % p)
491 srcrepo.ui.status(_(b'copying %s\n') % p)
485 src = srcrepo.store.rawvfs.join(p)
492 src = srcrepo.store.rawvfs.join(p)
486 dst = dstrepo.store.rawvfs.join(p)
493 dst = dstrepo.store.rawvfs.join(p)
487 util.copyfile(src, dst, copystat=True)
494 util.copyfile(src, dst, copystat=True)
488
495
489 finishdatamigration(ui, srcrepo, dstrepo, requirements)
496 finishdatamigration(ui, srcrepo, dstrepo, requirements)
490
497
491 ui.status(_(b'data fully upgraded in a temporary repository\n'))
498 ui.status(_(b'data fully upgraded in a temporary repository\n'))
492
499
493 if upgrade_op.backup_store:
500 if upgrade_op.backup_store:
494 backuppath = pycompat.mkdtemp(
501 backuppath = pycompat.mkdtemp(
495 prefix=b'upgradebackup.', dir=srcrepo.path
502 prefix=b'upgradebackup.', dir=srcrepo.path
496 )
503 )
497 backupvfs = vfsmod.vfs(backuppath)
504 backupvfs = vfsmod.vfs(backuppath)
498
505
499 # Make a backup of requires file first, as it is the first to be modified.
506 # Make a backup of requires file first, as it is the first to be modified.
500 util.copyfile(
507 util.copyfile(
501 srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires')
508 srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires')
502 )
509 )
503
510
504 # We install an arbitrary requirement that clients must not support
511 # We install an arbitrary requirement that clients must not support
505 # as a mechanism to lock out new clients during the data swap. This is
512 # as a mechanism to lock out new clients during the data swap. This is
506 # better than allowing a client to continue while the repository is in
513 # better than allowing a client to continue while the repository is in
507 # an inconsistent state.
514 # an inconsistent state.
508 ui.status(
515 ui.status(
509 _(
516 _(
510 b'marking source repository as being upgraded; clients will be '
517 b'marking source repository as being upgraded; clients will be '
511 b'unable to read from repository\n'
518 b'unable to read from repository\n'
512 )
519 )
513 )
520 )
514 scmutil.writereporequirements(
521 scmutil.writereporequirements(
515 srcrepo, srcrepo.requirements | {b'upgradeinprogress'}
522 srcrepo, srcrepo.requirements | {b'upgradeinprogress'}
516 )
523 )
517
524
518 ui.status(_(b'starting in-place swap of repository data\n'))
525 ui.status(_(b'starting in-place swap of repository data\n'))
519 if upgrade_op.backup_store:
526 if upgrade_op.backup_store:
520 ui.status(
527 ui.status(
521 _(b'replaced files will be backed up at %s\n') % backuppath
528 _(b'replaced files will be backed up at %s\n') % backuppath
522 )
529 )
523
530
524 # Now swap in the new store directory. Doing it as a rename should make
531 # Now swap in the new store directory. Doing it as a rename should make
525 # the operation nearly instantaneous and atomic (at least in well-behaved
532 # the operation nearly instantaneous and atomic (at least in well-behaved
526 # environments).
533 # environments).
527 ui.status(_(b'replacing store...\n'))
534 ui.status(_(b'replacing store...\n'))
528 tstart = util.timer()
535 tstart = util.timer()
529 _replacestores(srcrepo, dstrepo, backupvfs, upgrade_op)
536 _replacestores(srcrepo, dstrepo, backupvfs, upgrade_op)
530 elapsed = util.timer() - tstart
537 elapsed = util.timer() - tstart
531 ui.status(
538 ui.status(
532 _(
539 _(
533 b'store replacement complete; repository was inconsistent for '
540 b'store replacement complete; repository was inconsistent for '
534 b'%0.1fs\n'
541 b'%0.1fs\n'
535 )
542 )
536 % elapsed
543 % elapsed
537 )
544 )
538
545
539 # We first write the requirements file. Any new requirements will lock
546 # We first write the requirements file. Any new requirements will lock
540 # out legacy clients.
547 # out legacy clients.
541 ui.status(
548 ui.status(
542 _(
549 _(
543 b'finalizing requirements file and making repository readable '
550 b'finalizing requirements file and making repository readable '
544 b'again\n'
551 b'again\n'
545 )
552 )
546 )
553 )
547 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
554 scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements)
548
555
549 if upgrade_op.backup_store:
556 if upgrade_op.backup_store:
550 # The lock file from the old store won't be removed because nothing has a
557 # The lock file from the old store won't be removed because nothing has a
551 # reference to its new location. So clean it up manually. Alternatively, we
558 # reference to its new location. So clean it up manually. Alternatively, we
552 # could update srcrepo.svfs and other variables to point to the new
559 # could update srcrepo.svfs and other variables to point to the new
553 # location. This is simpler.
560 # location. This is simpler.
554 backupvfs.unlink(b'store/lock')
561 backupvfs.unlink(b'store/lock')
555
562
556 return backuppath
563 return backuppath
@@ -1,751 +1,753 b''
1 ===================================
1 ===================================
2 Test the persistent on-disk nodemap
2 Test the persistent on-disk nodemap
3 ===================================
3 ===================================
4
4
5 $ cat << EOF >> $HGRCPATH
5 $ cat << EOF >> $HGRCPATH
6 > [format]
6 > [format]
7 > use-persistent-nodemap=yes
7 > use-persistent-nodemap=yes
8 > [devel]
8 > [devel]
9 > persistent-nodemap=yes
9 > persistent-nodemap=yes
10 > EOF
10 > EOF
11
11
12 $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow
12 $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow
13 $ cd test-repo
13 $ cd test-repo
14
14
15 Check handling of the default slow-path value
15 Check handling of the default slow-path value
16
16
17 #if no-pure no-rust
17 #if no-pure no-rust
18
18
19 $ hg id
19 $ hg id
20 abort: accessing `persistent-nodemap` repository without associated fast implementation.
20 abort: accessing `persistent-nodemap` repository without associated fast implementation.
21 (check `hg help config.format.use-persistent-nodemap` for details)
21 (check `hg help config.format.use-persistent-nodemap` for details)
22 [255]
22 [255]
23
23
24 Unlock further check (we are here to test the feature)
24 Unlock further check (we are here to test the feature)
25
25
26 $ cat << EOF >> $HGRCPATH
26 $ cat << EOF >> $HGRCPATH
27 > [storage]
27 > [storage]
28 > # to avoid spamming the test
28 > # to avoid spamming the test
29 > revlog.persistent-nodemap.slow-path=allow
29 > revlog.persistent-nodemap.slow-path=allow
30 > EOF
30 > EOF
31
31
32 #endif
32 #endif
33
33
34 #if rust
34 #if rust
35
35
36 Regression test for a previous bug in Rust/C FFI for the `Revlog_CAPI` capsule:
36 Regression test for a previous bug in Rust/C FFI for the `Revlog_CAPI` capsule:
37 in places where `mercurial/cext/revlog.c` function signatures use `Py_ssize_t`
37 in places where `mercurial/cext/revlog.c` function signatures use `Py_ssize_t`
38 (64 bits on Linux x86_64), corresponding declarations in `rust/hg-cpython/src/cindex.rs`
38 (64 bits on Linux x86_64), corresponding declarations in `rust/hg-cpython/src/cindex.rs`
39 incorrectly used `libc::c_int` (32 bits).
39 incorrectly used `libc::c_int` (32 bits).
40 As a result, -1 passed from Rust for the null revision became 4294967295 in C.
40 As a result, -1 passed from Rust for the null revision became 4294967295 in C.
41
41
42 $ hg log -r 00000000
42 $ hg log -r 00000000
43 changeset: -1:000000000000
43 changeset: -1:000000000000
44 tag: tip
44 tag: tip
45 user:
45 user:
46 date: Thu Jan 01 00:00:00 1970 +0000
46 date: Thu Jan 01 00:00:00 1970 +0000
47
47
48
48
49 #endif
49 #endif
50
50
51
51
52 $ hg debugformat
52 $ hg debugformat
53 format-variant repo
53 format-variant repo
54 fncache: yes
54 fncache: yes
55 dotencode: yes
55 dotencode: yes
56 generaldelta: yes
56 generaldelta: yes
57 share-safe: no
57 share-safe: no
58 sparserevlog: yes
58 sparserevlog: yes
59 sidedata: no
59 sidedata: no
60 persistent-nodemap: yes
60 persistent-nodemap: yes
61 copies-sdc: no
61 copies-sdc: no
62 plain-cl-delta: yes
62 plain-cl-delta: yes
63 compression: zlib
63 compression: zlib
64 compression-level: default
64 compression-level: default
65 $ hg debugbuilddag .+5000 --new-file
65 $ hg debugbuilddag .+5000 --new-file
66
66
67 $ hg debugnodemap --metadata
67 $ hg debugnodemap --metadata
68 uid: ???????????????? (glob)
68 uid: ???????????????? (glob)
69 tip-rev: 5000
69 tip-rev: 5000
70 tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c
70 tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c
71 data-length: 121088
71 data-length: 121088
72 data-unused: 0
72 data-unused: 0
73 data-unused: 0.000%
73 data-unused: 0.000%
74 $ f --size .hg/store/00changelog.n
74 $ f --size .hg/store/00changelog.n
75 .hg/store/00changelog.n: size=70
75 .hg/store/00changelog.n: size=70
76
76
77 Simple lookup works
77 Simple lookup works
78
78
79 $ ANYNODE=`hg log --template '{node|short}\n' --rev tip`
79 $ ANYNODE=`hg log --template '{node|short}\n' --rev tip`
80 $ hg log -r "$ANYNODE" --template '{rev}\n'
80 $ hg log -r "$ANYNODE" --template '{rev}\n'
81 5000
81 5000
82
82
83
83
84 #if rust
84 #if rust
85
85
86 $ f --sha256 .hg/store/00changelog-*.nd
86 $ f --sha256 .hg/store/00changelog-*.nd
87 .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob)
87 .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob)
88
88
89 $ f --sha256 .hg/store/00manifest-*.nd
89 $ f --sha256 .hg/store/00manifest-*.nd
90 .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob)
90 .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob)
91 $ hg debugnodemap --dump-new | f --sha256 --size
91 $ hg debugnodemap --dump-new | f --sha256 --size
92 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
92 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
93 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
93 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
94 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
94 size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
95 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........|
95 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........|
96 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."|
96 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."|
97 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^|
97 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^|
98 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....|
98 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....|
99 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8|
99 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8|
100 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i|
100 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i|
101 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....|
101 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....|
102 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........|
102 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........|
103 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....|
103 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....|
104 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................|
104 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................|
105 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+|
105 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+|
106 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................|
106 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................|
107 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5|
107 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5|
108 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U|
108 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U|
109 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................|
109 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................|
110 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................|
110 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................|
111
111
112
112
113 #else
113 #else
114
114
115 $ f --sha256 .hg/store/00changelog-*.nd
115 $ f --sha256 .hg/store/00changelog-*.nd
116 .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob)
116 .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob)
117 $ hg debugnodemap --dump-new | f --sha256 --size
117 $ hg debugnodemap --dump-new | f --sha256 --size
118 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
118 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
119 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
119 $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
120 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
120 size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
121 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
121 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
122 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
122 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
123 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................|
123 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................|
124 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................|
124 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................|
125 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
125 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
126 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................|
126 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................|
127 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............|
127 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............|
128 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
128 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
129 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
129 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
130 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................|
130 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................|
131 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........|
131 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........|
132 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
132 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
133 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
133 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
134 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
134 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
135 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................|
135 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................|
136 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................|
136 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................|
137
137
138 #endif
138 #endif
139
139
140 $ hg debugnodemap --check
140 $ hg debugnodemap --check
141 revision in index: 5001
141 revision in index: 5001
142 revision in nodemap: 5001
142 revision in nodemap: 5001
143
143
144 add a new commit
144 add a new commit
145
145
146 $ hg up
146 $ hg up
147 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 $ echo foo > foo
148 $ echo foo > foo
149 $ hg add foo
149 $ hg add foo
150
150
151
151
152 Check slow-path config value handling
152 Check slow-path config value handling
153 -------------------------------------
153 -------------------------------------
154
154
155 #if no-pure no-rust
155 #if no-pure no-rust
156
156
157 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
157 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
158 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
158 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
159 falling back to default value: abort
159 falling back to default value: abort
160 abort: accessing `persistent-nodemap` repository without associated fast implementation.
160 abort: accessing `persistent-nodemap` repository without associated fast implementation.
161 (check `hg help config.format.use-persistent-nodemap` for details)
161 (check `hg help config.format.use-persistent-nodemap` for details)
162 [255]
162 [255]
163
163
164 $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn"
164 $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn"
165 warning: accessing `persistent-nodemap` repository without associated fast implementation.
165 warning: accessing `persistent-nodemap` repository without associated fast implementation.
166 (check `hg help config.format.use-persistent-nodemap` for details)
166 (check `hg help config.format.use-persistent-nodemap` for details)
167 changeset: 5000:6b02b8c7b966
167 changeset: 5000:6b02b8c7b966
168 tag: tip
168 tag: tip
169 user: debugbuilddag
169 user: debugbuilddag
170 date: Thu Jan 01 01:23:20 1970 +0000
170 date: Thu Jan 01 01:23:20 1970 +0000
171 summary: r5000
171 summary: r5000
172
172
173 $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort"
173 $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort"
174 abort: accessing `persistent-nodemap` repository without associated fast implementation.
174 abort: accessing `persistent-nodemap` repository without associated fast implementation.
175 (check `hg help config.format.use-persistent-nodemap` for details)
175 (check `hg help config.format.use-persistent-nodemap` for details)
176 [255]
176 [255]
177
177
178 #else
178 #else
179
179
180 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
180 $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
181 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
181 unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
182 falling back to default value: abort
182 falling back to default value: abort
183 6b02b8c7b966+ tip
183 6b02b8c7b966+ tip
184
184
185 #endif
185 #endif
186
186
187 $ hg ci -m 'foo'
187 $ hg ci -m 'foo'
188
188
189 #if no-pure no-rust
189 #if no-pure no-rust
190 $ hg debugnodemap --metadata
190 $ hg debugnodemap --metadata
191 uid: ???????????????? (glob)
191 uid: ???????????????? (glob)
192 tip-rev: 5001
192 tip-rev: 5001
193 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
193 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
194 data-length: 121088
194 data-length: 121088
195 data-unused: 0
195 data-unused: 0
196 data-unused: 0.000%
196 data-unused: 0.000%
197 #else
197 #else
198 $ hg debugnodemap --metadata
198 $ hg debugnodemap --metadata
199 uid: ???????????????? (glob)
199 uid: ???????????????? (glob)
200 tip-rev: 5001
200 tip-rev: 5001
201 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
201 tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
202 data-length: 121344
202 data-length: 121344
203 data-unused: 256
203 data-unused: 256
204 data-unused: 0.211%
204 data-unused: 0.211%
205 #endif
205 #endif
206
206
207 $ f --size .hg/store/00changelog.n
207 $ f --size .hg/store/00changelog.n
208 .hg/store/00changelog.n: size=70
208 .hg/store/00changelog.n: size=70
209
209
210 (The pure code use the debug code that perform incremental update, the C code reencode from scratch)
210 (The pure code use the debug code that perform incremental update, the C code reencode from scratch)
211
211
212 #if pure
212 #if pure
213 $ f --sha256 .hg/store/00changelog-*.nd --size
213 $ f --sha256 .hg/store/00changelog-*.nd --size
214 .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob)
214 .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob)
215 #endif
215 #endif
216
216
217 #if rust
217 #if rust
218 $ f --sha256 .hg/store/00changelog-*.nd --size
218 $ f --sha256 .hg/store/00changelog-*.nd --size
219 .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob)
219 .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob)
220 #endif
220 #endif
221
221
222 #if no-pure no-rust
222 #if no-pure no-rust
223 $ f --sha256 .hg/store/00changelog-*.nd --size
223 $ f --sha256 .hg/store/00changelog-*.nd --size
224 .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob)
224 .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob)
225 #endif
225 #endif
226
226
227 $ hg debugnodemap --check
227 $ hg debugnodemap --check
228 revision in index: 5002
228 revision in index: 5002
229 revision in nodemap: 5002
229 revision in nodemap: 5002
230
230
231 Test code path without mmap
231 Test code path without mmap
232 ---------------------------
232 ---------------------------
233
233
234 $ echo bar > bar
234 $ echo bar > bar
235 $ hg add bar
235 $ hg add bar
236 $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no
236 $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no
237
237
238 $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes
238 $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes
239 revision in index: 5003
239 revision in index: 5003
240 revision in nodemap: 5003
240 revision in nodemap: 5003
241 $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no
241 $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no
242 revision in index: 5003
242 revision in index: 5003
243 revision in nodemap: 5003
243 revision in nodemap: 5003
244
244
245
245
246 #if pure
246 #if pure
247 $ hg debugnodemap --metadata
247 $ hg debugnodemap --metadata
248 uid: ???????????????? (glob)
248 uid: ???????????????? (glob)
249 tip-rev: 5002
249 tip-rev: 5002
250 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
250 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
251 data-length: 121600
251 data-length: 121600
252 data-unused: 512
252 data-unused: 512
253 data-unused: 0.421%
253 data-unused: 0.421%
254 $ f --sha256 .hg/store/00changelog-*.nd --size
254 $ f --sha256 .hg/store/00changelog-*.nd --size
255 .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob)
255 .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob)
256 #endif
256 #endif
257 #if rust
257 #if rust
258 $ hg debugnodemap --metadata
258 $ hg debugnodemap --metadata
259 uid: ???????????????? (glob)
259 uid: ???????????????? (glob)
260 tip-rev: 5002
260 tip-rev: 5002
261 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
261 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
262 data-length: 121600
262 data-length: 121600
263 data-unused: 512
263 data-unused: 512
264 data-unused: 0.421%
264 data-unused: 0.421%
265 $ f --sha256 .hg/store/00changelog-*.nd --size
265 $ f --sha256 .hg/store/00changelog-*.nd --size
266 .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob)
266 .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob)
267 #endif
267 #endif
268 #if no-pure no-rust
268 #if no-pure no-rust
269 $ hg debugnodemap --metadata
269 $ hg debugnodemap --metadata
270 uid: ???????????????? (glob)
270 uid: ???????????????? (glob)
271 tip-rev: 5002
271 tip-rev: 5002
272 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
272 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
273 data-length: 121088
273 data-length: 121088
274 data-unused: 0
274 data-unused: 0
275 data-unused: 0.000%
275 data-unused: 0.000%
276 $ f --sha256 .hg/store/00changelog-*.nd --size
276 $ f --sha256 .hg/store/00changelog-*.nd --size
277 .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob)
277 .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob)
278 #endif
278 #endif
279
279
280 Test force warming the cache
280 Test force warming the cache
281
281
282 $ rm .hg/store/00changelog.n
282 $ rm .hg/store/00changelog.n
283 $ hg debugnodemap --metadata
283 $ hg debugnodemap --metadata
284 $ hg debugupdatecache
284 $ hg debugupdatecache
285 #if pure
285 #if pure
286 $ hg debugnodemap --metadata
286 $ hg debugnodemap --metadata
287 uid: ???????????????? (glob)
287 uid: ???????????????? (glob)
288 tip-rev: 5002
288 tip-rev: 5002
289 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
289 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
290 data-length: 121088
290 data-length: 121088
291 data-unused: 0
291 data-unused: 0
292 data-unused: 0.000%
292 data-unused: 0.000%
293 #else
293 #else
294 $ hg debugnodemap --metadata
294 $ hg debugnodemap --metadata
295 uid: ???????????????? (glob)
295 uid: ???????????????? (glob)
296 tip-rev: 5002
296 tip-rev: 5002
297 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
297 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
298 data-length: 121088
298 data-length: 121088
299 data-unused: 0
299 data-unused: 0
300 data-unused: 0.000%
300 data-unused: 0.000%
301 #endif
301 #endif
302
302
303 Check out of sync nodemap
303 Check out of sync nodemap
304 =========================
304 =========================
305
305
306 First copy old data on the side.
306 First copy old data on the side.
307
307
308 $ mkdir ../tmp-copies
308 $ mkdir ../tmp-copies
309 $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies
309 $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies
310
310
311 Nodemap lagging behind
311 Nodemap lagging behind
312 ----------------------
312 ----------------------
313
313
314 make a new commit
314 make a new commit
315
315
316 $ echo bar2 > bar
316 $ echo bar2 > bar
317 $ hg ci -m 'bar2'
317 $ hg ci -m 'bar2'
318 $ NODE=`hg log -r tip -T '{node}\n'`
318 $ NODE=`hg log -r tip -T '{node}\n'`
319 $ hg log -r "$NODE" -T '{rev}\n'
319 $ hg log -r "$NODE" -T '{rev}\n'
320 5003
320 5003
321
321
322 If the nodemap is lagging behind, it can catch up fine
322 If the nodemap is lagging behind, it can catch up fine
323
323
324 $ hg debugnodemap --metadata
324 $ hg debugnodemap --metadata
325 uid: ???????????????? (glob)
325 uid: ???????????????? (glob)
326 tip-rev: 5003
326 tip-rev: 5003
327 tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3
327 tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3
328 data-length: 121344 (pure !)
328 data-length: 121344 (pure !)
329 data-length: 121344 (rust !)
329 data-length: 121344 (rust !)
330 data-length: 121152 (no-rust no-pure !)
330 data-length: 121152 (no-rust no-pure !)
331 data-unused: 192 (pure !)
331 data-unused: 192 (pure !)
332 data-unused: 192 (rust !)
332 data-unused: 192 (rust !)
333 data-unused: 0 (no-rust no-pure !)
333 data-unused: 0 (no-rust no-pure !)
334 data-unused: 0.158% (pure !)
334 data-unused: 0.158% (pure !)
335 data-unused: 0.158% (rust !)
335 data-unused: 0.158% (rust !)
336 data-unused: 0.000% (no-rust no-pure !)
336 data-unused: 0.000% (no-rust no-pure !)
337 $ cp -f ../tmp-copies/* .hg/store/
337 $ cp -f ../tmp-copies/* .hg/store/
338 $ hg debugnodemap --metadata
338 $ hg debugnodemap --metadata
339 uid: ???????????????? (glob)
339 uid: ???????????????? (glob)
340 tip-rev: 5002
340 tip-rev: 5002
341 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
341 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
342 data-length: 121088
342 data-length: 121088
343 data-unused: 0
343 data-unused: 0
344 data-unused: 0.000%
344 data-unused: 0.000%
345 $ hg log -r "$NODE" -T '{rev}\n'
345 $ hg log -r "$NODE" -T '{rev}\n'
346 5003
346 5003
347
347
348 changelog altered
348 changelog altered
349 -----------------
349 -----------------
350
350
351 If the nodemap is not gated behind a requirements, an unaware client can alter
351 If the nodemap is not gated behind a requirements, an unaware client can alter
352 the repository so the revlog used to generate the nodemap is not longer
352 the repository so the revlog used to generate the nodemap is not longer
353 compatible with the persistent nodemap. We need to detect that.
353 compatible with the persistent nodemap. We need to detect that.
354
354
355 $ hg up "$NODE~5"
355 $ hg up "$NODE~5"
356 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
356 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
357 $ echo bar > babar
357 $ echo bar > babar
358 $ hg add babar
358 $ hg add babar
359 $ hg ci -m 'babar'
359 $ hg ci -m 'babar'
360 created new head
360 created new head
361 $ OTHERNODE=`hg log -r tip -T '{node}\n'`
361 $ OTHERNODE=`hg log -r tip -T '{node}\n'`
362 $ hg log -r "$OTHERNODE" -T '{rev}\n'
362 $ hg log -r "$OTHERNODE" -T '{rev}\n'
363 5004
363 5004
364
364
365 $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup
365 $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup
366
366
367 the nodemap should detect the changelog have been tampered with and recover.
367 the nodemap should detect the changelog have been tampered with and recover.
368
368
369 $ hg debugnodemap --metadata
369 $ hg debugnodemap --metadata
370 uid: ???????????????? (glob)
370 uid: ???????????????? (glob)
371 tip-rev: 5002
371 tip-rev: 5002
372 tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
372 tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
373 data-length: 121536 (pure !)
373 data-length: 121536 (pure !)
374 data-length: 121088 (rust !)
374 data-length: 121088 (rust !)
375 data-length: 121088 (no-pure no-rust !)
375 data-length: 121088 (no-pure no-rust !)
376 data-unused: 448 (pure !)
376 data-unused: 448 (pure !)
377 data-unused: 0 (rust !)
377 data-unused: 0 (rust !)
378 data-unused: 0 (no-pure no-rust !)
378 data-unused: 0 (no-pure no-rust !)
379 data-unused: 0.000% (rust !)
379 data-unused: 0.000% (rust !)
380 data-unused: 0.369% (pure !)
380 data-unused: 0.369% (pure !)
381 data-unused: 0.000% (no-pure no-rust !)
381 data-unused: 0.000% (no-pure no-rust !)
382
382
383 $ cp -f ../tmp-copies/* .hg/store/
383 $ cp -f ../tmp-copies/* .hg/store/
384 $ hg debugnodemap --metadata
384 $ hg debugnodemap --metadata
385 uid: ???????????????? (glob)
385 uid: ???????????????? (glob)
386 tip-rev: 5002
386 tip-rev: 5002
387 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
387 tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
388 data-length: 121088
388 data-length: 121088
389 data-unused: 0
389 data-unused: 0
390 data-unused: 0.000%
390 data-unused: 0.000%
391 $ hg log -r "$OTHERNODE" -T '{rev}\n'
391 $ hg log -r "$OTHERNODE" -T '{rev}\n'
392 5002
392 5002
393
393
394 missing data file
394 missing data file
395 -----------------
395 -----------------
396
396
397 $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \
397 $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \
398 > sed 's/uid: //'`
398 > sed 's/uid: //'`
399 $ FILE=.hg/store/00changelog-"${UUID}".nd
399 $ FILE=.hg/store/00changelog-"${UUID}".nd
400 $ mv $FILE ../tmp-data-file
400 $ mv $FILE ../tmp-data-file
401 $ cp .hg/store/00changelog.n ../tmp-docket
401 $ cp .hg/store/00changelog.n ../tmp-docket
402
402
403 mercurial don't crash
403 mercurial don't crash
404
404
405 $ hg log -r .
405 $ hg log -r .
406 changeset: 5002:b355ef8adce0
406 changeset: 5002:b355ef8adce0
407 tag: tip
407 tag: tip
408 parent: 4998:d918ad6d18d3
408 parent: 4998:d918ad6d18d3
409 user: test
409 user: test
410 date: Thu Jan 01 00:00:00 1970 +0000
410 date: Thu Jan 01 00:00:00 1970 +0000
411 summary: babar
411 summary: babar
412
412
413 $ hg debugnodemap --metadata
413 $ hg debugnodemap --metadata
414
414
415 $ hg debugupdatecache
415 $ hg debugupdatecache
416 $ hg debugnodemap --metadata
416 $ hg debugnodemap --metadata
417 uid: * (glob)
417 uid: * (glob)
418 tip-rev: 5002
418 tip-rev: 5002
419 tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
419 tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
420 data-length: 121088
420 data-length: 121088
421 data-unused: 0
421 data-unused: 0
422 data-unused: 0.000%
422 data-unused: 0.000%
423 $ mv ../tmp-data-file $FILE
423 $ mv ../tmp-data-file $FILE
424 $ mv ../tmp-docket .hg/store/00changelog.n
424 $ mv ../tmp-docket .hg/store/00changelog.n
425
425
426 Check transaction related property
426 Check transaction related property
427 ==================================
427 ==================================
428
428
429 An up to date nodemap should be available to shell hooks,
429 An up to date nodemap should be available to shell hooks,
430
430
431 $ echo dsljfl > a
431 $ echo dsljfl > a
432 $ hg add a
432 $ hg add a
433 $ hg ci -m a
433 $ hg ci -m a
434 $ hg debugnodemap --metadata
434 $ hg debugnodemap --metadata
435 uid: ???????????????? (glob)
435 uid: ???????????????? (glob)
436 tip-rev: 5003
436 tip-rev: 5003
437 tip-node: a52c5079765b5865d97b993b303a18740113bbb2
437 tip-node: a52c5079765b5865d97b993b303a18740113bbb2
438 data-length: 121088
438 data-length: 121088
439 data-unused: 0
439 data-unused: 0
440 data-unused: 0.000%
440 data-unused: 0.000%
441 $ echo babar2 > babar
441 $ echo babar2 > babar
442 $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata"
442 $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata"
443 uid: ???????????????? (glob)
443 uid: ???????????????? (glob)
444 tip-rev: 5004
444 tip-rev: 5004
445 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
445 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
446 data-length: 121280 (pure !)
446 data-length: 121280 (pure !)
447 data-length: 121280 (rust !)
447 data-length: 121280 (rust !)
448 data-length: 121088 (no-pure no-rust !)
448 data-length: 121088 (no-pure no-rust !)
449 data-unused: 192 (pure !)
449 data-unused: 192 (pure !)
450 data-unused: 192 (rust !)
450 data-unused: 192 (rust !)
451 data-unused: 0 (no-pure no-rust !)
451 data-unused: 0 (no-pure no-rust !)
452 data-unused: 0.158% (pure !)
452 data-unused: 0.158% (pure !)
453 data-unused: 0.158% (rust !)
453 data-unused: 0.158% (rust !)
454 data-unused: 0.000% (no-pure no-rust !)
454 data-unused: 0.000% (no-pure no-rust !)
455 $ hg debugnodemap --metadata
455 $ hg debugnodemap --metadata
456 uid: ???????????????? (glob)
456 uid: ???????????????? (glob)
457 tip-rev: 5004
457 tip-rev: 5004
458 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
458 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
459 data-length: 121280 (pure !)
459 data-length: 121280 (pure !)
460 data-length: 121280 (rust !)
460 data-length: 121280 (rust !)
461 data-length: 121088 (no-pure no-rust !)
461 data-length: 121088 (no-pure no-rust !)
462 data-unused: 192 (pure !)
462 data-unused: 192 (pure !)
463 data-unused: 192 (rust !)
463 data-unused: 192 (rust !)
464 data-unused: 0 (no-pure no-rust !)
464 data-unused: 0 (no-pure no-rust !)
465 data-unused: 0.158% (pure !)
465 data-unused: 0.158% (pure !)
466 data-unused: 0.158% (rust !)
466 data-unused: 0.158% (rust !)
467 data-unused: 0.000% (no-pure no-rust !)
467 data-unused: 0.000% (no-pure no-rust !)
468
468
469 Another process does not see the pending nodemap content during run.
469 Another process does not see the pending nodemap content during run.
470
470
471 $ PATH=$RUNTESTDIR/testlib/:$PATH
471 $ PATH=$RUNTESTDIR/testlib/:$PATH
472 $ echo qpoasp > a
472 $ echo qpoasp > a
473 $ hg ci -m a2 \
473 $ hg ci -m a2 \
474 > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
474 > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
475 > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
475 > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
476
476
477 (read the repository while the commit transaction is pending)
477 (read the repository while the commit transaction is pending)
478
478
479 $ wait-on-file 20 sync-txn-pending && \
479 $ wait-on-file 20 sync-txn-pending && \
480 > hg debugnodemap --metadata && \
480 > hg debugnodemap --metadata && \
481 > wait-on-file 20 sync-txn-close sync-repo-read
481 > wait-on-file 20 sync-txn-close sync-repo-read
482 uid: ???????????????? (glob)
482 uid: ???????????????? (glob)
483 tip-rev: 5004
483 tip-rev: 5004
484 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
484 tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
485 data-length: 121280 (pure !)
485 data-length: 121280 (pure !)
486 data-length: 121280 (rust !)
486 data-length: 121280 (rust !)
487 data-length: 121088 (no-pure no-rust !)
487 data-length: 121088 (no-pure no-rust !)
488 data-unused: 192 (pure !)
488 data-unused: 192 (pure !)
489 data-unused: 192 (rust !)
489 data-unused: 192 (rust !)
490 data-unused: 0 (no-pure no-rust !)
490 data-unused: 0 (no-pure no-rust !)
491 data-unused: 0.158% (pure !)
491 data-unused: 0.158% (pure !)
492 data-unused: 0.158% (rust !)
492 data-unused: 0.158% (rust !)
493 data-unused: 0.000% (no-pure no-rust !)
493 data-unused: 0.000% (no-pure no-rust !)
494 $ hg debugnodemap --metadata
494 $ hg debugnodemap --metadata
495 uid: ???????????????? (glob)
495 uid: ???????????????? (glob)
496 tip-rev: 5005
496 tip-rev: 5005
497 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
497 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
498 data-length: 121536 (pure !)
498 data-length: 121536 (pure !)
499 data-length: 121536 (rust !)
499 data-length: 121536 (rust !)
500 data-length: 121088 (no-pure no-rust !)
500 data-length: 121088 (no-pure no-rust !)
501 data-unused: 448 (pure !)
501 data-unused: 448 (pure !)
502 data-unused: 448 (rust !)
502 data-unused: 448 (rust !)
503 data-unused: 0 (no-pure no-rust !)
503 data-unused: 0 (no-pure no-rust !)
504 data-unused: 0.369% (pure !)
504 data-unused: 0.369% (pure !)
505 data-unused: 0.369% (rust !)
505 data-unused: 0.369% (rust !)
506 data-unused: 0.000% (no-pure no-rust !)
506 data-unused: 0.000% (no-pure no-rust !)
507
507
508 $ cat output.txt
508 $ cat output.txt
509
509
510 Check that a failing transaction will properly revert the data
510 Check that a failing transaction will properly revert the data
511
511
512 $ echo plakfe > a
512 $ echo plakfe > a
513 $ f --size --sha256 .hg/store/00changelog-*.nd
513 $ f --size --sha256 .hg/store/00changelog-*.nd
514 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
514 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
515 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
515 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
516 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
516 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
517 $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py"
517 $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py"
518 transaction abort!
518 transaction abort!
519 rollback completed
519 rollback completed
520 abort: This is a late abort
520 abort: This is a late abort
521 [255]
521 [255]
522 $ hg debugnodemap --metadata
522 $ hg debugnodemap --metadata
523 uid: ???????????????? (glob)
523 uid: ???????????????? (glob)
524 tip-rev: 5005
524 tip-rev: 5005
525 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
525 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
526 data-length: 121536 (pure !)
526 data-length: 121536 (pure !)
527 data-length: 121536 (rust !)
527 data-length: 121536 (rust !)
528 data-length: 121088 (no-pure no-rust !)
528 data-length: 121088 (no-pure no-rust !)
529 data-unused: 448 (pure !)
529 data-unused: 448 (pure !)
530 data-unused: 448 (rust !)
530 data-unused: 448 (rust !)
531 data-unused: 0 (no-pure no-rust !)
531 data-unused: 0 (no-pure no-rust !)
532 data-unused: 0.369% (pure !)
532 data-unused: 0.369% (pure !)
533 data-unused: 0.369% (rust !)
533 data-unused: 0.369% (rust !)
534 data-unused: 0.000% (no-pure no-rust !)
534 data-unused: 0.000% (no-pure no-rust !)
535 $ f --size --sha256 .hg/store/00changelog-*.nd
535 $ f --size --sha256 .hg/store/00changelog-*.nd
536 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
536 .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
537 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
537 .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
538 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
538 .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
539
539
540 Check that removing content does not confuse the nodemap
540 Check that removing content does not confuse the nodemap
541 --------------------------------------------------------
541 --------------------------------------------------------
542
542
543 removing data with rollback
543 removing data with rollback
544
544
545 $ echo aso > a
545 $ echo aso > a
546 $ hg ci -m a4
546 $ hg ci -m a4
547 $ hg rollback
547 $ hg rollback
548 repository tip rolled back to revision 5005 (undo commit)
548 repository tip rolled back to revision 5005 (undo commit)
549 working directory now based on revision 5005
549 working directory now based on revision 5005
550 $ hg id -r .
550 $ hg id -r .
551 90d5d3ba2fc4 tip
551 90d5d3ba2fc4 tip
552
552
553 roming data with strip
553 roming data with strip
554
554
555 $ echo aso > a
555 $ echo aso > a
556 $ hg ci -m a4
556 $ hg ci -m a4
557 $ hg --config extensions.strip= strip -r . --no-backup
557 $ hg --config extensions.strip= strip -r . --no-backup
558 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
558 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
559 $ hg id -r . --traceback
559 $ hg id -r . --traceback
560 90d5d3ba2fc4 tip
560 90d5d3ba2fc4 tip
561
561
562 Test upgrade / downgrade
562 Test upgrade / downgrade
563 ========================
563 ========================
564
564
565 downgrading
565 downgrading
566
566
567 $ cat << EOF >> .hg/hgrc
567 $ cat << EOF >> .hg/hgrc
568 > [format]
568 > [format]
569 > use-persistent-nodemap=no
569 > use-persistent-nodemap=no
570 > EOF
570 > EOF
571 $ hg debugformat -v
571 $ hg debugformat -v
572 format-variant repo config default
572 format-variant repo config default
573 fncache: yes yes yes
573 fncache: yes yes yes
574 dotencode: yes yes yes
574 dotencode: yes yes yes
575 generaldelta: yes yes yes
575 generaldelta: yes yes yes
576 share-safe: no no no
576 share-safe: no no no
577 sparserevlog: yes yes yes
577 sparserevlog: yes yes yes
578 sidedata: no no no
578 sidedata: no no no
579 persistent-nodemap: yes no no
579 persistent-nodemap: yes no no
580 copies-sdc: no no no
580 copies-sdc: no no no
581 plain-cl-delta: yes yes yes
581 plain-cl-delta: yes yes yes
582 compression: zlib zlib zlib
582 compression: zlib zlib zlib
583 compression-level: default default default
583 compression-level: default default default
584 $ hg debugupgraderepo --run --no-backup --quiet
584 $ hg debugupgraderepo --run --no-backup --quiet
585 upgrade will perform the following actions:
585 upgrade will perform the following actions:
586
586
587 requirements
587 requirements
588 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
588 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
589 removed: persistent-nodemap
589 removed: persistent-nodemap
590
590
591 processed revlogs:
591 processed revlogs:
592 - all-filelogs
592 - all-filelogs
593 - changelog
593 - changelog
594 - manifest
594 - manifest
595
595
596 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
596 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
597 [1]
597 [1]
598 $ hg debugnodemap --metadata
598 $ hg debugnodemap --metadata
599
599
600
600
601 upgrading
601 upgrading
602
602
603 $ cat << EOF >> .hg/hgrc
603 $ cat << EOF >> .hg/hgrc
604 > [format]
604 > [format]
605 > use-persistent-nodemap=yes
605 > use-persistent-nodemap=yes
606 > EOF
606 > EOF
607 $ hg debugformat -v
607 $ hg debugformat -v
608 format-variant repo config default
608 format-variant repo config default
609 fncache: yes yes yes
609 fncache: yes yes yes
610 dotencode: yes yes yes
610 dotencode: yes yes yes
611 generaldelta: yes yes yes
611 generaldelta: yes yes yes
612 share-safe: no no no
612 share-safe: no no no
613 sparserevlog: yes yes yes
613 sparserevlog: yes yes yes
614 sidedata: no no no
614 sidedata: no no no
615 persistent-nodemap: no yes no
615 persistent-nodemap: no yes no
616 copies-sdc: no no no
616 copies-sdc: no no no
617 plain-cl-delta: yes yes yes
617 plain-cl-delta: yes yes yes
618 compression: zlib zlib zlib
618 compression: zlib zlib zlib
619 compression-level: default default default
619 compression-level: default default default
620 $ hg debugupgraderepo --run --no-backup
620 $ hg debugupgraderepo --run --no-backup
621 upgrade will perform the following actions:
621 upgrade will perform the following actions:
622
622
623 requirements
623 requirements
624 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
624 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
625 added: persistent-nodemap
625 added: persistent-nodemap
626
626
627 persistent-nodemap
627 persistent-nodemap
628 Speedup revision lookup by node id.
628 Speedup revision lookup by node id.
629
629
630 processed revlogs:
630 processed revlogs:
631 - all-filelogs
631 - all-filelogs
632 - changelog
632 - changelog
633 - manifest
633 - manifest
634
634
635 beginning upgrade...
635 beginning upgrade...
636 repository locked and read-only
636 repository locked and read-only
637 creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob)
637 creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob)
638 (it is safe to interrupt this process any time before data migration completes)
638 (it is safe to interrupt this process any time before data migration completes)
639 upgrading repository to use persistent nodemap feature
639 upgrading repository to use persistent nodemap feature
640 removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob)
640 removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob)
641 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
641 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
642 00changelog-*.nd (glob)
642 00changelog-*.nd (glob)
643 00changelog.n
643 00changelog.n
644 00manifest-*.nd (glob)
645 00manifest.n
644
646
645 $ hg debugnodemap --metadata
647 $ hg debugnodemap --metadata
646 uid: * (glob)
648 uid: * (glob)
647 tip-rev: 5005
649 tip-rev: 5005
648 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
650 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
649 data-length: 121088
651 data-length: 121088
650 data-unused: 0
652 data-unused: 0
651 data-unused: 0.000%
653 data-unused: 0.000%
652
654
653 Running unrelated upgrade
655 Running unrelated upgrade
654
656
655 $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all
657 $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all
656 upgrade will perform the following actions:
658 upgrade will perform the following actions:
657
659
658 requirements
660 requirements
659 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store
661 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store
660
662
661 optimisations: re-delta-all
663 optimisations: re-delta-all
662
664
663 processed revlogs:
665 processed revlogs:
664 - all-filelogs
666 - all-filelogs
665 - changelog
667 - changelog
666 - manifest
668 - manifest
667
669
668 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
670 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
669 00changelog-*.nd (glob)
671 00changelog-*.nd (glob)
670 00changelog.n
672 00changelog.n
671 00manifest-*.nd (glob)
673 00manifest-*.nd (glob)
672 00manifest.n
674 00manifest.n
673
675
674 $ hg debugnodemap --metadata
676 $ hg debugnodemap --metadata
675 uid: * (glob)
677 uid: * (glob)
676 tip-rev: 5005
678 tip-rev: 5005
677 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
679 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
678 data-length: 121088
680 data-length: 121088
679 data-unused: 0
681 data-unused: 0
680 data-unused: 0.000%
682 data-unused: 0.000%
681
683
682 Persistent nodemap and local/streaming clone
684 Persistent nodemap and local/streaming clone
683 ============================================
685 ============================================
684
686
685 $ cd ..
687 $ cd ..
686
688
687 standard clone
689 standard clone
688 --------------
690 --------------
689
691
690 The persistent nodemap should exist after a streaming clone
692 The persistent nodemap should exist after a streaming clone
691
693
692 $ hg clone --pull --quiet -U test-repo standard-clone
694 $ hg clone --pull --quiet -U test-repo standard-clone
693 $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
695 $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
694 00changelog-*.nd (glob)
696 00changelog-*.nd (glob)
695 00changelog.n
697 00changelog.n
696 00manifest-*.nd (glob)
698 00manifest-*.nd (glob)
697 00manifest.n
699 00manifest.n
698 $ hg -R standard-clone debugnodemap --metadata
700 $ hg -R standard-clone debugnodemap --metadata
699 uid: * (glob)
701 uid: * (glob)
700 tip-rev: 5005
702 tip-rev: 5005
701 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
703 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
702 data-length: 121088
704 data-length: 121088
703 data-unused: 0
705 data-unused: 0
704 data-unused: 0.000%
706 data-unused: 0.000%
705
707
706
708
707 local clone
709 local clone
708 ------------
710 ------------
709
711
710 The persistent nodemap should exist after a streaming clone
712 The persistent nodemap should exist after a streaming clone
711
713
712 $ hg clone -U test-repo local-clone
714 $ hg clone -U test-repo local-clone
713 $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
715 $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
714 00changelog-*.nd (glob)
716 00changelog-*.nd (glob)
715 00changelog.n
717 00changelog.n
716 00manifest-*.nd (glob)
718 00manifest-*.nd (glob)
717 00manifest.n
719 00manifest.n
718 $ hg -R local-clone debugnodemap --metadata
720 $ hg -R local-clone debugnodemap --metadata
719 uid: * (glob)
721 uid: * (glob)
720 tip-rev: 5005
722 tip-rev: 5005
721 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
723 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
722 data-length: 121088
724 data-length: 121088
723 data-unused: 0
725 data-unused: 0
724 data-unused: 0.000%
726 data-unused: 0.000%
725
727
726 stream clone
728 stream clone
727 ------------
729 ------------
728
730
729 The persistent nodemap should exist after a streaming clone
731 The persistent nodemap should exist after a streaming clone
730
732
731 $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)'
733 $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)'
732 adding [s] 00manifest.n (70 bytes)
734 adding [s] 00manifest.n (70 bytes)
733 adding [s] 00manifest.i (313 KB)
735 adding [s] 00manifest.i (313 KB)
734 adding [s] 00manifest.d (452 KB)
736 adding [s] 00manifest.d (452 KB)
735 adding [s] 00manifest-*.nd (118 KB) (glob)
737 adding [s] 00manifest-*.nd (118 KB) (glob)
736 adding [s] 00changelog.n (70 bytes)
738 adding [s] 00changelog.n (70 bytes)
737 adding [s] 00changelog.i (313 KB)
739 adding [s] 00changelog.i (313 KB)
738 adding [s] 00changelog.d (360 KB)
740 adding [s] 00changelog.d (360 KB)
739 adding [s] 00changelog-*.nd (118 KB) (glob)
741 adding [s] 00changelog-*.nd (118 KB) (glob)
740 $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
742 $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
741 00changelog-*.nd (glob)
743 00changelog-*.nd (glob)
742 00changelog.n
744 00changelog.n
743 00manifest-*.nd (glob)
745 00manifest-*.nd (glob)
744 00manifest.n
746 00manifest.n
745 $ hg -R stream-clone debugnodemap --metadata
747 $ hg -R stream-clone debugnodemap --metadata
746 uid: * (glob)
748 uid: * (glob)
747 tip-rev: 5005
749 tip-rev: 5005
748 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
750 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
749 data-length: 121088
751 data-length: 121088
750 data-unused: 0
752 data-unused: 0
751 data-unused: 0.000%
753 data-unused: 0.000%
General Comments 0
You need to be logged in to leave comments. Login now