mirror of
https://github.com/facebook/sapling.git
synced 2024-12-28 07:33:10 +03:00
debugdatapack: suppport passing multiple files
Also print the name of the packfile being inspected, and \itweak newlines a bit. This simplies debugging several packfiles in tests. Differential Revision: https://phab.mercurial-scm.org/D1326
This commit is contained in:
parent
6a5d3a9d19
commit
d4642ef2ca
@ -924,9 +924,9 @@ def verifyremotefilelog(ui, path, **opts):
|
||||
@command('debugdatapack', [
|
||||
('', 'long', None, _('print the long hashes')),
|
||||
('', 'node', '', _('dump the contents of node'), 'NODE'),
|
||||
], _('hg debugdatapack <path>'), norepo=True)
|
||||
def debugdatapack(ui, path, **opts):
|
||||
return debugcommands.debugdatapack(ui, path, **opts)
|
||||
], _('hg debugdatapack <paths>'), norepo=True)
|
||||
def debugdatapack(ui, *paths, **opts):
|
||||
return debugcommands.debugdatapack(ui, *paths, **opts)
|
||||
|
||||
@command('debughistorypack', [
|
||||
], _('hg debughistorypack <path>'), norepo=True)
|
||||
|
@ -197,70 +197,74 @@ def parsefileblob(path, decompress):
|
||||
|
||||
return size, firstnode, mapping
|
||||
|
||||
def debugdatapack(ui, path, **opts):
|
||||
if '.data' in path:
|
||||
path = path[:path.index('.data')]
|
||||
dpack = datapack.datapack(path)
|
||||
|
||||
node = opts.get('node')
|
||||
if node:
|
||||
deltachain = dpack.getdeltachain('', bin(node))
|
||||
dumpdeltachain(ui, deltachain, **opts)
|
||||
return
|
||||
|
||||
if opts.get('long'):
|
||||
hashformatter = hex
|
||||
hashlen = 42
|
||||
else:
|
||||
hashformatter = short
|
||||
hashlen = 14
|
||||
|
||||
lastfilename = None
|
||||
totaldeltasize = 0
|
||||
totalblobsize = 0
|
||||
def printtotals():
|
||||
if not totaldeltasize or not totalblobsize:
|
||||
def debugdatapack(ui, *paths, **opts):
|
||||
for path in paths:
|
||||
if '.data' in path:
|
||||
path = path[:path.index('.data')]
|
||||
ui.write("%s:\n" % path)
|
||||
dpack = datapack.datapack(path)
|
||||
node = opts.get('node')
|
||||
if node:
|
||||
deltachain = dpack.getdeltachain('', bin(node))
|
||||
dumpdeltachain(ui, deltachain, **opts)
|
||||
return
|
||||
difference = totalblobsize - totaldeltasize
|
||||
deltastr = "%0.1f%% %s" % (
|
||||
(100.0 * abs(difference) / totalblobsize),
|
||||
("smaller" if difference > 0 else "bigger"))
|
||||
|
||||
ui.write(("Total:%s%s %s (%s)\n") % (
|
||||
"".ljust(2 * hashlen - len("Total:")),
|
||||
str(totaldeltasize).ljust(12),
|
||||
str(totalblobsize).ljust(9),
|
||||
deltastr
|
||||
))
|
||||
|
||||
for filename, node, deltabase, deltalen in dpack.iterentries():
|
||||
if filename != lastfilename:
|
||||
printtotals()
|
||||
name = '(empty name)' if filename == '' else filename
|
||||
ui.write("\n%s:\n" % name)
|
||||
ui.write("%s%s%s%s\n" % (
|
||||
"Node".ljust(hashlen),
|
||||
"Delta Base".ljust(hashlen),
|
||||
"Delta Length".ljust(14),
|
||||
"Blob Size".ljust(9)))
|
||||
lastfilename = filename
|
||||
totalblobsize = 0
|
||||
totaldeltasize = 0
|
||||
# Metadata could be missing, in which case it will be an empty dict.
|
||||
meta = dpack.getmeta(filename, node)
|
||||
if constants.METAKEYSIZE in meta:
|
||||
blobsize = meta[constants.METAKEYSIZE]
|
||||
totaldeltasize += deltalen
|
||||
totalblobsize += blobsize
|
||||
if opts.get('long'):
|
||||
hashformatter = hex
|
||||
hashlen = 42
|
||||
else:
|
||||
blobsize = "(missing)"
|
||||
ui.write("%s %s %s%s\n" % (
|
||||
hashformatter(node),
|
||||
hashformatter(deltabase),
|
||||
str(deltalen).ljust(14),
|
||||
blobsize))
|
||||
if filename is not None:
|
||||
printtotals()
|
||||
hashformatter = short
|
||||
hashlen = 14
|
||||
|
||||
lastfilename = None
|
||||
totaldeltasize = 0
|
||||
totalblobsize = 0
|
||||
def printtotals():
|
||||
if lastfilename is not None:
|
||||
ui.write("\n")
|
||||
if not totaldeltasize or not totalblobsize:
|
||||
return
|
||||
difference = totalblobsize - totaldeltasize
|
||||
deltastr = "%0.1f%% %s" % (
|
||||
(100.0 * abs(difference) / totalblobsize),
|
||||
("smaller" if difference > 0 else "bigger"))
|
||||
|
||||
ui.write(("Total:%s%s %s (%s)\n") % (
|
||||
"".ljust(2 * hashlen - len("Total:")),
|
||||
str(totaldeltasize).ljust(12),
|
||||
str(totalblobsize).ljust(9),
|
||||
deltastr
|
||||
))
|
||||
|
||||
for filename, node, deltabase, deltalen in dpack.iterentries():
|
||||
if filename != lastfilename:
|
||||
printtotals()
|
||||
name = '(empty name)' if filename == '' else filename
|
||||
ui.write("%s:\n" % name)
|
||||
ui.write("%s%s%s%s\n" % (
|
||||
"Node".ljust(hashlen),
|
||||
"Delta Base".ljust(hashlen),
|
||||
"Delta Length".ljust(14),
|
||||
"Blob Size".ljust(9)))
|
||||
lastfilename = filename
|
||||
totalblobsize = 0
|
||||
totaldeltasize = 0
|
||||
# Metadata could be missing, in which case it will be an empty dict.
|
||||
meta = dpack.getmeta(filename, node)
|
||||
if constants.METAKEYSIZE in meta:
|
||||
blobsize = meta[constants.METAKEYSIZE]
|
||||
totaldeltasize += deltalen
|
||||
totalblobsize += blobsize
|
||||
else:
|
||||
blobsize = "(missing)"
|
||||
ui.write("%s %s %s%s\n" % (
|
||||
hashformatter(node),
|
||||
hashformatter(deltabase),
|
||||
str(deltalen).ljust(14),
|
||||
blobsize))
|
||||
|
||||
if filename is not None:
|
||||
printtotals()
|
||||
|
||||
def dumpdeltachain(ui, deltachain, **opts):
|
||||
hashformatter = hex
|
||||
|
@ -152,26 +152,27 @@
|
||||
# could only be downloaded by the background prefetch
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0:
|
||||
w:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bb6ccd5dceaa 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef95c5376f34 000000000000 3 3
|
||||
1406e7411862 ef95c5376f34 14 2
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
076f5e2225b3 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
z:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
69a1b6752270 000000000000 2 2
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
# background prefetch with repack on commit when wcprevset configured
|
||||
@ -202,26 +203,27 @@
|
||||
# could only be downloaded by the background prefetch
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0:
|
||||
w:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bb6ccd5dceaa 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef95c5376f34 000000000000 3 3
|
||||
1406e7411862 ef95c5376f34 14 2
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
076f5e2225b3 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
z:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
69a1b6752270 000000000000 2 2
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
# background prefetch with repack on rebase when wcprevset configured
|
||||
@ -244,26 +246,27 @@
|
||||
# could only be downloaded by the background prefetch
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0:
|
||||
w:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bb6ccd5dceaa 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef95c5376f34 000000000000 3 3
|
||||
1406e7411862 ef95c5376f34 14 2
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
076f5e2225b3 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
z:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
69a1b6752270 000000000000 2 2
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
# Check that foregound prefetch with no arguments blocks until background prefetches finish
|
||||
@ -289,26 +292,27 @@
|
||||
|
||||
# Ensure that files were prefetched
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0:
|
||||
w:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bb6ccd5dceaa 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef95c5376f34 000000000000 3 3
|
||||
1406e7411862 ef95c5376f34 14 2
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
076f5e2225b3 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
z:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
69a1b6752270 000000000000 2 2
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
# Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch'
|
||||
@ -331,26 +335,27 @@
|
||||
|
||||
# Ensure that files were prefetched
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0:
|
||||
w:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bb6ccd5dceaa 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef95c5376f34 000000000000 3 3
|
||||
1406e7411862 ef95c5376f34 14 2
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
076f5e2225b3 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
z:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
69a1b6752270 000000000000 2 2
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
# Test that if data was prefetched and repacked we dont need to prefetch it again
|
||||
|
@ -51,16 +51,17 @@
|
||||
# Ensure that all file versions were prefetched
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1406e7411862 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
50dbc4572b8e 000000000000 3 3
|
||||
076f5e2225b3 50dbc4572b8e 14 2
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
# Test garbage collection during repack
|
||||
@ -84,10 +85,11 @@
|
||||
# and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset.
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33:
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
50dbc4572b8e 000000000000 3 3
|
||||
|
||||
Total: 3 3 (0.0% bigger)
|
||||
|
||||
# Prefetch all data again and repack for later garbage collection
|
||||
@ -110,16 +112,17 @@
|
||||
# Ensure that all file versions were prefetched
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1406e7411862 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
50dbc4572b8e 000000000000 3 3
|
||||
076f5e2225b3 50dbc4572b8e 14 2
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
||||
# Test garbage collection during repack. Ensure that new files are not removed even though they are not in the keepset
|
||||
@ -143,14 +146,15 @@
|
||||
# Ensure that all file versions were prefetched
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1406e7411862 000000000000 2 2
|
||||
Total: 2 2 (0.0% bigger)
|
||||
|
||||
Total: 2 2 (0.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
50dbc4572b8e 000000000000 3 3
|
||||
076f5e2225b3 50dbc4572b8e 14 2
|
||||
|
||||
Total: 17 5 (240.0% bigger)
|
||||
|
@ -153,22 +153,25 @@
|
||||
# Test debug commands
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e03 000000000000 8 8
|
||||
d4a3ed9310e5 1bb2e6237e03 12 6
|
||||
aee31534993a d4a3ed9310e5 12 4
|
||||
|
||||
Total: 32 18 (77.8% bigger)
|
||||
$ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
|
||||
d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6
|
||||
aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4
|
||||
|
||||
Total: 32 18 (77.8% bigger)
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216
|
||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15:
|
||||
|
||||
x
|
||||
Node Delta Base Delta SHA1 Delta Length
|
||||
@ -249,17 +252,18 @@
|
||||
$ rm -rf $CACHEDIR/master/packs/*hist*
|
||||
$ hg repack
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/055c02949317b8507cdb7aaf2e00cc00fd0c5716:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e03 000000000000 8 8
|
||||
aee31534993a 000000000000 4 4
|
||||
d4a3ed9310e5 000000000000 6 6
|
||||
Total: 18 18 (0.0% bigger)
|
||||
|
||||
Total: 18 18 (0.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
577959738234 000000000000 70 8
|
||||
|
||||
Total: 70 8 (775.0% bigger)
|
||||
|
||||
$ hg cat -r ".^" x
|
||||
|
@ -148,22 +148,25 @@
|
||||
# Test debug commands
|
||||
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e03 000000000000 8 8
|
||||
d4a3ed9310e5 1bb2e6237e03 12 6
|
||||
aee31534993a d4a3ed9310e5 12 4
|
||||
|
||||
Total: 32 18 (77.8% bigger)
|
||||
$ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
|
||||
d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6
|
||||
aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4
|
||||
|
||||
Total: 32 18 (77.8% bigger)
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216
|
||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15:
|
||||
|
||||
x
|
||||
Node Delta Base Delta SHA1 Delta Length
|
||||
@ -244,17 +247,18 @@
|
||||
$ rm -rf $CACHEDIR/master/packs/*hist*
|
||||
$ hg repack
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/055c02949317b8507cdb7aaf2e00cc00fd0c5716:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e03 000000000000 8 8
|
||||
aee31534993a 000000000000 4 4
|
||||
d4a3ed9310e5 000000000000 6 6
|
||||
Total: 18 18 (0.0% bigger)
|
||||
|
||||
Total: 18 18 (0.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
577959738234 000000000000 70 8
|
||||
|
||||
Total: 70 8 (775.0% bigger)
|
||||
|
||||
$ hg cat -r ".^" x
|
||||
@ -388,16 +392,17 @@ Test local remotefilelog blob is correct when based on a pack
|
||||
Test limiting the max delta chain length
|
||||
$ hg repack --config packs.maxchainlen=1
|
||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/a2731c9a16403457b67337a620931797fce8c821:
|
||||
x:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1bb2e6237e03 000000000000 8 8
|
||||
d4a3ed9310e5 1bb2e6237e03 12 6
|
||||
aee31534993a 000000000000 4 4
|
||||
1406e7411862 aee31534993a 12 2
|
||||
Total: 36 20 (80.0% bigger)
|
||||
|
||||
Total: 36 20 (80.0% bigger)
|
||||
y:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
577959738234 000000000000 8 8
|
||||
|
||||
Total: 8 8 (0.0% bigger)
|
||||
|
@ -66,7 +66,7 @@ Test prefetchtrees
|
||||
8adc618d23082c0a5311a4bbf9ac08b9b9672471.dataidx
|
||||
8adc618d23082c0a5311a4bbf9ac08b9b9672471.datapack
|
||||
$ hg debugdatapack --long $CACHEDIR/master/packs/manifests/*.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/8adc618d23082c0a5311a4bbf9ac08b9b9672471:
|
||||
subdir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ddb35f099a648a43a997aef53123bce309c794fd 0000000000000000000000000000000000000000 43 (missing)
|
||||
@ -90,6 +90,7 @@ Test prefetchtrees
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef362f8bbe8aa457b0cfc49f200cbeb7747984ed 0000000000000000000000000000000000000000 46 (missing)
|
||||
|
||||
$ hg debughistorypack $CACHEDIR/master/packs/manifests/*.histidx
|
||||
|
||||
|
||||
@ -107,6 +108,7 @@ Test prefetchtrees
|
||||
Node P1 Node P2 Node Link Node Copy From
|
||||
ddb35f099a64 000000000000 000000000000 f15c65c6e9bd
|
||||
$ hg debugdatapack --node ef362f8bbe8aa457b0cfc49f200cbeb7747984ed $CACHEDIR/master/packs/manifests/*.dataidx
|
||||
$TESTTMP/hgcache/master/packs/manifests/8adc618d23082c0a5311a4bbf9ac08b9b9672471:
|
||||
|
||||
|
||||
Node Delta Base Delta SHA1 Delta Length
|
||||
@ -130,7 +132,7 @@ Test prefetch with base node (subdir/ shouldn't show up in the pack)
|
||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx
|
||||
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a18d21674e76 000000000000 43 (missing)
|
||||
@ -138,6 +140,7 @@ Test prefetch with base node (subdir/ shouldn't show up in the pack)
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
60a7f7acb6bb 000000000000 95 (missing)
|
||||
|
||||
|
||||
Test auto prefetch during normal access
|
||||
$ rm -rf $CACHEDIR/master
|
||||
@ -168,7 +171,7 @@ Test auto prefetch during normal access
|
||||
e5c44a5c1bbfd8841df1c6c4b7cca54536e016db.histpack
|
||||
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bc0c2c938b92 000000000000 43 (missing)
|
||||
@ -180,10 +183,11 @@ Test auto prefetch during normal access
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1be4ab2126dd 000000000000 95 (missing)
|
||||
|
||||
|
||||
- Note that subdir/ is not downloaded again
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a18d21674e76 000000000000 43 (missing)
|
||||
@ -191,6 +195,7 @@ Test auto prefetch during normal access
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
60a7f7acb6bb 000000000000 95 (missing)
|
||||
|
||||
|
||||
Test that auto prefetch scans up the changelog for base trees
|
||||
$ rm -rf $CACHEDIR/master
|
||||
@ -216,7 +221,7 @@ Test auto prefetch during pull
|
||||
prefetching trees
|
||||
6 trees fetched over * (glob)
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/8adc618d23082c0a5311a4bbf9ac08b9b9672471:
|
||||
subdir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ddb35f099a64 000000000000 43 (missing)
|
||||
@ -240,6 +245,7 @@ Test auto prefetch during pull
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ef362f8bbe8a 000000000000 46 (missing)
|
||||
|
||||
|
||||
$ hg strip -q -r 'draft()'
|
||||
|
||||
@ -252,7 +258,7 @@ Test auto prefetch during pull
|
||||
prefetching trees
|
||||
3 trees fetched over * (glob)
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/4ee15de76c068ec1c80e3e61f2c3c476a779078a:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a18d21674e76 000000000000 43 (missing)
|
||||
@ -264,6 +270,7 @@ Test auto prefetch during pull
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
60a7f7acb6bb 000000000000 95 (missing)
|
||||
|
||||
|
||||
- Prefetch commit 1 then minimally prefetch commit 2
|
||||
$ rm -rf $CACHEDIR/master
|
||||
@ -281,7 +288,7 @@ Test auto prefetch during pull
|
||||
$TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675.dataidx
|
||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a18d21674e76 000000000000 43 (missing)
|
||||
@ -289,6 +296,7 @@ Test auto prefetch during pull
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
60a7f7acb6bb 000000000000 95 (missing)
|
||||
|
||||
|
||||
Test prefetching certain revs during pull
|
||||
$ cd ../master
|
||||
@ -311,7 +319,7 @@ Test prefetching certain revs during pull
|
||||
prefetching trees
|
||||
3 trees fetched over * (glob)
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/4ee15de76c068ec1c80e3e61f2c3c476a779078a:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a18d21674e76 000000000000 43 (missing)
|
||||
@ -323,6 +331,7 @@ Test prefetching certain revs during pull
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
60a7f7acb6bb 000000000000 95 (missing)
|
||||
|
||||
|
||||
- Test prefetching only the new tree parts for a commit who's parent tree is not
|
||||
- downloaded already. Note that subdir/z was not downloaded this time.
|
||||
@ -333,7 +342,7 @@ Test prefetching certain revs during pull
|
||||
prefetching trees
|
||||
2 trees fetched over * (glob)
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/99050e724a9236121684523ba3f4db270e62fb58.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/99050e724a9236121684523ba3f4db270e62fb58:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bf22bc15398b 000000000000 43 (missing)
|
||||
@ -341,6 +350,7 @@ Test prefetching certain revs during pull
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
aa52a49be522 000000000000 95 (missing)
|
||||
|
||||
|
||||
Test that prefetch refills just part of a tree when the cache is deleted
|
||||
|
||||
|
@ -43,12 +43,13 @@
|
||||
> hg debugdatapack "$i"
|
||||
> done
|
||||
$TESTTMP/hgcache/master/packs/manifests/65df85879cdd898607ee3f323a0b61edc7de25b8.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/65df85879cdd898607ee3f323a0b61edc7de25b8:
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a0c8bcbbb45c 000000000000 43 (missing)
|
||||
$TESTTMP/hgcache/master/packs/manifests/bb55d9105672c45d4f82df15bd091a555ef02c79.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/bb55d9105672c45d4f82df15bd091a555ef02c79.datapack
|
||||
$TESTTMP/hgcache/master/packs/manifests/bb55d9105672c45d4f82df15bd091a555ef02c79:
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
23226e7a252c 000000000000 43 (missing)
|
||||
@ -56,6 +57,7 @@
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1832e0765de9 000000000000 89 (missing)
|
||||
|
||||
|
||||
- Verify histpack contents
|
||||
$ for i in $CACHEDIR/master/packs/manifests/*.histpack; do
|
||||
@ -85,16 +87,17 @@
|
||||
-r--r--r-- 262 7535b6084226436bbdff33043969e7fa963e8428.histpack
|
||||
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.datapack
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a:
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1832e0765de9 000000000000 89 89
|
||||
a0c8bcbbb45c 1832e0765de9 12 43
|
||||
Total: 101 132 (23.5% smaller)
|
||||
|
||||
Total: 101 132 (23.5% smaller)
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
23226e7a252c 000000000000 43 43
|
||||
|
||||
Total: 43 43 (0.0% bigger)
|
||||
|
||||
$ hg debughistorypack $CACHEDIR/master/packs/manifests/*.histpack
|
||||
@ -189,16 +192,17 @@ Test repacking from revlogs to pack files on the server
|
||||
7535b6084226436bbdff33043969e7fa963e8428.histidx
|
||||
7535b6084226436bbdff33043969e7fa963e8428.histpack
|
||||
$ hg debugdatapack .hg/cache/packs/manifests/*.datapack
|
||||
|
||||
.hg/cache/packs/manifests/56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a:
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1832e0765de9 000000000000 89 89
|
||||
a0c8bcbbb45c 1832e0765de9 12 43
|
||||
Total: 101 132 (23.5% smaller)
|
||||
|
||||
Total: 101 132 (23.5% smaller)
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
23226e7a252c 000000000000 43 43
|
||||
|
||||
Total: 43 43 (0.0% bigger)
|
||||
|
||||
Test incremental revlog repacking
|
||||
@ -230,13 +234,14 @@ Test incremental repack with limited revs only repacks those revs
|
||||
$ rm -rf .hg/cache/packs/manifests
|
||||
$ hg repack --incremental --config treemanifest.repackstartrev=1 --config treemanifest.repackendrev=1
|
||||
$ hg debugdatapack .hg/cache/packs/manifests/*.datapack
|
||||
|
||||
.hg/cache/packs/manifests/e9093d2d887ff14457d43338fcb3994e92051853:
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
1832e0765de9 000000000000 89 89
|
||||
Total: 89 89 (0.0% bigger)
|
||||
|
||||
Total: 89 89 (0.0% bigger)
|
||||
dir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
23226e7a252c 000000000000 43 43
|
||||
|
||||
Total: 43 43 (0.0% bigger)
|
||||
|
@ -49,7 +49,7 @@ Test committing auto-downloads server trees and produces local trees
|
||||
2 trees fetched over * (glob)
|
||||
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/4d21ecb6c95e12dcf807b793cd1c55eeed861734:
|
||||
subdir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bc0c2c938b92 000000000000 43 (missing)
|
||||
@ -57,9 +57,10 @@ Test committing auto-downloads server trees and produces local trees
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
85b359fdb09e 000000000000 49 (missing)
|
||||
|
||||
|
||||
$ hg debugdatapack .hg/store/packs/manifests/*.dataidx
|
||||
|
||||
.hg/store/packs/manifests/e3876af326e0e51d1f3ea0444d2b1a7db2915763:
|
||||
subdir2:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ddb35f099a64 000000000000 43 (missing)
|
||||
@ -67,6 +68,7 @@ Test committing auto-downloads server trees and produces local trees
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
54cbf534b62b 000000000000 99 (missing)
|
||||
|
||||
|
||||
Test pushing without pushrebase fails
|
||||
$ hg push
|
||||
|
@ -59,7 +59,7 @@ Test autocreatetrees
|
||||
-r--r--r-- 265 ed1a27864c5d25f144a51961ad6e79088f2a7571.histpack
|
||||
|
||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/678f597a73b2b96f2e120c84ef8a84069a250266
|
||||
|
||||
$TESTTMP/hgcache/master/packs/manifests/678f597a73b2b96f2e120c84ef8a84069a250266:
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
bc0c2c938b92 000000000000 43 (missing)
|
||||
@ -71,6 +71,7 @@ Test autocreatetrees
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
70f2c6726cec bc0c2c938b92 61 (missing)
|
||||
|
||||
|
||||
Test that commit creates local trees
|
||||
$ hg up -q tip
|
||||
@ -83,7 +84,7 @@ Test that commit creates local trees
|
||||
-r--r--r-- 1106 a7f7e084adff88a01cf76909345be1e56ee704a9.dataidx
|
||||
-r--r--r-- 254 a7f7e084adff88a01cf76909345be1e56ee704a9.datapack
|
||||
$ hg debugdatapack .hg/store/packs/manifests/a7f7e084adff88a01cf76909345be1e56ee704a9
|
||||
|
||||
.hg/store/packs/manifests/a7f7e084adff88a01cf76909345be1e56ee704a9:
|
||||
subdir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
ac728a786423 000000000000 43 (missing)
|
||||
@ -91,6 +92,7 @@ Test that commit creates local trees
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
7a911436836f 000000000000 92 (missing)
|
||||
|
||||
|
||||
Test that manifest matchers work
|
||||
$ hg status --rev 1 --rev 2 -I subdir/a
|
||||
@ -119,7 +121,7 @@ Test rebasing a stack of commits results in a pack with all the trees
|
||||
3:0d05c20bb7eb
|
||||
4:8289b85c6a30
|
||||
$ hg debugdatapack .hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7.datapack
|
||||
|
||||
.hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7:
|
||||
subdir:
|
||||
Node Delta Base Delta Length Blob Size
|
||||
a4e2f032ee0f 000000000000 43 (missing)
|
||||
@ -135,6 +137,7 @@ Test rebasing a stack of commits results in a pack with all the trees
|
||||
(empty name):
|
||||
Node Delta Base Delta Length Blob Size
|
||||
8289b85c6a30 000000000000 92 (missing)
|
||||
|
||||
|
||||
Test treemanifest with sparse enabled
|
||||
$ cat >> .hg/hgrc <<EOF
|
||||
|
Loading…
Reference in New Issue
Block a user