##// END OF EJS Templates
debugrevlog: display total stored information...
marmoute -
r50557:7aea9bab default
parent child Browse files
Show More
@@ -1,605 +1,621 b''
1 # revlogutils/debug.py - utility used for revlog debuging
1 # revlogutils/debug.py - utility used for revlog debuging
2 #
2 #
3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
4 # Copyright 2022 Octobus <contact@octobus.net>
4 # Copyright 2022 Octobus <contact@octobus.net>
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 import collections
9 import collections
10 import string
10 import string
11
11
12 from .. import (
12 from .. import (
13 node as nodemod,
13 node as nodemod,
14 util,
14 util,
15 )
15 )
16
16
17 from . import (
17 from . import (
18 constants,
18 constants,
19 )
19 )
20
20
21 INDEX_ENTRY_DEBUG_COLUMN = []
21 INDEX_ENTRY_DEBUG_COLUMN = []
22
22
23 NODE_SIZE = object()
23 NODE_SIZE = object()
24
24
25
25
26 class _column_base:
26 class _column_base:
27 """constains the definition of a revlog column
27 """constains the definition of a revlog column
28
28
29 name: the column header,
29 name: the column header,
30 value_func: the function called to get a value,
30 value_func: the function called to get a value,
31 size: the width of the column,
31 size: the width of the column,
32 verbose_only: only include the column in verbose mode.
32 verbose_only: only include the column in verbose mode.
33 """
33 """
34
34
35 def __init__(self, name, value_func, size=None, verbose=False):
35 def __init__(self, name, value_func, size=None, verbose=False):
36 self.name = name
36 self.name = name
37 self.value_func = value_func
37 self.value_func = value_func
38 if size is not NODE_SIZE:
38 if size is not NODE_SIZE:
39 if size is None:
39 if size is None:
40 size = 8 # arbitrary default
40 size = 8 # arbitrary default
41 size = max(len(name), size)
41 size = max(len(name), size)
42 self._size = size
42 self._size = size
43 self.verbose_only = verbose
43 self.verbose_only = verbose
44
44
45 def get_size(self, node_size):
45 def get_size(self, node_size):
46 if self._size is NODE_SIZE:
46 if self._size is NODE_SIZE:
47 return node_size
47 return node_size
48 else:
48 else:
49 return self._size
49 return self._size
50
50
51
51
52 def debug_column(name, size=None, verbose=False):
52 def debug_column(name, size=None, verbose=False):
53 """decorated function is registered as a column
53 """decorated function is registered as a column
54
54
55 name: the name of the column,
55 name: the name of the column,
56 size: the expected size of the column.
56 size: the expected size of the column.
57 """
57 """
58
58
59 def register(func):
59 def register(func):
60 entry = _column_base(
60 entry = _column_base(
61 name=name,
61 name=name,
62 value_func=func,
62 value_func=func,
63 size=size,
63 size=size,
64 verbose=verbose,
64 verbose=verbose,
65 )
65 )
66 INDEX_ENTRY_DEBUG_COLUMN.append(entry)
66 INDEX_ENTRY_DEBUG_COLUMN.append(entry)
67 return entry
67 return entry
68
68
69 return register
69 return register
70
70
71
71
72 @debug_column(b"rev", size=6)
72 @debug_column(b"rev", size=6)
73 def _rev(index, rev, entry, hexfn):
73 def _rev(index, rev, entry, hexfn):
74 return b"%d" % rev
74 return b"%d" % rev
75
75
76
76
77 @debug_column(b"rank", size=6, verbose=True)
77 @debug_column(b"rank", size=6, verbose=True)
78 def rank(index, rev, entry, hexfn):
78 def rank(index, rev, entry, hexfn):
79 return b"%d" % entry[constants.ENTRY_RANK]
79 return b"%d" % entry[constants.ENTRY_RANK]
80
80
81
81
82 @debug_column(b"linkrev", size=6)
82 @debug_column(b"linkrev", size=6)
83 def _linkrev(index, rev, entry, hexfn):
83 def _linkrev(index, rev, entry, hexfn):
84 return b"%d" % entry[constants.ENTRY_LINK_REV]
84 return b"%d" % entry[constants.ENTRY_LINK_REV]
85
85
86
86
87 @debug_column(b"nodeid", size=NODE_SIZE)
87 @debug_column(b"nodeid", size=NODE_SIZE)
88 def _nodeid(index, rev, entry, hexfn):
88 def _nodeid(index, rev, entry, hexfn):
89 return hexfn(entry[constants.ENTRY_NODE_ID])
89 return hexfn(entry[constants.ENTRY_NODE_ID])
90
90
91
91
92 @debug_column(b"p1-rev", size=6, verbose=True)
92 @debug_column(b"p1-rev", size=6, verbose=True)
93 def _p1_rev(index, rev, entry, hexfn):
93 def _p1_rev(index, rev, entry, hexfn):
94 return b"%d" % entry[constants.ENTRY_PARENT_1]
94 return b"%d" % entry[constants.ENTRY_PARENT_1]
95
95
96
96
97 @debug_column(b"p1-nodeid", size=NODE_SIZE)
97 @debug_column(b"p1-nodeid", size=NODE_SIZE)
98 def _p1_node(index, rev, entry, hexfn):
98 def _p1_node(index, rev, entry, hexfn):
99 parent = entry[constants.ENTRY_PARENT_1]
99 parent = entry[constants.ENTRY_PARENT_1]
100 p_entry = index[parent]
100 p_entry = index[parent]
101 return hexfn(p_entry[constants.ENTRY_NODE_ID])
101 return hexfn(p_entry[constants.ENTRY_NODE_ID])
102
102
103
103
104 @debug_column(b"p2-rev", size=6, verbose=True)
104 @debug_column(b"p2-rev", size=6, verbose=True)
105 def _p2_rev(index, rev, entry, hexfn):
105 def _p2_rev(index, rev, entry, hexfn):
106 return b"%d" % entry[constants.ENTRY_PARENT_2]
106 return b"%d" % entry[constants.ENTRY_PARENT_2]
107
107
108
108
109 @debug_column(b"p2-nodeid", size=NODE_SIZE)
109 @debug_column(b"p2-nodeid", size=NODE_SIZE)
110 def _p2_node(index, rev, entry, hexfn):
110 def _p2_node(index, rev, entry, hexfn):
111 parent = entry[constants.ENTRY_PARENT_2]
111 parent = entry[constants.ENTRY_PARENT_2]
112 p_entry = index[parent]
112 p_entry = index[parent]
113 return hexfn(p_entry[constants.ENTRY_NODE_ID])
113 return hexfn(p_entry[constants.ENTRY_NODE_ID])
114
114
115
115
116 @debug_column(b"full-size", size=20, verbose=True)
116 @debug_column(b"full-size", size=20, verbose=True)
117 def full_size(index, rev, entry, hexfn):
117 def full_size(index, rev, entry, hexfn):
118 return b"%d" % entry[constants.ENTRY_DATA_UNCOMPRESSED_LENGTH]
118 return b"%d" % entry[constants.ENTRY_DATA_UNCOMPRESSED_LENGTH]
119
119
120
120
121 @debug_column(b"delta-base", size=6, verbose=True)
121 @debug_column(b"delta-base", size=6, verbose=True)
122 def delta_base(index, rev, entry, hexfn):
122 def delta_base(index, rev, entry, hexfn):
123 return b"%d" % entry[constants.ENTRY_DELTA_BASE]
123 return b"%d" % entry[constants.ENTRY_DELTA_BASE]
124
124
125
125
126 @debug_column(b"flags", size=2, verbose=True)
126 @debug_column(b"flags", size=2, verbose=True)
127 def flags(index, rev, entry, hexfn):
127 def flags(index, rev, entry, hexfn):
128 field = entry[constants.ENTRY_DATA_OFFSET]
128 field = entry[constants.ENTRY_DATA_OFFSET]
129 field &= 0xFFFF
129 field &= 0xFFFF
130 return b"%d" % field
130 return b"%d" % field
131
131
132
132
133 @debug_column(b"comp-mode", size=4, verbose=True)
133 @debug_column(b"comp-mode", size=4, verbose=True)
134 def compression_mode(index, rev, entry, hexfn):
134 def compression_mode(index, rev, entry, hexfn):
135 return b"%d" % entry[constants.ENTRY_DATA_COMPRESSION_MODE]
135 return b"%d" % entry[constants.ENTRY_DATA_COMPRESSION_MODE]
136
136
137
137
138 @debug_column(b"data-offset", size=20, verbose=True)
138 @debug_column(b"data-offset", size=20, verbose=True)
139 def data_offset(index, rev, entry, hexfn):
139 def data_offset(index, rev, entry, hexfn):
140 field = entry[constants.ENTRY_DATA_OFFSET]
140 field = entry[constants.ENTRY_DATA_OFFSET]
141 field >>= 16
141 field >>= 16
142 return b"%d" % field
142 return b"%d" % field
143
143
144
144
145 @debug_column(b"chunk-size", size=10, verbose=True)
145 @debug_column(b"chunk-size", size=10, verbose=True)
146 def data_chunk_size(index, rev, entry, hexfn):
146 def data_chunk_size(index, rev, entry, hexfn):
147 return b"%d" % entry[constants.ENTRY_DATA_COMPRESSED_LENGTH]
147 return b"%d" % entry[constants.ENTRY_DATA_COMPRESSED_LENGTH]
148
148
149
149
150 @debug_column(b"sd-comp-mode", size=7, verbose=True)
150 @debug_column(b"sd-comp-mode", size=7, verbose=True)
151 def sidedata_compression_mode(index, rev, entry, hexfn):
151 def sidedata_compression_mode(index, rev, entry, hexfn):
152 compression = entry[constants.ENTRY_SIDEDATA_COMPRESSION_MODE]
152 compression = entry[constants.ENTRY_SIDEDATA_COMPRESSION_MODE]
153 if compression == constants.COMP_MODE_PLAIN:
153 if compression == constants.COMP_MODE_PLAIN:
154 return b"plain"
154 return b"plain"
155 elif compression == constants.COMP_MODE_DEFAULT:
155 elif compression == constants.COMP_MODE_DEFAULT:
156 return b"default"
156 return b"default"
157 elif compression == constants.COMP_MODE_INLINE:
157 elif compression == constants.COMP_MODE_INLINE:
158 return b"inline"
158 return b"inline"
159 else:
159 else:
160 return b"%d" % compression
160 return b"%d" % compression
161
161
162
162
163 @debug_column(b"sidedata-offset", size=20, verbose=True)
163 @debug_column(b"sidedata-offset", size=20, verbose=True)
164 def sidedata_offset(index, rev, entry, hexfn):
164 def sidedata_offset(index, rev, entry, hexfn):
165 return b"%d" % entry[constants.ENTRY_SIDEDATA_OFFSET]
165 return b"%d" % entry[constants.ENTRY_SIDEDATA_OFFSET]
166
166
167
167
168 @debug_column(b"sd-chunk-size", size=10, verbose=True)
168 @debug_column(b"sd-chunk-size", size=10, verbose=True)
169 def sidedata_chunk_size(index, rev, entry, hexfn):
169 def sidedata_chunk_size(index, rev, entry, hexfn):
170 return b"%d" % entry[constants.ENTRY_SIDEDATA_COMPRESSED_LENGTH]
170 return b"%d" % entry[constants.ENTRY_SIDEDATA_COMPRESSED_LENGTH]
171
171
172
172
173 def debug_index(
173 def debug_index(
174 ui,
174 ui,
175 repo,
175 repo,
176 formatter,
176 formatter,
177 revlog,
177 revlog,
178 full_node,
178 full_node,
179 ):
179 ):
180 """display index data for a revlog"""
180 """display index data for a revlog"""
181 if full_node:
181 if full_node:
182 hexfn = nodemod.hex
182 hexfn = nodemod.hex
183 else:
183 else:
184 hexfn = nodemod.short
184 hexfn = nodemod.short
185
185
186 idlen = 12
186 idlen = 12
187 for i in revlog:
187 for i in revlog:
188 idlen = len(hexfn(revlog.node(i)))
188 idlen = len(hexfn(revlog.node(i)))
189 break
189 break
190
190
191 fm = formatter
191 fm = formatter
192
192
193 header_pieces = []
193 header_pieces = []
194 for column in INDEX_ENTRY_DEBUG_COLUMN:
194 for column in INDEX_ENTRY_DEBUG_COLUMN:
195 if column.verbose_only and not ui.verbose:
195 if column.verbose_only and not ui.verbose:
196 continue
196 continue
197 size = column.get_size(idlen)
197 size = column.get_size(idlen)
198 name = column.name
198 name = column.name
199 header_pieces.append(name.rjust(size))
199 header_pieces.append(name.rjust(size))
200
200
201 fm.plain(b' '.join(header_pieces) + b'\n')
201 fm.plain(b' '.join(header_pieces) + b'\n')
202
202
203 index = revlog.index
203 index = revlog.index
204
204
205 for rev in revlog:
205 for rev in revlog:
206 fm.startitem()
206 fm.startitem()
207 entry = index[rev]
207 entry = index[rev]
208 first = True
208 first = True
209 for column in INDEX_ENTRY_DEBUG_COLUMN:
209 for column in INDEX_ENTRY_DEBUG_COLUMN:
210 if column.verbose_only and not ui.verbose:
210 if column.verbose_only and not ui.verbose:
211 continue
211 continue
212 if not first:
212 if not first:
213 fm.plain(b' ')
213 fm.plain(b' ')
214 first = False
214 first = False
215
215
216 size = column.get_size(idlen)
216 size = column.get_size(idlen)
217 value = column.value_func(index, rev, entry, hexfn)
217 value = column.value_func(index, rev, entry, hexfn)
218 display = b"%%%ds" % size
218 display = b"%%%ds" % size
219 fm.write(column.name, display, value)
219 fm.write(column.name, display, value)
220 fm.plain(b'\n')
220 fm.plain(b'\n')
221
221
222 fm.end()
222 fm.end()
223
223
224
224
225 def dump(ui, revlog):
225 def dump(ui, revlog):
226 """perform the work for `hg debugrevlog --dump"""
226 """perform the work for `hg debugrevlog --dump"""
227 # XXX seems redundant with debug index ?
227 # XXX seems redundant with debug index ?
228 r = revlog
228 r = revlog
229 numrevs = len(r)
229 numrevs = len(r)
230 ui.write(
230 ui.write(
231 (
231 (
232 b"# rev p1rev p2rev start end deltastart base p1 p2"
232 b"# rev p1rev p2rev start end deltastart base p1 p2"
233 b" rawsize totalsize compression heads chainlen\n"
233 b" rawsize totalsize compression heads chainlen\n"
234 )
234 )
235 )
235 )
236 ts = 0
236 ts = 0
237 heads = set()
237 heads = set()
238
238
239 for rev in range(numrevs):
239 for rev in range(numrevs):
240 dbase = r.deltaparent(rev)
240 dbase = r.deltaparent(rev)
241 if dbase == -1:
241 if dbase == -1:
242 dbase = rev
242 dbase = rev
243 cbase = r.chainbase(rev)
243 cbase = r.chainbase(rev)
244 clen = r.chainlen(rev)
244 clen = r.chainlen(rev)
245 p1, p2 = r.parentrevs(rev)
245 p1, p2 = r.parentrevs(rev)
246 rs = r.rawsize(rev)
246 rs = r.rawsize(rev)
247 ts = ts + rs
247 ts = ts + rs
248 heads -= set(r.parentrevs(rev))
248 heads -= set(r.parentrevs(rev))
249 heads.add(rev)
249 heads.add(rev)
250 try:
250 try:
251 compression = ts / r.end(rev)
251 compression = ts / r.end(rev)
252 except ZeroDivisionError:
252 except ZeroDivisionError:
253 compression = 0
253 compression = 0
254 ui.write(
254 ui.write(
255 b"%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
255 b"%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
256 b"%11d %5d %8d\n"
256 b"%11d %5d %8d\n"
257 % (
257 % (
258 rev,
258 rev,
259 p1,
259 p1,
260 p2,
260 p2,
261 r.start(rev),
261 r.start(rev),
262 r.end(rev),
262 r.end(rev),
263 r.start(dbase),
263 r.start(dbase),
264 r.start(cbase),
264 r.start(cbase),
265 r.start(p1),
265 r.start(p1),
266 r.start(p2),
266 r.start(p2),
267 rs,
267 rs,
268 ts,
268 ts,
269 compression,
269 compression,
270 len(heads),
270 len(heads),
271 clen,
271 clen,
272 )
272 )
273 )
273 )
274
274
275
275
276 def debug_revlog(ui, revlog):
276 def debug_revlog(ui, revlog):
277 """code for `hg debugrevlog`"""
277 """code for `hg debugrevlog`"""
278 r = revlog
278 r = revlog
279 format = r._format_version
279 format = r._format_version
280 v = r._format_flags
280 v = r._format_flags
281 flags = []
281 flags = []
282 gdelta = False
282 gdelta = False
283 if v & constants.FLAG_INLINE_DATA:
283 if v & constants.FLAG_INLINE_DATA:
284 flags.append(b'inline')
284 flags.append(b'inline')
285 if v & constants.FLAG_GENERALDELTA:
285 if v & constants.FLAG_GENERALDELTA:
286 gdelta = True
286 gdelta = True
287 flags.append(b'generaldelta')
287 flags.append(b'generaldelta')
288 if not flags:
288 if not flags:
289 flags = [b'(none)']
289 flags = [b'(none)']
290
290
291 ### the total size of stored content if incompressed.
292 full_text_total_size = 0
291 ### tracks merge vs single parent
293 ### tracks merge vs single parent
292 nummerges = 0
294 nummerges = 0
293
295
294 ### tracks ways the "delta" are build
296 ### tracks ways the "delta" are build
295 # nodelta
297 # nodelta
296 numempty = 0
298 numempty = 0
297 numemptytext = 0
299 numemptytext = 0
298 numemptydelta = 0
300 numemptydelta = 0
299 # full file content
301 # full file content
300 numfull = 0
302 numfull = 0
301 # intermediate snapshot against a prior snapshot
303 # intermediate snapshot against a prior snapshot
302 numsemi = 0
304 numsemi = 0
303 # snapshot count per depth
305 # snapshot count per depth
304 numsnapdepth = collections.defaultdict(lambda: 0)
306 numsnapdepth = collections.defaultdict(lambda: 0)
305 # number of snapshots with a non-ancestor delta
307 # number of snapshots with a non-ancestor delta
306 numsnapdepth_nad = collections.defaultdict(lambda: 0)
308 numsnapdepth_nad = collections.defaultdict(lambda: 0)
307 # delta against previous revision
309 # delta against previous revision
308 numprev = 0
310 numprev = 0
309 # delta against prev, where prev is a non-ancestor
311 # delta against prev, where prev is a non-ancestor
310 numprev_nad = 0
312 numprev_nad = 0
311 # delta against first or second parent (not prev)
313 # delta against first or second parent (not prev)
312 nump1 = 0
314 nump1 = 0
313 nump2 = 0
315 nump2 = 0
314 # delta against neither prev nor parents
316 # delta against neither prev nor parents
315 numother = 0
317 numother = 0
316 # delta against other that is a non-ancestor
318 # delta against other that is a non-ancestor
317 numother_nad = 0
319 numother_nad = 0
318 # delta against prev that are also first or second parent
320 # delta against prev that are also first or second parent
319 # (details of `numprev`)
321 # (details of `numprev`)
320 nump1prev = 0
322 nump1prev = 0
321 nump2prev = 0
323 nump2prev = 0
322
324
323 # data about delta chain of each revs
325 # data about delta chain of each revs
324 chainlengths = []
326 chainlengths = []
325 chainbases = []
327 chainbases = []
326 chainspans = []
328 chainspans = []
327
329
328 # data about each revision
330 # data about each revision
329 datasize = [None, 0, 0]
331 datasize = [None, 0, 0]
330 fullsize = [None, 0, 0]
332 fullsize = [None, 0, 0]
331 semisize = [None, 0, 0]
333 semisize = [None, 0, 0]
332 # snapshot count per depth
334 # snapshot count per depth
333 snapsizedepth = collections.defaultdict(lambda: [None, 0, 0])
335 snapsizedepth = collections.defaultdict(lambda: [None, 0, 0])
334 deltasize = [None, 0, 0]
336 deltasize = [None, 0, 0]
335 chunktypecounts = {}
337 chunktypecounts = {}
336 chunktypesizes = {}
338 chunktypesizes = {}
337
339
338 def addsize(size, l):
340 def addsize(size, l):
339 if l[0] is None or size < l[0]:
341 if l[0] is None or size < l[0]:
340 l[0] = size
342 l[0] = size
341 if size > l[1]:
343 if size > l[1]:
342 l[1] = size
344 l[1] = size
343 l[2] += size
345 l[2] += size
344
346
345 numrevs = len(r)
347 numrevs = len(r)
346 for rev in range(numrevs):
348 for rev in range(numrevs):
347 p1, p2 = r.parentrevs(rev)
349 p1, p2 = r.parentrevs(rev)
348 delta = r.deltaparent(rev)
350 delta = r.deltaparent(rev)
349 if format > 0:
351 if format > 0:
350 addsize(r.rawsize(rev), datasize)
352 s = r.rawsize(rev)
353 full_text_total_size += s
354 addsize(s, datasize)
351 if p2 != nodemod.nullrev:
355 if p2 != nodemod.nullrev:
352 nummerges += 1
356 nummerges += 1
353 size = r.length(rev)
357 size = r.length(rev)
354 if delta == nodemod.nullrev:
358 if delta == nodemod.nullrev:
355 chainlengths.append(0)
359 chainlengths.append(0)
356 chainbases.append(r.start(rev))
360 chainbases.append(r.start(rev))
357 chainspans.append(size)
361 chainspans.append(size)
358 if size == 0:
362 if size == 0:
359 numempty += 1
363 numempty += 1
360 numemptytext += 1
364 numemptytext += 1
361 else:
365 else:
362 numfull += 1
366 numfull += 1
363 numsnapdepth[0] += 1
367 numsnapdepth[0] += 1
364 addsize(size, fullsize)
368 addsize(size, fullsize)
365 addsize(size, snapsizedepth[0])
369 addsize(size, snapsizedepth[0])
366 else:
370 else:
367 nad = (
371 nad = (
368 delta != p1 and delta != p2 and not r.isancestorrev(delta, rev)
372 delta != p1 and delta != p2 and not r.isancestorrev(delta, rev)
369 )
373 )
370 chainlengths.append(chainlengths[delta] + 1)
374 chainlengths.append(chainlengths[delta] + 1)
371 baseaddr = chainbases[delta]
375 baseaddr = chainbases[delta]
372 revaddr = r.start(rev)
376 revaddr = r.start(rev)
373 chainbases.append(baseaddr)
377 chainbases.append(baseaddr)
374 chainspans.append((revaddr - baseaddr) + size)
378 chainspans.append((revaddr - baseaddr) + size)
375 if size == 0:
379 if size == 0:
376 numempty += 1
380 numempty += 1
377 numemptydelta += 1
381 numemptydelta += 1
378 elif r.issnapshot(rev):
382 elif r.issnapshot(rev):
379 addsize(size, semisize)
383 addsize(size, semisize)
380 numsemi += 1
384 numsemi += 1
381 depth = r.snapshotdepth(rev)
385 depth = r.snapshotdepth(rev)
382 numsnapdepth[depth] += 1
386 numsnapdepth[depth] += 1
383 if nad:
387 if nad:
384 numsnapdepth_nad[depth] += 1
388 numsnapdepth_nad[depth] += 1
385 addsize(size, snapsizedepth[depth])
389 addsize(size, snapsizedepth[depth])
386 else:
390 else:
387 addsize(size, deltasize)
391 addsize(size, deltasize)
388 if delta == rev - 1:
392 if delta == rev - 1:
389 numprev += 1
393 numprev += 1
390 if delta == p1:
394 if delta == p1:
391 nump1prev += 1
395 nump1prev += 1
392 elif delta == p2:
396 elif delta == p2:
393 nump2prev += 1
397 nump2prev += 1
394 elif nad:
398 elif nad:
395 numprev_nad += 1
399 numprev_nad += 1
396 elif delta == p1:
400 elif delta == p1:
397 nump1 += 1
401 nump1 += 1
398 elif delta == p2:
402 elif delta == p2:
399 nump2 += 1
403 nump2 += 1
400 elif delta != nodemod.nullrev:
404 elif delta != nodemod.nullrev:
401 numother += 1
405 numother += 1
402 numother_nad += 1
406 numother_nad += 1
403
407
404 # Obtain data on the raw chunks in the revlog.
408 # Obtain data on the raw chunks in the revlog.
405 if util.safehasattr(r, '_getsegmentforrevs'):
409 if util.safehasattr(r, '_getsegmentforrevs'):
406 segment = r._getsegmentforrevs(rev, rev)[1]
410 segment = r._getsegmentforrevs(rev, rev)[1]
407 else:
411 else:
408 segment = r._revlog._getsegmentforrevs(rev, rev)[1]
412 segment = r._revlog._getsegmentforrevs(rev, rev)[1]
409 if segment:
413 if segment:
410 chunktype = bytes(segment[0:1])
414 chunktype = bytes(segment[0:1])
411 else:
415 else:
412 chunktype = b'empty'
416 chunktype = b'empty'
413
417
414 if chunktype not in chunktypecounts:
418 if chunktype not in chunktypecounts:
415 chunktypecounts[chunktype] = 0
419 chunktypecounts[chunktype] = 0
416 chunktypesizes[chunktype] = 0
420 chunktypesizes[chunktype] = 0
417
421
418 chunktypecounts[chunktype] += 1
422 chunktypecounts[chunktype] += 1
419 chunktypesizes[chunktype] += size
423 chunktypesizes[chunktype] += size
420
424
421 # Adjust size min value for empty cases
425 # Adjust size min value for empty cases
422 for size in (datasize, fullsize, semisize, deltasize):
426 for size in (datasize, fullsize, semisize, deltasize):
423 if size[0] is None:
427 if size[0] is None:
424 size[0] = 0
428 size[0] = 0
425
429
426 numdeltas = numrevs - numfull - numempty - numsemi
430 numdeltas = numrevs - numfull - numempty - numsemi
427 numoprev = numprev - nump1prev - nump2prev - numprev_nad
431 numoprev = numprev - nump1prev - nump2prev - numprev_nad
428 num_other_ancestors = numother - numother_nad
432 num_other_ancestors = numother - numother_nad
429 totalrawsize = datasize[2]
433 totalrawsize = datasize[2]
430 datasize[2] /= numrevs
434 datasize[2] /= numrevs
431 fulltotal = fullsize[2]
435 fulltotal = fullsize[2]
432 if numfull == 0:
436 if numfull == 0:
433 fullsize[2] = 0
437 fullsize[2] = 0
434 else:
438 else:
435 fullsize[2] /= numfull
439 fullsize[2] /= numfull
436 semitotal = semisize[2]
440 semitotal = semisize[2]
437 snaptotal = {}
441 snaptotal = {}
438 if numsemi > 0:
442 if numsemi > 0:
439 semisize[2] /= numsemi
443 semisize[2] /= numsemi
440 for depth in snapsizedepth:
444 for depth in snapsizedepth:
441 snaptotal[depth] = snapsizedepth[depth][2]
445 snaptotal[depth] = snapsizedepth[depth][2]
442 snapsizedepth[depth][2] /= numsnapdepth[depth]
446 snapsizedepth[depth][2] /= numsnapdepth[depth]
443
447
444 deltatotal = deltasize[2]
448 deltatotal = deltasize[2]
445 if numdeltas > 0:
449 if numdeltas > 0:
446 deltasize[2] /= numdeltas
450 deltasize[2] /= numdeltas
447 totalsize = fulltotal + semitotal + deltatotal
451 totalsize = fulltotal + semitotal + deltatotal
448 avgchainlen = sum(chainlengths) / numrevs
452 avgchainlen = sum(chainlengths) / numrevs
449 maxchainlen = max(chainlengths)
453 maxchainlen = max(chainlengths)
450 maxchainspan = max(chainspans)
454 maxchainspan = max(chainspans)
451 compratio = 1
455 compratio = 1
452 if totalsize:
456 if totalsize:
453 compratio = totalrawsize / totalsize
457 compratio = totalrawsize / totalsize
454
458
455 basedfmtstr = b'%%%dd\n'
459 basedfmtstr = b'%%%dd\n'
456 basepcfmtstr = b'%%%dd %s(%%5.2f%%%%)\n'
460 basepcfmtstr = b'%%%dd %s(%%5.2f%%%%)\n'
457
461
458 def dfmtstr(max):
462 def dfmtstr(max):
459 return basedfmtstr % len(str(max))
463 return basedfmtstr % len(str(max))
460
464
461 def pcfmtstr(max, padding=0):
465 def pcfmtstr(max, padding=0):
462 return basepcfmtstr % (len(str(max)), b' ' * padding)
466 return basepcfmtstr % (len(str(max)), b' ' * padding)
463
467
464 def pcfmt(value, total):
468 def pcfmt(value, total):
465 if total:
469 if total:
466 return (value, 100 * float(value) / total)
470 return (value, 100 * float(value) / total)
467 else:
471 else:
468 return value, 100.0
472 return value, 100.0
469
473
470 ui.writenoi18n(b'format : %d\n' % format)
474 ui.writenoi18n(b'format : %d\n' % format)
471 ui.writenoi18n(b'flags : %s\n' % b', '.join(flags))
475 ui.writenoi18n(b'flags : %s\n' % b', '.join(flags))
472
476
473 ui.write(b'\n')
477 ui.write(b'\n')
474 fmt = pcfmtstr(totalsize)
478 fmt = pcfmtstr(totalsize)
475 fmt2 = dfmtstr(totalsize)
479 fmt2 = dfmtstr(totalsize)
476 ui.writenoi18n(b'revisions : ' + fmt2 % numrevs)
480 ui.writenoi18n(b'revisions : ' + fmt2 % numrevs)
477 ui.writenoi18n(b' merges : ' + fmt % pcfmt(nummerges, numrevs))
481 ui.writenoi18n(b' merges : ' + fmt % pcfmt(nummerges, numrevs))
478 ui.writenoi18n(
482 ui.writenoi18n(
479 b' normal : ' + fmt % pcfmt(numrevs - nummerges, numrevs)
483 b' normal : ' + fmt % pcfmt(numrevs - nummerges, numrevs)
480 )
484 )
481 ui.writenoi18n(b'revisions : ' + fmt2 % numrevs)
485 ui.writenoi18n(b'revisions : ' + fmt2 % numrevs)
482 ui.writenoi18n(b' empty : ' + fmt % pcfmt(numempty, numrevs))
486 ui.writenoi18n(b' empty : ' + fmt % pcfmt(numempty, numrevs))
483 ui.writenoi18n(
487 ui.writenoi18n(
484 b' text : '
488 b' text : '
485 + fmt % pcfmt(numemptytext, numemptytext + numemptydelta)
489 + fmt % pcfmt(numemptytext, numemptytext + numemptydelta)
486 )
490 )
487 ui.writenoi18n(
491 ui.writenoi18n(
488 b' delta : '
492 b' delta : '
489 + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta)
493 + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta)
490 )
494 )
491 ui.writenoi18n(
495 ui.writenoi18n(
492 b' snapshot : ' + fmt % pcfmt(numfull + numsemi, numrevs)
496 b' snapshot : ' + fmt % pcfmt(numfull + numsemi, numrevs)
493 )
497 )
494 for depth in sorted(numsnapdepth):
498 for depth in sorted(numsnapdepth):
495 base = b' lvl-%-3d : ' % depth
499 base = b' lvl-%-3d : ' % depth
496 count = fmt % pcfmt(numsnapdepth[depth], numrevs)
500 count = fmt % pcfmt(numsnapdepth[depth], numrevs)
497 pieces = [base, count]
501 pieces = [base, count]
498 if numsnapdepth_nad[depth]:
502 if numsnapdepth_nad[depth]:
499 pieces[-1] = count = count[:-1] # drop the final '\n'
503 pieces[-1] = count = count[:-1] # drop the final '\n'
500 more = b' non-ancestor-bases: '
504 more = b' non-ancestor-bases: '
501 anc_count = fmt
505 anc_count = fmt
502 anc_count %= pcfmt(numsnapdepth_nad[depth], numsnapdepth[depth])
506 anc_count %= pcfmt(numsnapdepth_nad[depth], numsnapdepth[depth])
503 pieces.append(more)
507 pieces.append(more)
504 pieces.append(anc_count)
508 pieces.append(anc_count)
505 ui.write(b''.join(pieces))
509 ui.write(b''.join(pieces))
506 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(numdeltas, numrevs))
510 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(numdeltas, numrevs))
507 ui.writenoi18n(b'revision size : ' + fmt2 % totalsize)
511 ui.writenoi18n(b'revision size : ' + fmt2 % totalsize)
508 ui.writenoi18n(
512 ui.writenoi18n(
509 b' snapshot : ' + fmt % pcfmt(fulltotal + semitotal, totalsize)
513 b' snapshot : ' + fmt % pcfmt(fulltotal + semitotal, totalsize)
510 )
514 )
511 for depth in sorted(numsnapdepth):
515 for depth in sorted(numsnapdepth):
512 ui.write(
516 ui.write(
513 (b' lvl-%-3d : ' % depth)
517 (b' lvl-%-3d : ' % depth)
514 + fmt % pcfmt(snaptotal[depth], totalsize)
518 + fmt % pcfmt(snaptotal[depth], totalsize)
515 )
519 )
516 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(deltatotal, totalsize))
520 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(deltatotal, totalsize))
517
521
518 letters = string.ascii_letters.encode('ascii')
522 letters = string.ascii_letters.encode('ascii')
519
523
520 def fmtchunktype(chunktype):
524 def fmtchunktype(chunktype):
521 if chunktype == b'empty':
525 if chunktype == b'empty':
522 return b' %s : ' % chunktype
526 return b' %s : ' % chunktype
523 elif chunktype in letters:
527 elif chunktype in letters:
524 return b' 0x%s (%s) : ' % (nodemod.hex(chunktype), chunktype)
528 return b' 0x%s (%s) : ' % (nodemod.hex(chunktype), chunktype)
525 else:
529 else:
526 return b' 0x%s : ' % nodemod.hex(chunktype)
530 return b' 0x%s : ' % nodemod.hex(chunktype)
527
531
528 ui.write(b'\n')
532 ui.write(b'\n')
529 ui.writenoi18n(b'chunks : ' + fmt2 % numrevs)
533 ui.writenoi18n(b'chunks : ' + fmt2 % numrevs)
530 for chunktype in sorted(chunktypecounts):
534 for chunktype in sorted(chunktypecounts):
531 ui.write(fmtchunktype(chunktype))
535 ui.write(fmtchunktype(chunktype))
532 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
536 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
533 ui.writenoi18n(b'chunks size : ' + fmt2 % totalsize)
537 ui.writenoi18n(b'chunks size : ' + fmt2 % totalsize)
534 for chunktype in sorted(chunktypecounts):
538 for chunktype in sorted(chunktypecounts):
535 ui.write(fmtchunktype(chunktype))
539 ui.write(fmtchunktype(chunktype))
536 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
540 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
537
541
538 ui.write(b'\n')
542 ui.write(b'\n')
543 b_total = b"%d" % full_text_total_size
544 p_total = []
545 while len(b_total) > 3:
546 p_total.append(b_total[-3:])
547 b_total = b_total[:-3]
548 p_total.append(b_total)
549 p_total.reverse()
550 b_total = b' '.join(p_total)
551
552 ui.write(b'\n')
553 ui.writenoi18n(b'total-stored-content: %s bytes\n' % b_total)
554 ui.write(b'\n')
539 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
555 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
540 ui.writenoi18n(b'avg chain length : ' + fmt % avgchainlen)
556 ui.writenoi18n(b'avg chain length : ' + fmt % avgchainlen)
541 ui.writenoi18n(b'max chain length : ' + fmt % maxchainlen)
557 ui.writenoi18n(b'max chain length : ' + fmt % maxchainlen)
542 ui.writenoi18n(b'max chain reach : ' + fmt % maxchainspan)
558 ui.writenoi18n(b'max chain reach : ' + fmt % maxchainspan)
543 ui.writenoi18n(b'compression ratio : ' + fmt % compratio)
559 ui.writenoi18n(b'compression ratio : ' + fmt % compratio)
544
560
545 if format > 0:
561 if format > 0:
546 ui.write(b'\n')
562 ui.write(b'\n')
547 ui.writenoi18n(
563 ui.writenoi18n(
548 b'uncompressed data size (min/max/avg) : %d / %d / %d\n'
564 b'uncompressed data size (min/max/avg) : %d / %d / %d\n'
549 % tuple(datasize)
565 % tuple(datasize)
550 )
566 )
551 ui.writenoi18n(
567 ui.writenoi18n(
552 b'full revision size (min/max/avg) : %d / %d / %d\n'
568 b'full revision size (min/max/avg) : %d / %d / %d\n'
553 % tuple(fullsize)
569 % tuple(fullsize)
554 )
570 )
555 ui.writenoi18n(
571 ui.writenoi18n(
556 b'inter-snapshot size (min/max/avg) : %d / %d / %d\n'
572 b'inter-snapshot size (min/max/avg) : %d / %d / %d\n'
557 % tuple(semisize)
573 % tuple(semisize)
558 )
574 )
559 for depth in sorted(snapsizedepth):
575 for depth in sorted(snapsizedepth):
560 if depth == 0:
576 if depth == 0:
561 continue
577 continue
562 ui.writenoi18n(
578 ui.writenoi18n(
563 b' level-%-3d (min/max/avg) : %d / %d / %d\n'
579 b' level-%-3d (min/max/avg) : %d / %d / %d\n'
564 % ((depth,) + tuple(snapsizedepth[depth]))
580 % ((depth,) + tuple(snapsizedepth[depth]))
565 )
581 )
566 ui.writenoi18n(
582 ui.writenoi18n(
567 b'delta size (min/max/avg) : %d / %d / %d\n'
583 b'delta size (min/max/avg) : %d / %d / %d\n'
568 % tuple(deltasize)
584 % tuple(deltasize)
569 )
585 )
570
586
571 if numdeltas > 0:
587 if numdeltas > 0:
572 ui.write(b'\n')
588 ui.write(b'\n')
573 fmt = pcfmtstr(numdeltas)
589 fmt = pcfmtstr(numdeltas)
574 fmt2 = pcfmtstr(numdeltas, 4)
590 fmt2 = pcfmtstr(numdeltas, 4)
575 ui.writenoi18n(
591 ui.writenoi18n(
576 b'deltas against prev : ' + fmt % pcfmt(numprev, numdeltas)
592 b'deltas against prev : ' + fmt % pcfmt(numprev, numdeltas)
577 )
593 )
578 if numprev > 0:
594 if numprev > 0:
579 ui.writenoi18n(
595 ui.writenoi18n(
580 b' where prev = p1 : ' + fmt2 % pcfmt(nump1prev, numprev)
596 b' where prev = p1 : ' + fmt2 % pcfmt(nump1prev, numprev)
581 )
597 )
582 ui.writenoi18n(
598 ui.writenoi18n(
583 b' where prev = p2 : ' + fmt2 % pcfmt(nump2prev, numprev)
599 b' where prev = p2 : ' + fmt2 % pcfmt(nump2prev, numprev)
584 )
600 )
585 ui.writenoi18n(
601 ui.writenoi18n(
586 b' other-ancestor : ' + fmt2 % pcfmt(numoprev, numprev)
602 b' other-ancestor : ' + fmt2 % pcfmt(numoprev, numprev)
587 )
603 )
588 ui.writenoi18n(
604 ui.writenoi18n(
589 b' unrelated : ' + fmt2 % pcfmt(numoprev, numprev)
605 b' unrelated : ' + fmt2 % pcfmt(numoprev, numprev)
590 )
606 )
591 if gdelta:
607 if gdelta:
592 ui.writenoi18n(
608 ui.writenoi18n(
593 b'deltas against p1 : ' + fmt % pcfmt(nump1, numdeltas)
609 b'deltas against p1 : ' + fmt % pcfmt(nump1, numdeltas)
594 )
610 )
595 ui.writenoi18n(
611 ui.writenoi18n(
596 b'deltas against p2 : ' + fmt % pcfmt(nump2, numdeltas)
612 b'deltas against p2 : ' + fmt % pcfmt(nump2, numdeltas)
597 )
613 )
598 ui.writenoi18n(
614 ui.writenoi18n(
599 b'deltas against ancs : '
615 b'deltas against ancs : '
600 + fmt % pcfmt(num_other_ancestors, numdeltas)
616 + fmt % pcfmt(num_other_ancestors, numdeltas)
601 )
617 )
602 ui.writenoi18n(
618 ui.writenoi18n(
603 b'deltas against other : '
619 b'deltas against other : '
604 + fmt % pcfmt(numother_nad, numdeltas)
620 + fmt % pcfmt(numother_nad, numdeltas)
605 )
621 )
@@ -1,717 +1,726 b''
1 $ cat << EOF >> $HGRCPATH
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > interactive=yes
3 > interactive=yes
4 > EOF
4 > EOF
5
5
6 $ hg init debugrevlog
6 $ hg init debugrevlog
7 $ cd debugrevlog
7 $ cd debugrevlog
8 $ echo a > a
8 $ echo a > a
9 $ hg ci -Am adda
9 $ hg ci -Am adda
10 adding a
10 adding a
11 $ hg rm .
11 $ hg rm .
12 removing a
12 removing a
13 $ hg ci -Am make-it-empty
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
14 $ hg revert --all -r 0
15 adding a
15 adding a
16 $ hg ci -Am make-it-full
16 $ hg ci -Am make-it-full
17 #if reporevlogstore
17 #if reporevlogstore
18 $ hg debugrevlog -c
18 $ hg debugrevlog -c
19 format : 1
19 format : 1
20 flags : inline
20 flags : inline
21
21
22 revisions : 3
22 revisions : 3
23 merges : 0 ( 0.00%)
23 merges : 0 ( 0.00%)
24 normal : 3 (100.00%)
24 normal : 3 (100.00%)
25 revisions : 3
25 revisions : 3
26 empty : 0 ( 0.00%)
26 empty : 0 ( 0.00%)
27 text : 0 (100.00%)
27 text : 0 (100.00%)
28 delta : 0 (100.00%)
28 delta : 0 (100.00%)
29 snapshot : 3 (100.00%)
29 snapshot : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
31 deltas : 0 ( 0.00%)
31 deltas : 0 ( 0.00%)
32 revision size : 191
32 revision size : 191
33 snapshot : 191 (100.00%)
33 snapshot : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
35 deltas : 0 ( 0.00%)
35 deltas : 0 ( 0.00%)
36
36
37 chunks : 3
37 chunks : 3
38 0x75 (u) : 3 (100.00%)
38 0x75 (u) : 3 (100.00%)
39 chunks size : 191
39 chunks size : 191
40 0x75 (u) : 191 (100.00%)
40 0x75 (u) : 191 (100.00%)
41
41
42
43 total-stored-content: 188 bytes
44
42 avg chain length : 0
45 avg chain length : 0
43 max chain length : 0
46 max chain length : 0
44 max chain reach : 67
47 max chain reach : 67
45 compression ratio : 0
48 compression ratio : 0
46
49
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
50 uncompressed data size (min/max/avg) : 57 / 66 / 62
48 full revision size (min/max/avg) : 58 / 67 / 63
51 full revision size (min/max/avg) : 58 / 67 / 63
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
52 inter-snapshot size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
53 delta size (min/max/avg) : 0 / 0 / 0
51 $ hg debugrevlog -m
54 $ hg debugrevlog -m
52 format : 1
55 format : 1
53 flags : inline, generaldelta
56 flags : inline, generaldelta
54
57
55 revisions : 3
58 revisions : 3
56 merges : 0 ( 0.00%)
59 merges : 0 ( 0.00%)
57 normal : 3 (100.00%)
60 normal : 3 (100.00%)
58 revisions : 3
61 revisions : 3
59 empty : 1 (33.33%)
62 empty : 1 (33.33%)
60 text : 1 (100.00%)
63 text : 1 (100.00%)
61 delta : 0 ( 0.00%)
64 delta : 0 ( 0.00%)
62 snapshot : 2 (66.67%)
65 snapshot : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
66 lvl-0 : 2 (66.67%)
64 deltas : 0 ( 0.00%)
67 deltas : 0 ( 0.00%)
65 revision size : 88
68 revision size : 88
66 snapshot : 88 (100.00%)
69 snapshot : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
70 lvl-0 : 88 (100.00%)
68 deltas : 0 ( 0.00%)
71 deltas : 0 ( 0.00%)
69
72
70 chunks : 3
73 chunks : 3
71 empty : 1 (33.33%)
74 empty : 1 (33.33%)
72 0x75 (u) : 2 (66.67%)
75 0x75 (u) : 2 (66.67%)
73 chunks size : 88
76 chunks size : 88
74 empty : 0 ( 0.00%)
77 empty : 0 ( 0.00%)
75 0x75 (u) : 88 (100.00%)
78 0x75 (u) : 88 (100.00%)
76
79
80
81 total-stored-content: 86 bytes
82
77 avg chain length : 0
83 avg chain length : 0
78 max chain length : 0
84 max chain length : 0
79 max chain reach : 44
85 max chain reach : 44
80 compression ratio : 0
86 compression ratio : 0
81
87
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
88 uncompressed data size (min/max/avg) : 0 / 43 / 28
83 full revision size (min/max/avg) : 44 / 44 / 44
89 full revision size (min/max/avg) : 44 / 44 / 44
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
90 inter-snapshot size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
91 delta size (min/max/avg) : 0 / 0 / 0
86 $ hg debugrevlog a
92 $ hg debugrevlog a
87 format : 1
93 format : 1
88 flags : inline, generaldelta
94 flags : inline, generaldelta
89
95
90 revisions : 1
96 revisions : 1
91 merges : 0 ( 0.00%)
97 merges : 0 ( 0.00%)
92 normal : 1 (100.00%)
98 normal : 1 (100.00%)
93 revisions : 1
99 revisions : 1
94 empty : 0 ( 0.00%)
100 empty : 0 ( 0.00%)
95 text : 0 (100.00%)
101 text : 0 (100.00%)
96 delta : 0 (100.00%)
102 delta : 0 (100.00%)
97 snapshot : 1 (100.00%)
103 snapshot : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
104 lvl-0 : 1 (100.00%)
99 deltas : 0 ( 0.00%)
105 deltas : 0 ( 0.00%)
100 revision size : 3
106 revision size : 3
101 snapshot : 3 (100.00%)
107 snapshot : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
108 lvl-0 : 3 (100.00%)
103 deltas : 0 ( 0.00%)
109 deltas : 0 ( 0.00%)
104
110
105 chunks : 1
111 chunks : 1
106 0x75 (u) : 1 (100.00%)
112 0x75 (u) : 1 (100.00%)
107 chunks size : 3
113 chunks size : 3
108 0x75 (u) : 3 (100.00%)
114 0x75 (u) : 3 (100.00%)
109
115
116
117 total-stored-content: 2 bytes
118
110 avg chain length : 0
119 avg chain length : 0
111 max chain length : 0
120 max chain length : 0
112 max chain reach : 3
121 max chain reach : 3
113 compression ratio : 0
122 compression ratio : 0
114
123
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
124 uncompressed data size (min/max/avg) : 2 / 2 / 2
116 full revision size (min/max/avg) : 3 / 3 / 3
125 full revision size (min/max/avg) : 3 / 3 / 3
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
126 inter-snapshot size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
127 delta size (min/max/avg) : 0 / 0 / 0
119 #endif
128 #endif
120
129
121 Test debugindex, with and without the --verbose/--debug flag
130 Test debugindex, with and without the --verbose/--debug flag
122 $ hg debugrevlogindex a
131 $ hg debugrevlogindex a
123 rev linkrev nodeid p1 p2
132 rev linkrev nodeid p1 p2
124 0 0 b789fdd96dc2 000000000000 000000000000
133 0 0 b789fdd96dc2 000000000000 000000000000
125
134
126 #if no-reposimplestore
135 #if no-reposimplestore
127 $ hg --verbose debugrevlogindex a
136 $ hg --verbose debugrevlogindex a
128 rev offset length linkrev nodeid p1 p2
137 rev offset length linkrev nodeid p1 p2
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
138 0 0 3 0 b789fdd96dc2 000000000000 000000000000
130
139
131 $ hg --debug debugrevlogindex a
140 $ hg --debug debugrevlogindex a
132 rev offset length linkrev nodeid p1 p2
141 rev offset length linkrev nodeid p1 p2
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
142 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
134 #endif
143 #endif
135
144
136 $ hg debugrevlogindex -f 1 a
145 $ hg debugrevlogindex -f 1 a
137 rev flag size link p1 p2 nodeid
146 rev flag size link p1 p2 nodeid
138 0 0000 2 0 -1 -1 b789fdd96dc2
147 0 0000 2 0 -1 -1 b789fdd96dc2
139
148
140 #if no-reposimplestore
149 #if no-reposimplestore
141 $ hg --verbose debugrevlogindex -f 1 a
150 $ hg --verbose debugrevlogindex -f 1 a
142 rev flag offset length size link p1 p2 nodeid
151 rev flag offset length size link p1 p2 nodeid
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
152 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
144
153
145 $ hg --debug debugrevlogindex -f 1 a
154 $ hg --debug debugrevlogindex -f 1 a
146 rev flag offset length size link p1 p2 nodeid
155 rev flag offset length size link p1 p2 nodeid
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
156 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
148 #endif
157 #endif
149
158
150 $ hg debugindex -c
159 $ hg debugindex -c
151 rev linkrev nodeid p1-nodeid p2-nodeid
160 rev linkrev nodeid p1-nodeid p2-nodeid
152 0 0 07f494440405 000000000000 000000000000
161 0 0 07f494440405 000000000000 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
162 1 1 8cccb4b5fec2 07f494440405 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
163 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
155 $ hg debugindex -c --debug
164 $ hg debugindex -c --debug
156 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
165 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
157 0 -1 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 inline 0 0
166 0 -1 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 inline 0 0
158 1 -1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 inline 0 0
167 1 -1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 inline 0 0
159 2 -1 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 inline 0 0
168 2 -1 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 inline 0 0
160 $ hg debugindex -m
169 $ hg debugindex -m
161 rev linkrev nodeid p1-nodeid p2-nodeid
170 rev linkrev nodeid p1-nodeid p2-nodeid
162 0 0 a0c8bcbbb45c 000000000000 000000000000
171 0 0 a0c8bcbbb45c 000000000000 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
172 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
173 2 2 a35b10320954 57faf8a737ae 000000000000
165 $ hg debugindex -m --debug
174 $ hg debugindex -m --debug
166 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
175 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
167 0 -1 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 inline 0 0
176 0 -1 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 inline 0 0
168 1 -1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 inline 0 0
177 1 -1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 inline 0 0
169 2 -1 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 inline 0 0
178 2 -1 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 inline 0 0
170 $ hg debugindex a
179 $ hg debugindex a
171 rev linkrev nodeid p1-nodeid p2-nodeid
180 rev linkrev nodeid p1-nodeid p2-nodeid
172 0 0 b789fdd96dc2 000000000000 000000000000
181 0 0 b789fdd96dc2 000000000000 000000000000
173 $ hg debugindex --debug a
182 $ hg debugindex --debug a
174 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
183 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
175 0 -1 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 inline 0 0
184 0 -1 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 inline 0 0
176
185
177 debugdelta chain basic output
186 debugdelta chain basic output
178
187
179 #if reporevlogstore pure
188 #if reporevlogstore pure
180 $ hg debugindexstats
189 $ hg debugindexstats
181 abort: debugindexstats only works with native code
190 abort: debugindexstats only works with native code
182 [255]
191 [255]
183 #endif
192 #endif
184 #if reporevlogstore no-pure
193 #if reporevlogstore no-pure
185 $ hg debugindexstats
194 $ hg debugindexstats
186 node trie capacity: 4
195 node trie capacity: 4
187 node trie count: 2
196 node trie count: 2
188 node trie depth: 1
197 node trie depth: 1
189 node trie last rev scanned: -1 (no-rust !)
198 node trie last rev scanned: -1 (no-rust !)
190 node trie last rev scanned: 3 (rust !)
199 node trie last rev scanned: 3 (rust !)
191 node trie lookups: 4 (no-rust !)
200 node trie lookups: 4 (no-rust !)
192 node trie lookups: 2 (rust !)
201 node trie lookups: 2 (rust !)
193 node trie misses: 1
202 node trie misses: 1
194 node trie splits: 1
203 node trie splits: 1
195 revs in memory: 3
204 revs in memory: 3
196 #endif
205 #endif
197
206
198 #if reporevlogstore no-pure
207 #if reporevlogstore no-pure
199 $ hg debugdeltachain -m
208 $ hg debugdeltachain -m
200 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
209 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
201 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
210 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
202 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
211 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
203 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
212 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
204
213
205 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
214 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
206 0 1 1
215 0 1 1
207 1 2 1
216 1 2 1
208 2 3 1
217 2 3 1
209
218
210 $ hg debugdeltachain -m -Tjson
219 $ hg debugdeltachain -m -Tjson
211 [
220 [
212 {
221 {
213 "chainid": 1,
222 "chainid": 1,
214 "chainlen": 1,
223 "chainlen": 1,
215 "chainratio": 1.0232558139534884, (py3 !)
224 "chainratio": 1.0232558139534884, (py3 !)
216 "chainsize": 44,
225 "chainsize": 44,
217 "compsize": 44,
226 "compsize": 44,
218 "deltatype": "base",
227 "deltatype": "base",
219 "extradist": 0,
228 "extradist": 0,
220 "extraratio": 0.0,
229 "extraratio": 0.0,
221 "largestblock": 44,
230 "largestblock": 44,
222 "lindist": 44,
231 "lindist": 44,
223 "p1": -1,
232 "p1": -1,
224 "p2": -1,
233 "p2": -1,
225 "prevrev": -1,
234 "prevrev": -1,
226 "readdensity": 1.0,
235 "readdensity": 1.0,
227 "readsize": 44,
236 "readsize": 44,
228 "rev": 0,
237 "rev": 0,
229 "srchunks": 1,
238 "srchunks": 1,
230 "uncompsize": 43
239 "uncompsize": 43
231 },
240 },
232 {
241 {
233 "chainid": 2,
242 "chainid": 2,
234 "chainlen": 1,
243 "chainlen": 1,
235 "chainratio": 0,
244 "chainratio": 0,
236 "chainsize": 0,
245 "chainsize": 0,
237 "compsize": 0,
246 "compsize": 0,
238 "deltatype": "base",
247 "deltatype": "base",
239 "extradist": 0,
248 "extradist": 0,
240 "extraratio": 0,
249 "extraratio": 0,
241 "largestblock": 0,
250 "largestblock": 0,
242 "lindist": 0,
251 "lindist": 0,
243 "p1": 0,
252 "p1": 0,
244 "p2": -1,
253 "p2": -1,
245 "prevrev": -1,
254 "prevrev": -1,
246 "readdensity": 1,
255 "readdensity": 1,
247 "readsize": 0,
256 "readsize": 0,
248 "rev": 1,
257 "rev": 1,
249 "srchunks": 1,
258 "srchunks": 1,
250 "uncompsize": 0
259 "uncompsize": 0
251 },
260 },
252 {
261 {
253 "chainid": 3,
262 "chainid": 3,
254 "chainlen": 1,
263 "chainlen": 1,
255 "chainratio": 1.0232558139534884, (py3 !)
264 "chainratio": 1.0232558139534884, (py3 !)
256 "chainsize": 44,
265 "chainsize": 44,
257 "compsize": 44,
266 "compsize": 44,
258 "deltatype": "base",
267 "deltatype": "base",
259 "extradist": 0,
268 "extradist": 0,
260 "extraratio": 0.0,
269 "extraratio": 0.0,
261 "largestblock": 44,
270 "largestblock": 44,
262 "lindist": 44,
271 "lindist": 44,
263 "p1": 1,
272 "p1": 1,
264 "p2": -1,
273 "p2": -1,
265 "prevrev": -1,
274 "prevrev": -1,
266 "readdensity": 1.0,
275 "readdensity": 1.0,
267 "readsize": 44,
276 "readsize": 44,
268 "rev": 2,
277 "rev": 2,
269 "srchunks": 1,
278 "srchunks": 1,
270 "uncompsize": 43
279 "uncompsize": 43
271 }
280 }
272 ]
281 ]
273
282
274 debugdelta chain with sparse read enabled
283 debugdelta chain with sparse read enabled
275
284
276 $ cat >> $HGRCPATH <<EOF
285 $ cat >> $HGRCPATH <<EOF
277 > [experimental]
286 > [experimental]
278 > sparse-read = True
287 > sparse-read = True
279 > EOF
288 > EOF
280 $ hg debugdeltachain -m
289 $ hg debugdeltachain -m
281 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
290 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
282 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
291 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
283 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
292 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
284 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
293 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
285
294
286 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
295 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
287 0 1 1 44 44 1.0
296 0 1 1 44 44 1.0
288 1 2 1 0 0 1
297 1 2 1 0 0 1
289 2 3 1 44 44 1.0
298 2 3 1 44 44 1.0
290
299
291 $ hg debugdeltachain -m -Tjson
300 $ hg debugdeltachain -m -Tjson
292 [
301 [
293 {
302 {
294 "chainid": 1,
303 "chainid": 1,
295 "chainlen": 1,
304 "chainlen": 1,
296 "chainratio": 1.0232558139534884, (py3 !)
305 "chainratio": 1.0232558139534884, (py3 !)
297 "chainsize": 44,
306 "chainsize": 44,
298 "compsize": 44,
307 "compsize": 44,
299 "deltatype": "base",
308 "deltatype": "base",
300 "extradist": 0,
309 "extradist": 0,
301 "extraratio": 0.0,
310 "extraratio": 0.0,
302 "largestblock": 44,
311 "largestblock": 44,
303 "lindist": 44,
312 "lindist": 44,
304 "p1": -1,
313 "p1": -1,
305 "p2": -1,
314 "p2": -1,
306 "prevrev": -1,
315 "prevrev": -1,
307 "readdensity": 1.0,
316 "readdensity": 1.0,
308 "readsize": 44,
317 "readsize": 44,
309 "rev": 0,
318 "rev": 0,
310 "srchunks": 1,
319 "srchunks": 1,
311 "uncompsize": 43
320 "uncompsize": 43
312 },
321 },
313 {
322 {
314 "chainid": 2,
323 "chainid": 2,
315 "chainlen": 1,
324 "chainlen": 1,
316 "chainratio": 0,
325 "chainratio": 0,
317 "chainsize": 0,
326 "chainsize": 0,
318 "compsize": 0,
327 "compsize": 0,
319 "deltatype": "base",
328 "deltatype": "base",
320 "extradist": 0,
329 "extradist": 0,
321 "extraratio": 0,
330 "extraratio": 0,
322 "largestblock": 0,
331 "largestblock": 0,
323 "lindist": 0,
332 "lindist": 0,
324 "p1": 0,
333 "p1": 0,
325 "p2": -1,
334 "p2": -1,
326 "prevrev": -1,
335 "prevrev": -1,
327 "readdensity": 1,
336 "readdensity": 1,
328 "readsize": 0,
337 "readsize": 0,
329 "rev": 1,
338 "rev": 1,
330 "srchunks": 1,
339 "srchunks": 1,
331 "uncompsize": 0
340 "uncompsize": 0
332 },
341 },
333 {
342 {
334 "chainid": 3,
343 "chainid": 3,
335 "chainlen": 1,
344 "chainlen": 1,
336 "chainratio": 1.0232558139534884, (py3 !)
345 "chainratio": 1.0232558139534884, (py3 !)
337 "chainsize": 44,
346 "chainsize": 44,
338 "compsize": 44,
347 "compsize": 44,
339 "deltatype": "base",
348 "deltatype": "base",
340 "extradist": 0,
349 "extradist": 0,
341 "extraratio": 0.0,
350 "extraratio": 0.0,
342 "largestblock": 44,
351 "largestblock": 44,
343 "lindist": 44,
352 "lindist": 44,
344 "p1": 1,
353 "p1": 1,
345 "p2": -1,
354 "p2": -1,
346 "prevrev": -1,
355 "prevrev": -1,
347 "readdensity": 1.0,
356 "readdensity": 1.0,
348 "readsize": 44,
357 "readsize": 44,
349 "rev": 2,
358 "rev": 2,
350 "srchunks": 1,
359 "srchunks": 1,
351 "uncompsize": 43
360 "uncompsize": 43
352 }
361 }
353 ]
362 ]
354
363
355 $ printf "This test checks things.\n" >> a
364 $ printf "This test checks things.\n" >> a
356 $ hg ci -m a
365 $ hg ci -m a
357 $ hg branch other
366 $ hg branch other
358 marked working directory as branch other
367 marked working directory as branch other
359 (branches are permanent and global, did you want a bookmark?)
368 (branches are permanent and global, did you want a bookmark?)
360 $ for i in `$TESTDIR/seq.py 5`; do
369 $ for i in `$TESTDIR/seq.py 5`; do
361 > printf "shorter ${i}" >> a
370 > printf "shorter ${i}" >> a
362 > hg ci -m "a other:$i"
371 > hg ci -m "a other:$i"
363 > hg up -q default
372 > hg up -q default
364 > printf "for the branch default we want longer chains: ${i}" >> a
373 > printf "for the branch default we want longer chains: ${i}" >> a
365 > hg ci -m "a default:$i"
374 > hg ci -m "a default:$i"
366 > hg up -q other
375 > hg up -q other
367 > done
376 > done
368 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
377 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
369 > --config experimental.sparse-read.density-threshold=0.50 \
378 > --config experimental.sparse-read.density-threshold=0.50 \
370 > --config experimental.sparse-read.min-gap-size=0
379 > --config experimental.sparse-read.min-gap-size=0
371 0 1
380 0 1
372 1 1
381 1 1
373 2 1
382 2 1
374 3 1
383 3 1
375 4 1
384 4 1
376 5 1
385 5 1
377 6 1
386 6 1
378 7 1
387 7 1
379 8 1
388 8 1
380 9 1
389 9 1
381 10 2 (no-zstd !)
390 10 2 (no-zstd !)
382 10 1 (zstd !)
391 10 1 (zstd !)
383 11 1
392 11 1
384 $ hg --config extensions.strip= strip --no-backup -r 1
393 $ hg --config extensions.strip= strip --no-backup -r 1
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
386
395
387 Test max chain len
396 Test max chain len
388 $ cat >> $HGRCPATH << EOF
397 $ cat >> $HGRCPATH << EOF
389 > [format]
398 > [format]
390 > maxchainlen=4
399 > maxchainlen=4
391 > EOF
400 > EOF
392
401
393 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
402 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
394 $ hg ci -m a
403 $ hg ci -m a
395 $ printf "b\n" >> a
404 $ printf "b\n" >> a
396 $ hg ci -m a
405 $ hg ci -m a
397 $ printf "c\n" >> a
406 $ printf "c\n" >> a
398 $ hg ci -m a
407 $ hg ci -m a
399 $ printf "d\n" >> a
408 $ printf "d\n" >> a
400 $ hg ci -m a
409 $ hg ci -m a
401 $ printf "e\n" >> a
410 $ printf "e\n" >> a
402 $ hg ci -m a
411 $ hg ci -m a
403 $ printf "f\n" >> a
412 $ printf "f\n" >> a
404 $ hg ci -m a
413 $ hg ci -m a
405 $ printf 'g\n' >> a
414 $ printf 'g\n' >> a
406 $ hg ci -m a
415 $ hg ci -m a
407 $ printf 'h\n' >> a
416 $ printf 'h\n' >> a
408 $ hg ci -m a
417 $ hg ci -m a
409
418
410 $ hg debugrevlog -d a
419 $ hg debugrevlog -d a
411 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
420 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
412 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
421 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
413 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
422 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
414 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
423 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
415 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
424 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
416 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
425 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
417 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
426 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
418 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
427 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
419 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
428 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
420 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
429 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
421 #endif
430 #endif
422
431
423 Test debuglocks command:
432 Test debuglocks command:
424
433
425 $ hg debuglocks
434 $ hg debuglocks
426 lock: free
435 lock: free
427 wlock: free
436 wlock: free
428
437
429 * Test setting the lock
438 * Test setting the lock
430
439
431 waitlock <file> will wait for file to be created. If it isn't in a reasonable
440 waitlock <file> will wait for file to be created. If it isn't in a reasonable
432 amount of time, displays error message and returns 1
441 amount of time, displays error message and returns 1
433 $ waitlock() {
442 $ waitlock() {
434 > start=`date +%s`
443 > start=`date +%s`
435 > timeout=5
444 > timeout=5
436 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
445 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
437 > now=`date +%s`
446 > now=`date +%s`
438 > if [ "`expr $now - $start`" -gt $timeout ]; then
447 > if [ "`expr $now - $start`" -gt $timeout ]; then
439 > echo "timeout: $1 was not created in $timeout seconds"
448 > echo "timeout: $1 was not created in $timeout seconds"
440 > return 1
449 > return 1
441 > fi
450 > fi
442 > sleep 0.1
451 > sleep 0.1
443 > done
452 > done
444 > }
453 > }
445 $ dolock() {
454 $ dolock() {
446 > {
455 > {
447 > waitlock .hg/unlock
456 > waitlock .hg/unlock
448 > rm -f .hg/unlock
457 > rm -f .hg/unlock
449 > echo y
458 > echo y
450 > } | hg debuglocks "$@" > /dev/null
459 > } | hg debuglocks "$@" > /dev/null
451 > }
460 > }
452 $ dolock -s &
461 $ dolock -s &
453 $ waitlock .hg/store/lock
462 $ waitlock .hg/store/lock
454
463
455 $ hg debuglocks
464 $ hg debuglocks
456 lock: user *, process * (*s) (glob)
465 lock: user *, process * (*s) (glob)
457 wlock: free
466 wlock: free
458 [1]
467 [1]
459 $ touch .hg/unlock
468 $ touch .hg/unlock
460 $ wait
469 $ wait
461 $ [ -f .hg/store/lock ] || echo "There is no lock"
470 $ [ -f .hg/store/lock ] || echo "There is no lock"
462 There is no lock
471 There is no lock
463
472
464 * Test setting the wlock
473 * Test setting the wlock
465
474
466 $ dolock -S &
475 $ dolock -S &
467 $ waitlock .hg/wlock
476 $ waitlock .hg/wlock
468
477
469 $ hg debuglocks
478 $ hg debuglocks
470 lock: free
479 lock: free
471 wlock: user *, process * (*s) (glob)
480 wlock: user *, process * (*s) (glob)
472 [1]
481 [1]
473 $ touch .hg/unlock
482 $ touch .hg/unlock
474 $ wait
483 $ wait
475 $ [ -f .hg/wlock ] || echo "There is no wlock"
484 $ [ -f .hg/wlock ] || echo "There is no wlock"
476 There is no wlock
485 There is no wlock
477
486
478 * Test setting both locks
487 * Test setting both locks
479
488
480 $ dolock -Ss &
489 $ dolock -Ss &
481 $ waitlock .hg/wlock && waitlock .hg/store/lock
490 $ waitlock .hg/wlock && waitlock .hg/store/lock
482
491
483 $ hg debuglocks
492 $ hg debuglocks
484 lock: user *, process * (*s) (glob)
493 lock: user *, process * (*s) (glob)
485 wlock: user *, process * (*s) (glob)
494 wlock: user *, process * (*s) (glob)
486 [2]
495 [2]
487
496
488 * Test failing to set a lock
497 * Test failing to set a lock
489
498
490 $ hg debuglocks -s
499 $ hg debuglocks -s
491 abort: lock is already held
500 abort: lock is already held
492 [255]
501 [255]
493
502
494 $ hg debuglocks -S
503 $ hg debuglocks -S
495 abort: wlock is already held
504 abort: wlock is already held
496 [255]
505 [255]
497
506
498 $ touch .hg/unlock
507 $ touch .hg/unlock
499 $ wait
508 $ wait
500
509
501 $ hg debuglocks
510 $ hg debuglocks
502 lock: free
511 lock: free
503 wlock: free
512 wlock: free
504
513
505 * Test forcing the lock
514 * Test forcing the lock
506
515
507 $ dolock -s &
516 $ dolock -s &
508 $ waitlock .hg/store/lock
517 $ waitlock .hg/store/lock
509
518
510 $ hg debuglocks
519 $ hg debuglocks
511 lock: user *, process * (*s) (glob)
520 lock: user *, process * (*s) (glob)
512 wlock: free
521 wlock: free
513 [1]
522 [1]
514
523
515 $ hg debuglocks -L
524 $ hg debuglocks -L
516
525
517 $ hg debuglocks
526 $ hg debuglocks
518 lock: free
527 lock: free
519 wlock: free
528 wlock: free
520
529
521 $ touch .hg/unlock
530 $ touch .hg/unlock
522 $ wait
531 $ wait
523
532
524 * Test forcing the wlock
533 * Test forcing the wlock
525
534
526 $ dolock -S &
535 $ dolock -S &
527 $ waitlock .hg/wlock
536 $ waitlock .hg/wlock
528
537
529 $ hg debuglocks
538 $ hg debuglocks
530 lock: free
539 lock: free
531 wlock: user *, process * (*s) (glob)
540 wlock: user *, process * (*s) (glob)
532 [1]
541 [1]
533
542
534 $ hg debuglocks -W
543 $ hg debuglocks -W
535
544
536 $ hg debuglocks
545 $ hg debuglocks
537 lock: free
546 lock: free
538 wlock: free
547 wlock: free
539
548
540 $ touch .hg/unlock
549 $ touch .hg/unlock
541 $ wait
550 $ wait
542
551
543 Test WdirUnsupported exception
552 Test WdirUnsupported exception
544
553
545 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
554 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
546 abort: working directory revision cannot be specified
555 abort: working directory revision cannot be specified
547 [255]
556 [255]
548
557
549 Test cache warming command
558 Test cache warming command
550
559
551 $ rm -rf .hg/cache/
560 $ rm -rf .hg/cache/
552 $ hg debugupdatecaches --debug
561 $ hg debugupdatecaches --debug
553 updating the branch cache
562 updating the branch cache
554 $ ls -r .hg/cache/*
563 $ ls -r .hg/cache/*
555 .hg/cache/tags2-served
564 .hg/cache/tags2-served
556 .hg/cache/tags2
565 .hg/cache/tags2
557 .hg/cache/rbc-revs-v1
566 .hg/cache/rbc-revs-v1
558 .hg/cache/rbc-names-v1
567 .hg/cache/rbc-names-v1
559 .hg/cache/hgtagsfnodes1
568 .hg/cache/hgtagsfnodes1
560 .hg/cache/branch2-visible-hidden
569 .hg/cache/branch2-visible-hidden
561 .hg/cache/branch2-visible
570 .hg/cache/branch2-visible
562 .hg/cache/branch2-served.hidden
571 .hg/cache/branch2-served.hidden
563 .hg/cache/branch2-served
572 .hg/cache/branch2-served
564 .hg/cache/branch2-immutable
573 .hg/cache/branch2-immutable
565 .hg/cache/branch2-base
574 .hg/cache/branch2-base
566
575
567 Test debugcolor
576 Test debugcolor
568
577
569 #if no-windows
578 #if no-windows
570 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
579 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
571 color mode: 'ansi'
580 color mode: 'ansi'
572 available style:
581 available style:
573 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
582 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
574 #endif
583 #endif
575
584
576 $ hg debugcolor --style --color never
585 $ hg debugcolor --style --color never
577 color mode: None
586 color mode: None
578 available style:
587 available style:
579
588
580 $ cd ..
589 $ cd ..
581
590
582 Test internal debugstacktrace command
591 Test internal debugstacktrace command
583
592
584 $ cat > debugstacktrace.py << EOF
593 $ cat > debugstacktrace.py << EOF
585 > from mercurial import (
594 > from mercurial import (
586 > util,
595 > util,
587 > )
596 > )
588 > from mercurial.utils import (
597 > from mercurial.utils import (
589 > procutil,
598 > procutil,
590 > )
599 > )
591 > def f():
600 > def f():
592 > util.debugstacktrace(f=procutil.stdout)
601 > util.debugstacktrace(f=procutil.stdout)
593 > g()
602 > g()
594 > def g():
603 > def g():
595 > util.dst(b'hello from g\\n', skip=1)
604 > util.dst(b'hello from g\\n', skip=1)
596 > h()
605 > h()
597 > def h():
606 > def h():
598 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
607 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
599 > f()
608 > f()
600 > EOF
609 > EOF
601 $ "$PYTHON" debugstacktrace.py
610 $ "$PYTHON" debugstacktrace.py
602 stacktrace at:
611 stacktrace at:
603 *debugstacktrace.py:15 in * (glob)
612 *debugstacktrace.py:15 in * (glob)
604 *debugstacktrace.py:8 in f (glob)
613 *debugstacktrace.py:8 in f (glob)
605 hello from g at:
614 hello from g at:
606 *debugstacktrace.py:15 in * (glob)
615 *debugstacktrace.py:15 in * (glob)
607 *debugstacktrace.py:9 in f (glob)
616 *debugstacktrace.py:9 in f (glob)
608 hi ...
617 hi ...
609 from h hidden in g at:
618 from h hidden in g at:
610 *debugstacktrace.py:9 in f (glob)
619 *debugstacktrace.py:9 in f (glob)
611 *debugstacktrace.py:12 in g (glob)
620 *debugstacktrace.py:12 in g (glob)
612
621
613 Test debugcapabilities command:
622 Test debugcapabilities command:
614
623
615 $ hg debugcapabilities ./debugrevlog/
624 $ hg debugcapabilities ./debugrevlog/
616 Main capabilities:
625 Main capabilities:
617 branchmap
626 branchmap
618 $USUAL_BUNDLE2_CAPS$
627 $USUAL_BUNDLE2_CAPS$
619 getbundle
628 getbundle
620 known
629 known
621 lookup
630 lookup
622 pushkey
631 pushkey
623 unbundle
632 unbundle
624 Bundle2 capabilities:
633 Bundle2 capabilities:
625 HG20
634 HG20
626 bookmarks
635 bookmarks
627 changegroup
636 changegroup
628 01
637 01
629 02
638 02
630 checkheads
639 checkheads
631 related
640 related
632 digests
641 digests
633 md5
642 md5
634 sha1
643 sha1
635 sha512
644 sha512
636 error
645 error
637 abort
646 abort
638 unsupportedcontent
647 unsupportedcontent
639 pushraced
648 pushraced
640 pushkey
649 pushkey
641 hgtagsfnodes
650 hgtagsfnodes
642 listkeys
651 listkeys
643 phases
652 phases
644 heads
653 heads
645 pushkey
654 pushkey
646 remote-changegroup
655 remote-changegroup
647 http
656 http
648 https
657 https
649 stream
658 stream
650 v2
659 v2
651
660
652 Test debugpeer
661 Test debugpeer
653
662
654 $ hg debugpeer ssh://user@dummy/debugrevlog
663 $ hg debugpeer ssh://user@dummy/debugrevlog
655 url: ssh://user@dummy/debugrevlog
664 url: ssh://user@dummy/debugrevlog
656 local: no
665 local: no
657 pushable: yes
666 pushable: yes
658
667
659 #if rust
668 #if rust
660
669
661 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
670 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
662 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
671 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
663 devel-peer-request: hello+between
672 devel-peer-request: hello+between
664 devel-peer-request: pairs: 81 bytes
673 devel-peer-request: pairs: 81 bytes
665 sending hello command
674 sending hello command
666 sending between command
675 sending between command
667 remote: 468
676 remote: 468
668 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
677 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
669 remote: 1
678 remote: 1
670 devel-peer-request: protocaps
679 devel-peer-request: protocaps
671 devel-peer-request: caps: * bytes (glob)
680 devel-peer-request: caps: * bytes (glob)
672 sending protocaps command
681 sending protocaps command
673 url: ssh://user@dummy/debugrevlog
682 url: ssh://user@dummy/debugrevlog
674 local: no
683 local: no
675 pushable: yes
684 pushable: yes
676
685
677 #endif
686 #endif
678
687
679 #if no-rust zstd
688 #if no-rust zstd
680
689
681 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
690 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
682 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
691 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
683 devel-peer-request: hello+between
692 devel-peer-request: hello+between
684 devel-peer-request: pairs: 81 bytes
693 devel-peer-request: pairs: 81 bytes
685 sending hello command
694 sending hello command
686 sending between command
695 sending between command
687 remote: 468
696 remote: 468
688 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
697 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
689 remote: 1
698 remote: 1
690 devel-peer-request: protocaps
699 devel-peer-request: protocaps
691 devel-peer-request: caps: * bytes (glob)
700 devel-peer-request: caps: * bytes (glob)
692 sending protocaps command
701 sending protocaps command
693 url: ssh://user@dummy/debugrevlog
702 url: ssh://user@dummy/debugrevlog
694 local: no
703 local: no
695 pushable: yes
704 pushable: yes
696
705
697 #endif
706 #endif
698
707
699 #if no-rust no-zstd
708 #if no-rust no-zstd
700
709
701 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
710 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
702 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
711 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
703 devel-peer-request: hello+between
712 devel-peer-request: hello+between
704 devel-peer-request: pairs: 81 bytes
713 devel-peer-request: pairs: 81 bytes
705 sending hello command
714 sending hello command
706 sending between command
715 sending between command
707 remote: 444
716 remote: 444
708 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
717 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
709 remote: 1
718 remote: 1
710 devel-peer-request: protocaps
719 devel-peer-request: protocaps
711 devel-peer-request: caps: * bytes (glob)
720 devel-peer-request: caps: * bytes (glob)
712 sending protocaps command
721 sending protocaps command
713 url: ssh://user@dummy/debugrevlog
722 url: ssh://user@dummy/debugrevlog
714 local: no
723 local: no
715 pushable: yes
724 pushable: yes
716
725
717 #endif
726 #endif
@@ -1,323 +1,326 b''
1 ====================================
1 ====================================
2 Test delta choice with sparse revlog
2 Test delta choice with sparse revlog
3 ====================================
3 ====================================
4
4
5 Sparse-revlog usually shows the most gain on Manifest. However, it is simpler
5 Sparse-revlog usually shows the most gain on Manifest. However, it is simpler
6 to general an appropriate file, so we test with a single file instead. The
6 to general an appropriate file, so we test with a single file instead. The
7 goal is to observe intermediate snapshot being created.
7 goal is to observe intermediate snapshot being created.
8
8
9 We need a large enough file. Part of the content needs to be replaced
9 We need a large enough file. Part of the content needs to be replaced
10 repeatedly while some of it changes rarely.
10 repeatedly while some of it changes rarely.
11
11
12 $ bundlepath="$TESTDIR/artifacts/cache/big-file-churn.hg"
12 $ bundlepath="$TESTDIR/artifacts/cache/big-file-churn.hg"
13
13
14 $ expectedhash=`cat "$bundlepath".md5`
14 $ expectedhash=`cat "$bundlepath".md5`
15
15
16 #if slow
16 #if slow
17
17
18 $ if [ ! -f "$bundlepath" ]; then
18 $ if [ ! -f "$bundlepath" ]; then
19 > "$TESTDIR"/artifacts/scripts/generate-churning-bundle.py > /dev/null
19 > "$TESTDIR"/artifacts/scripts/generate-churning-bundle.py > /dev/null
20 > fi
20 > fi
21
21
22 #else
22 #else
23
23
24 $ if [ ! -f "$bundlepath" ]; then
24 $ if [ ! -f "$bundlepath" ]; then
25 > echo 'skipped: missing artifact, run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
25 > echo 'skipped: missing artifact, run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
26 > exit 80
26 > exit 80
27 > fi
27 > fi
28
28
29 #endif
29 #endif
30
30
31 $ currenthash=`f -M "$bundlepath" | cut -d = -f 2`
31 $ currenthash=`f -M "$bundlepath" | cut -d = -f 2`
32 $ if [ "$currenthash" != "$expectedhash" ]; then
32 $ if [ "$currenthash" != "$expectedhash" ]; then
33 > echo 'skipped: outdated artifact, md5 "'"$currenthash"'" expected "'"$expectedhash"'" run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
33 > echo 'skipped: outdated artifact, md5 "'"$currenthash"'" expected "'"$expectedhash"'" run "'"$TESTDIR"'/artifacts/scripts/generate-churning-bundle.py"'
34 > exit 80
34 > exit 80
35 > fi
35 > fi
36
36
37 $ cat >> $HGRCPATH << EOF
37 $ cat >> $HGRCPATH << EOF
38 > [format]
38 > [format]
39 > sparse-revlog = yes
39 > sparse-revlog = yes
40 > maxchainlen = 15
40 > maxchainlen = 15
41 > [storage]
41 > [storage]
42 > revlog.optimize-delta-parent-choice = yes
42 > revlog.optimize-delta-parent-choice = yes
43 > revlog.reuse-external-delta = no
43 > revlog.reuse-external-delta = no
44 > EOF
44 > EOF
45 $ hg init sparse-repo
45 $ hg init sparse-repo
46 $ cd sparse-repo
46 $ cd sparse-repo
47 $ hg unbundle $bundlepath
47 $ hg unbundle $bundlepath
48 adding changesets
48 adding changesets
49 adding manifests
49 adding manifests
50 adding file changes
50 adding file changes
51 added 5001 changesets with 5001 changes to 1 files (+89 heads)
51 added 5001 changesets with 5001 changes to 1 files (+89 heads)
52 new changesets 9706f5af64f4:d9032adc8114 (5001 drafts)
52 new changesets 9706f5af64f4:d9032adc8114 (5001 drafts)
53 (run 'hg heads' to see heads, 'hg merge' to merge)
53 (run 'hg heads' to see heads, 'hg merge' to merge)
54 $ hg up
54 $ hg up
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 updated to "d9032adc8114: commit #5000"
56 updated to "d9032adc8114: commit #5000"
57 89 other heads for branch "default"
57 89 other heads for branch "default"
58
58
59 $ hg log --stat -r 0:3
59 $ hg log --stat -r 0:3
60 changeset: 0:9706f5af64f4
60 changeset: 0:9706f5af64f4
61 user: test
61 user: test
62 date: Thu Jan 01 00:00:00 1970 +0000
62 date: Thu Jan 01 00:00:00 1970 +0000
63 summary: initial commit
63 summary: initial commit
64
64
65 SPARSE-REVLOG-TEST-FILE | 10500 ++++++++++++++++++++++++++++++++++++++++++++++
65 SPARSE-REVLOG-TEST-FILE | 10500 ++++++++++++++++++++++++++++++++++++++++++++++
66 1 files changed, 10500 insertions(+), 0 deletions(-)
66 1 files changed, 10500 insertions(+), 0 deletions(-)
67
67
68 changeset: 1:724907deaa5e
68 changeset: 1:724907deaa5e
69 user: test
69 user: test
70 date: Thu Jan 01 00:00:00 1970 +0000
70 date: Thu Jan 01 00:00:00 1970 +0000
71 summary: commit #1
71 summary: commit #1
72
72
73 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
73 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
74 1 files changed, 534 insertions(+), 534 deletions(-)
74 1 files changed, 534 insertions(+), 534 deletions(-)
75
75
76 changeset: 2:62c41bce3e5d
76 changeset: 2:62c41bce3e5d
77 user: test
77 user: test
78 date: Thu Jan 01 00:00:00 1970 +0000
78 date: Thu Jan 01 00:00:00 1970 +0000
79 summary: commit #2
79 summary: commit #2
80
80
81 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
81 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
82 1 files changed, 534 insertions(+), 534 deletions(-)
82 1 files changed, 534 insertions(+), 534 deletions(-)
83
83
84 changeset: 3:348a9cbd6959
84 changeset: 3:348a9cbd6959
85 user: test
85 user: test
86 date: Thu Jan 01 00:00:00 1970 +0000
86 date: Thu Jan 01 00:00:00 1970 +0000
87 summary: commit #3
87 summary: commit #3
88
88
89 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
89 SPARSE-REVLOG-TEST-FILE | 1068 +++++++++++++++++++++++-----------------------
90 1 files changed, 534 insertions(+), 534 deletions(-)
90 1 files changed, 534 insertions(+), 534 deletions(-)
91
91
92
92
93 $ f -s .hg/store/data/*.d
93 $ f -s .hg/store/data/*.d
94 .hg/store/data/_s_p_a_r_s_e-_r_e_v_l_o_g-_t_e_s_t-_f_i_l_e.d: size=58616973
94 .hg/store/data/_s_p_a_r_s_e-_r_e_v_l_o_g-_t_e_s_t-_f_i_l_e.d: size=58616973
95 $ hg debugrevlog *
95 $ hg debugrevlog *
96 format : 1
96 format : 1
97 flags : generaldelta
97 flags : generaldelta
98
98
99 revisions : 5001
99 revisions : 5001
100 merges : 625 (12.50%)
100 merges : 625 (12.50%)
101 normal : 4376 (87.50%)
101 normal : 4376 (87.50%)
102 revisions : 5001
102 revisions : 5001
103 empty : 0 ( 0.00%)
103 empty : 0 ( 0.00%)
104 text : 0 (100.00%)
104 text : 0 (100.00%)
105 delta : 0 (100.00%)
105 delta : 0 (100.00%)
106 snapshot : 383 ( 7.66%)
106 snapshot : 383 ( 7.66%)
107 lvl-0 : 3 ( 0.06%)
107 lvl-0 : 3 ( 0.06%)
108 lvl-1 : 18 ( 0.36%) non-ancestor-bases: 9 (50.00%)
108 lvl-1 : 18 ( 0.36%) non-ancestor-bases: 9 (50.00%)
109 lvl-2 : 62 ( 1.24%) non-ancestor-bases: 58 (93.55%)
109 lvl-2 : 62 ( 1.24%) non-ancestor-bases: 58 (93.55%)
110 lvl-3 : 108 ( 2.16%) non-ancestor-bases: 108 (100.00%)
110 lvl-3 : 108 ( 2.16%) non-ancestor-bases: 108 (100.00%)
111 lvl-4 : 191 ( 3.82%) non-ancestor-bases: 180 (94.24%)
111 lvl-4 : 191 ( 3.82%) non-ancestor-bases: 180 (94.24%)
112 lvl-5 : 1 ( 0.02%) non-ancestor-bases: 1 (100.00%)
112 lvl-5 : 1 ( 0.02%) non-ancestor-bases: 1 (100.00%)
113 deltas : 4618 (92.34%)
113 deltas : 4618 (92.34%)
114 revision size : 58616973
114 revision size : 58616973
115 snapshot : 9247844 (15.78%)
115 snapshot : 9247844 (15.78%)
116 lvl-0 : 539532 ( 0.92%)
116 lvl-0 : 539532 ( 0.92%)
117 lvl-1 : 1467743 ( 2.50%)
117 lvl-1 : 1467743 ( 2.50%)
118 lvl-2 : 1873820 ( 3.20%)
118 lvl-2 : 1873820 ( 3.20%)
119 lvl-3 : 2326874 ( 3.97%)
119 lvl-3 : 2326874 ( 3.97%)
120 lvl-4 : 3029118 ( 5.17%)
120 lvl-4 : 3029118 ( 5.17%)
121 lvl-5 : 10757 ( 0.02%)
121 lvl-5 : 10757 ( 0.02%)
122 deltas : 49369129 (84.22%)
122 deltas : 49369129 (84.22%)
123
123
124 chunks : 5001
124 chunks : 5001
125 0x28 : 5001 (100.00%)
125 0x28 : 5001 (100.00%)
126 chunks size : 58616973
126 chunks size : 58616973
127 0x28 : 58616973 (100.00%)
127 0x28 : 58616973 (100.00%)
128
128
129
130 total-stored-content: 1 732 705 361 bytes
131
129 avg chain length : 9
132 avg chain length : 9
130 max chain length : 15
133 max chain length : 15
131 max chain reach : 27366701
134 max chain reach : 27366701
132 compression ratio : 29
135 compression ratio : 29
133
136
134 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
137 uncompressed data size (min/max/avg) : 346468 / 346472 / 346471
135 full revision size (min/max/avg) : 179288 / 180786 / 179844
138 full revision size (min/max/avg) : 179288 / 180786 / 179844
136 inter-snapshot size (min/max/avg) : 10757 / 169507 / 22916
139 inter-snapshot size (min/max/avg) : 10757 / 169507 / 22916
137 level-1 (min/max/avg) : 13905 / 169507 / 81541
140 level-1 (min/max/avg) : 13905 / 169507 / 81541
138 level-2 (min/max/avg) : 10887 / 83873 / 30222
141 level-2 (min/max/avg) : 10887 / 83873 / 30222
139 level-3 (min/max/avg) : 10911 / 43047 / 21545
142 level-3 (min/max/avg) : 10911 / 43047 / 21545
140 level-4 (min/max/avg) : 10838 / 21390 / 15859
143 level-4 (min/max/avg) : 10838 / 21390 / 15859
141 level-5 (min/max/avg) : 10757 / 10757 / 10757
144 level-5 (min/max/avg) : 10757 / 10757 / 10757
142 delta size (min/max/avg) : 9672 / 108072 / 10690
145 delta size (min/max/avg) : 9672 / 108072 / 10690
143
146
144 deltas against prev : 3906 (84.58%)
147 deltas against prev : 3906 (84.58%)
145 where prev = p1 : 3906 (100.00%)
148 where prev = p1 : 3906 (100.00%)
146 where prev = p2 : 0 ( 0.00%)
149 where prev = p2 : 0 ( 0.00%)
147 other-ancestor : 0 ( 0.00%)
150 other-ancestor : 0 ( 0.00%)
148 unrelated : 0 ( 0.00%)
151 unrelated : 0 ( 0.00%)
149 deltas against p1 : 649 (14.05%)
152 deltas against p1 : 649 (14.05%)
150 deltas against p2 : 63 ( 1.36%)
153 deltas against p2 : 63 ( 1.36%)
151 deltas against ancs : 0 ( 0.00%)
154 deltas against ancs : 0 ( 0.00%)
152 deltas against other : 0 ( 0.00%)
155 deltas against other : 0 ( 0.00%)
153
156
154
157
155 Test `debug-delta-find`
158 Test `debug-delta-find`
156 -----------------------
159 -----------------------
157
160
158 $ ls -1
161 $ ls -1
159 SPARSE-REVLOG-TEST-FILE
162 SPARSE-REVLOG-TEST-FILE
160 $ hg debugdeltachain SPARSE-REVLOG-TEST-FILE | grep snap | tail -1
163 $ hg debugdeltachain SPARSE-REVLOG-TEST-FILE | grep snap | tail -1
161 4971 4970 -1 3 5 4930 snap 19179 346472 427596 1.23414 15994877 15567281 36.40652 427596 179288 1.00000 5
164 4971 4970 -1 3 5 4930 snap 19179 346472 427596 1.23414 15994877 15567281 36.40652 427596 179288 1.00000 5
162 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971
165 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971
163 DBG-DELTAS-SEARCH: SEARCH rev=4971
166 DBG-DELTAS-SEARCH: SEARCH rev=4971
164 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
167 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
165 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
168 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
166 DBG-DELTAS-SEARCH: type=snapshot-4
169 DBG-DELTAS-SEARCH: type=snapshot-4
167 DBG-DELTAS-SEARCH: size=18296
170 DBG-DELTAS-SEARCH: size=18296
168 DBG-DELTAS-SEARCH: base=4930
171 DBG-DELTAS-SEARCH: base=4930
169 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
172 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
170 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
173 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
171 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
174 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
172 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
175 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
173 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
176 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
174 DBG-DELTAS-SEARCH: type=snapshot-3
177 DBG-DELTAS-SEARCH: type=snapshot-3
175 DBG-DELTAS-SEARCH: size=39228
178 DBG-DELTAS-SEARCH: size=39228
176 DBG-DELTAS-SEARCH: base=4799
179 DBG-DELTAS-SEARCH: base=4799
177 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
180 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
178 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
181 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
179 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
182 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
180 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
183 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
181 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
184 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
182 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
185 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
183 DBG-DELTAS-SEARCH: type=snapshot-2
186 DBG-DELTAS-SEARCH: type=snapshot-2
184 DBG-DELTAS-SEARCH: size=50213
187 DBG-DELTAS-SEARCH: size=50213
185 DBG-DELTAS-SEARCH: base=4623
188 DBG-DELTAS-SEARCH: base=4623
186 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
189 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
187 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
190 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
188 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
191 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
189 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
192 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
190
193
191 $ cat << EOF >>.hg/hgrc
194 $ cat << EOF >>.hg/hgrc
192 > [storage]
195 > [storage]
193 > revlog.optimize-delta-parent-choice = no
196 > revlog.optimize-delta-parent-choice = no
194 > revlog.reuse-external-delta = yes
197 > revlog.reuse-external-delta = yes
195 > EOF
198 > EOF
196
199
197 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --quiet
200 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --quiet
198 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
201 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
199 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source full
202 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source full
200 DBG-DELTAS-SEARCH: SEARCH rev=4971
203 DBG-DELTAS-SEARCH: SEARCH rev=4971
201 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
204 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
202 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
205 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
203 DBG-DELTAS-SEARCH: type=snapshot-4
206 DBG-DELTAS-SEARCH: type=snapshot-4
204 DBG-DELTAS-SEARCH: size=18296
207 DBG-DELTAS-SEARCH: size=18296
205 DBG-DELTAS-SEARCH: base=4930
208 DBG-DELTAS-SEARCH: base=4930
206 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
209 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
207 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
210 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
208 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
211 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
209 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
212 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
210 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
213 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
211 DBG-DELTAS-SEARCH: type=snapshot-3
214 DBG-DELTAS-SEARCH: type=snapshot-3
212 DBG-DELTAS-SEARCH: size=39228
215 DBG-DELTAS-SEARCH: size=39228
213 DBG-DELTAS-SEARCH: base=4799
216 DBG-DELTAS-SEARCH: base=4799
214 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
217 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
215 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
218 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
216 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
219 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
217 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
220 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
218 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
221 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
219 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
222 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
220 DBG-DELTAS-SEARCH: type=snapshot-2
223 DBG-DELTAS-SEARCH: type=snapshot-2
221 DBG-DELTAS-SEARCH: size=50213
224 DBG-DELTAS-SEARCH: size=50213
222 DBG-DELTAS-SEARCH: base=4623
225 DBG-DELTAS-SEARCH: base=4623
223 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
226 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
224 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
227 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
225 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
228 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
226 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
229 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
227 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source storage
230 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source storage
228 DBG-DELTAS-SEARCH: SEARCH rev=4971
231 DBG-DELTAS-SEARCH: SEARCH rev=4971
229 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - cached-delta
232 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - cached-delta
230 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
233 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
231 DBG-DELTAS-SEARCH: type=snapshot-3
234 DBG-DELTAS-SEARCH: type=snapshot-3
232 DBG-DELTAS-SEARCH: size=39228
235 DBG-DELTAS-SEARCH: size=39228
233 DBG-DELTAS-SEARCH: base=4799
236 DBG-DELTAS-SEARCH: base=4799
234 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
237 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
235 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
238 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
236 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
239 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
237 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=1 - search-rounds=1 try-count=1 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
240 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=1 - search-rounds=1 try-count=1 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
238 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source p1
241 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source p1
239 DBG-DELTAS-SEARCH: SEARCH rev=4971
242 DBG-DELTAS-SEARCH: SEARCH rev=4971
240 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
243 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
241 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
244 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
242 DBG-DELTAS-SEARCH: type=snapshot-4
245 DBG-DELTAS-SEARCH: type=snapshot-4
243 DBG-DELTAS-SEARCH: size=18296
246 DBG-DELTAS-SEARCH: size=18296
244 DBG-DELTAS-SEARCH: base=4930
247 DBG-DELTAS-SEARCH: base=4930
245 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
248 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
246 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
249 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
247 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
250 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
248 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
251 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
249 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
252 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
250 DBG-DELTAS-SEARCH: type=snapshot-3
253 DBG-DELTAS-SEARCH: type=snapshot-3
251 DBG-DELTAS-SEARCH: size=39228
254 DBG-DELTAS-SEARCH: size=39228
252 DBG-DELTAS-SEARCH: base=4799
255 DBG-DELTAS-SEARCH: base=4799
253 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
256 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
254 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
257 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
255 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
258 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
256 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
259 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
257 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
260 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
258 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
261 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
259 DBG-DELTAS-SEARCH: type=snapshot-2
262 DBG-DELTAS-SEARCH: type=snapshot-2
260 DBG-DELTAS-SEARCH: size=50213
263 DBG-DELTAS-SEARCH: size=50213
261 DBG-DELTAS-SEARCH: base=4623
264 DBG-DELTAS-SEARCH: base=4623
262 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
265 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
263 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
266 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
264 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
267 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
265 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
268 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
266 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source p2
269 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source p2
267 DBG-DELTAS-SEARCH: SEARCH rev=4971
270 DBG-DELTAS-SEARCH: SEARCH rev=4971
268 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
271 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
269 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
272 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
270 DBG-DELTAS-SEARCH: type=snapshot-4
273 DBG-DELTAS-SEARCH: type=snapshot-4
271 DBG-DELTAS-SEARCH: size=18296
274 DBG-DELTAS-SEARCH: size=18296
272 DBG-DELTAS-SEARCH: base=4930
275 DBG-DELTAS-SEARCH: base=4930
273 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
276 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
274 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
277 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
275 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
278 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
276 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
279 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
277 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
280 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
278 DBG-DELTAS-SEARCH: type=snapshot-3
281 DBG-DELTAS-SEARCH: type=snapshot-3
279 DBG-DELTAS-SEARCH: size=39228
282 DBG-DELTAS-SEARCH: size=39228
280 DBG-DELTAS-SEARCH: base=4799
283 DBG-DELTAS-SEARCH: base=4799
281 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
284 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
282 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
285 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
283 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
286 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
284 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
287 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
285 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
288 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
286 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
289 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
287 DBG-DELTAS-SEARCH: type=snapshot-2
290 DBG-DELTAS-SEARCH: type=snapshot-2
288 DBG-DELTAS-SEARCH: size=50213
291 DBG-DELTAS-SEARCH: size=50213
289 DBG-DELTAS-SEARCH: base=4623
292 DBG-DELTAS-SEARCH: base=4623
290 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
293 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
291 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
294 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
292 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
295 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
293 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
296 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
294 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source prev
297 $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971 --source prev
295 DBG-DELTAS-SEARCH: SEARCH rev=4971
298 DBG-DELTAS-SEARCH: SEARCH rev=4971
296 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
299 DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
297 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
300 DBG-DELTAS-SEARCH: CANDIDATE: rev=4962
298 DBG-DELTAS-SEARCH: type=snapshot-4
301 DBG-DELTAS-SEARCH: type=snapshot-4
299 DBG-DELTAS-SEARCH: size=18296
302 DBG-DELTAS-SEARCH: size=18296
300 DBG-DELTAS-SEARCH: base=4930
303 DBG-DELTAS-SEARCH: base=4930
301 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
304 DBG-DELTAS-SEARCH: uncompressed-delta-size=30377
302 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
305 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
303 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
306 DBG-DELTAS-SEARCH: DELTA: length=16872 (BAD)
304 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
307 DBG-DELTAS-SEARCH: ROUND #2 - 1 candidates - search-down
305 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
308 DBG-DELTAS-SEARCH: CANDIDATE: rev=4930
306 DBG-DELTAS-SEARCH: type=snapshot-3
309 DBG-DELTAS-SEARCH: type=snapshot-3
307 DBG-DELTAS-SEARCH: size=39228
310 DBG-DELTAS-SEARCH: size=39228
308 DBG-DELTAS-SEARCH: base=4799
311 DBG-DELTAS-SEARCH: base=4799
309 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
312 DBG-DELTAS-SEARCH: uncompressed-delta-size=33050
310 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
313 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
311 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
314 DBG-DELTAS-SEARCH: DELTA: length=19179 (GOOD)
312 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
315 DBG-DELTAS-SEARCH: ROUND #3 - 1 candidates - refine-down
313 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
316 DBG-DELTAS-SEARCH: CONTENDER: rev=4930 - length=19179
314 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
317 DBG-DELTAS-SEARCH: CANDIDATE: rev=4799
315 DBG-DELTAS-SEARCH: type=snapshot-2
318 DBG-DELTAS-SEARCH: type=snapshot-2
316 DBG-DELTAS-SEARCH: size=50213
319 DBG-DELTAS-SEARCH: size=50213
317 DBG-DELTAS-SEARCH: base=4623
320 DBG-DELTAS-SEARCH: base=4623
318 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
321 DBG-DELTAS-SEARCH: uncompressed-delta-size=82661
319 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
322 DBG-DELTAS-SEARCH: delta-search-time=* (glob)
320 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
323 DBG-DELTAS-SEARCH: DELTA: length=49132 (BAD)
321 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
324 DBG-DELTAS: FILELOG:SPARSE-REVLOG-TEST-FILE: rev=4971: delta-base=4930 is-cached=0 - search-rounds=3 try-count=3 - delta-type=snapshot snap-depth=4 - p1-chain-length=15 p2-chain-length=-1 - duration=* (glob)
322
325
323 $ cd ..
326 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now