Also print the name of the packfile being inspected, and \itweak newlines a bit.
This simplies debugging several packfiles in tests.
singhsrb |
Restricted Project |
Also print the name of the packfile being inspected, and \itweak newlines a bit.
This simplies debugging several packfiles in tests.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | remotefilelog/__init__.py (6 lines) | |||
M | remotefilelog/debugcommands.py (122 lines) | |||
M | tests/test-remotefilelog-bgprefetch.t (45 lines) | |||
M | tests/test-remotefilelog-gcrepack.t (18 lines) | |||
M | tests/test-remotefilelog-repack-fast.t (12 lines) | |||
M | tests/test-remotefilelog-repack.t (17 lines) | |||
M | tests/test-treemanifest-prefetch.t (28 lines) | |||
M | tests/test-treemanifest-repack.t (21 lines) | |||
M | tests/test-treemanifest-server.t (6 lines) | |||
M | tests/test-treemanifest.t (9 lines) |
('d', 'decompress', None, _('decompress the filelogs first')), | ('d', 'decompress', None, _('decompress the filelogs first')), | ||||
], _('hg verifyremotefilelogs <directory>'), norepo=True) | ], _('hg verifyremotefilelogs <directory>'), norepo=True) | ||||
def verifyremotefilelog(ui, path, **opts): | def verifyremotefilelog(ui, path, **opts): | ||||
return debugcommands.verifyremotefilelog(ui, path, **opts) | return debugcommands.verifyremotefilelog(ui, path, **opts) | ||||
@command('debugdatapack', [ | @command('debugdatapack', [ | ||||
('', 'long', None, _('print the long hashes')), | ('', 'long', None, _('print the long hashes')), | ||||
('', 'node', '', _('dump the contents of node'), 'NODE'), | ('', 'node', '', _('dump the contents of node'), 'NODE'), | ||||
], _('hg debugdatapack <path>'), norepo=True) | ], _('hg debugdatapack <paths>'), norepo=True) | ||||
def debugdatapack(ui, path, **opts): | def debugdatapack(ui, *paths, **opts): | ||||
return debugcommands.debugdatapack(ui, path, **opts) | return debugcommands.debugdatapack(ui, *paths, **opts) | ||||
@command('debughistorypack', [ | @command('debughistorypack', [ | ||||
], _('hg debughistorypack <path>'), norepo=True) | ], _('hg debughistorypack <path>'), norepo=True) | ||||
def debughistorypack(ui, path, **opts): | def debughistorypack(ui, path, **opts): | ||||
return debugcommands.debughistorypack(ui, path) | return debugcommands.debughistorypack(ui, path) | ||||
@command('debugkeepset', [ | @command('debugkeepset', [ | ||||
], _('hg debugkeepset')) | ], _('hg debugkeepset')) |
linknode = raw[(start + 60):(start + 80)] | linknode = raw[(start + 60):(start + 80)] | ||||
copyfrom = raw[(start + 80):divider] | copyfrom = raw[(start + 80):divider] | ||||
mapping[currentnode] = (p1, p2, linknode, copyfrom) | mapping[currentnode] = (p1, p2, linknode, copyfrom) | ||||
start = divider + 1 | start = divider + 1 | ||||
return size, firstnode, mapping | return size, firstnode, mapping | ||||
def debugdatapack(ui, path, **opts): | def debugdatapack(ui, *paths, **opts): | ||||
for path in paths: | |||||
if '.data' in path: | if '.data' in path: | ||||
path = path[:path.index('.data')] | path = path[:path.index('.data')] | ||||
ui.write("%s:\n" % path) | |||||
dpack = datapack.datapack(path) | dpack = datapack.datapack(path) | ||||
node = opts.get('node') | node = opts.get('node') | ||||
if node: | if node: | ||||
deltachain = dpack.getdeltachain('', bin(node)) | deltachain = dpack.getdeltachain('', bin(node)) | ||||
dumpdeltachain(ui, deltachain, **opts) | dumpdeltachain(ui, deltachain, **opts) | ||||
return | return | ||||
if opts.get('long'): | if opts.get('long'): | ||||
hashformatter = hex | hashformatter = hex | ||||
hashlen = 42 | hashlen = 42 | ||||
else: | else: | ||||
hashformatter = short | hashformatter = short | ||||
hashlen = 14 | hashlen = 14 | ||||
lastfilename = None | lastfilename = None | ||||
totaldeltasize = 0 | totaldeltasize = 0 | ||||
totalblobsize = 0 | totalblobsize = 0 | ||||
def printtotals(): | def printtotals(): | ||||
if lastfilename is not None: | |||||
ui.write("\n") | |||||
if not totaldeltasize or not totalblobsize: | if not totaldeltasize or not totalblobsize: | ||||
return | return | ||||
difference = totalblobsize - totaldeltasize | difference = totalblobsize - totaldeltasize | ||||
deltastr = "%0.1f%% %s" % ( | deltastr = "%0.1f%% %s" % ( | ||||
(100.0 * abs(difference) / totalblobsize), | (100.0 * abs(difference) / totalblobsize), | ||||
("smaller" if difference > 0 else "bigger")) | ("smaller" if difference > 0 else "bigger")) | ||||
ui.write(("Total:%s%s %s (%s)\n") % ( | ui.write(("Total:%s%s %s (%s)\n") % ( | ||||
"".ljust(2 * hashlen - len("Total:")), | "".ljust(2 * hashlen - len("Total:")), | ||||
str(totaldeltasize).ljust(12), | str(totaldeltasize).ljust(12), | ||||
str(totalblobsize).ljust(9), | str(totalblobsize).ljust(9), | ||||
deltastr | deltastr | ||||
)) | )) | ||||
for filename, node, deltabase, deltalen in dpack.iterentries(): | for filename, node, deltabase, deltalen in dpack.iterentries(): | ||||
if filename != lastfilename: | if filename != lastfilename: | ||||
printtotals() | printtotals() | ||||
name = '(empty name)' if filename == '' else filename | name = '(empty name)' if filename == '' else filename | ||||
ui.write("\n%s:\n" % name) | ui.write("%s:\n" % name) | ||||
ui.write("%s%s%s%s\n" % ( | ui.write("%s%s%s%s\n" % ( | ||||
"Node".ljust(hashlen), | "Node".ljust(hashlen), | ||||
"Delta Base".ljust(hashlen), | "Delta Base".ljust(hashlen), | ||||
"Delta Length".ljust(14), | "Delta Length".ljust(14), | ||||
"Blob Size".ljust(9))) | "Blob Size".ljust(9))) | ||||
lastfilename = filename | lastfilename = filename | ||||
totalblobsize = 0 | totalblobsize = 0 | ||||
totaldeltasize = 0 | totaldeltasize = 0 | ||||
# Metadata could be missing, in which case it will be an empty dict. | # Metadata could be missing, in which case it will be an empty dict. | ||||
meta = dpack.getmeta(filename, node) | meta = dpack.getmeta(filename, node) | ||||
if constants.METAKEYSIZE in meta: | if constants.METAKEYSIZE in meta: | ||||
blobsize = meta[constants.METAKEYSIZE] | blobsize = meta[constants.METAKEYSIZE] | ||||
totaldeltasize += deltalen | totaldeltasize += deltalen | ||||
totalblobsize += blobsize | totalblobsize += blobsize | ||||
else: | else: | ||||
blobsize = "(missing)" | blobsize = "(missing)" | ||||
ui.write("%s %s %s%s\n" % ( | ui.write("%s %s %s%s\n" % ( | ||||
hashformatter(node), | hashformatter(node), | ||||
hashformatter(deltabase), | hashformatter(deltabase), | ||||
str(deltalen).ljust(14), | str(deltalen).ljust(14), | ||||
blobsize)) | blobsize)) | ||||
if filename is not None: | if filename is not None: | ||||
printtotals() | printtotals() | ||||
def dumpdeltachain(ui, deltachain, **opts): | def dumpdeltachain(ui, deltachain, **opts): | ||||
hashformatter = hex | hashformatter = hex | ||||
hashlen = 40 | hashlen = 40 | ||||
lastfilename = None | lastfilename = None | ||||
for filename, node, filename, deltabasenode, delta in deltachain: | for filename, node, filename, deltabasenode, delta in deltachain: | ||||
if filename != lastfilename: | if filename != lastfilename: |
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/repos | $TESTTMP/hgcache/repos | ||||
# Ensure that file 'w' was prefetched - it was not part of the update operation and therefore | # Ensure that file 'w' was prefetched - it was not part of the update operation and therefore | ||||
# could only be downloaded by the background prefetch | # could only be downloaded by the background prefetch | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: | |||||
w: | w: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bb6ccd5dceaa 000000000000 2 2 | bb6ccd5dceaa 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef95c5376f34 000000000000 3 3 | ef95c5376f34 000000000000 3 3 | ||||
1406e7411862 ef95c5376f34 14 2 | 1406e7411862 ef95c5376f34 14 2 | ||||
Total: 17 5 (240.0% bigger) | |||||
Total: 17 5 (240.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
076f5e2225b3 000000000000 2 2 | 076f5e2225b3 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
z: | z: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
69a1b6752270 000000000000 2 2 | 69a1b6752270 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | Total: 2 2 (0.0% bigger) | ||||
# background prefetch with repack on commit when wcprevset configured | # background prefetch with repack on commit when wcprevset configured | ||||
$ cat >> .hg/hgrc <<EOF | $ cat >> .hg/hgrc <<EOF | ||||
> [remotefilelog] | > [remotefilelog] | ||||
> bgprefetchrevs=0:: | > bgprefetchrevs=0:: | ||||
> EOF | > EOF | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/repos | $TESTTMP/hgcache/repos | ||||
# Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore | # Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore | ||||
# could only be downloaded by the background prefetch | # could only be downloaded by the background prefetch | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: | |||||
w: | w: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bb6ccd5dceaa 000000000000 2 2 | bb6ccd5dceaa 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef95c5376f34 000000000000 3 3 | ef95c5376f34 000000000000 3 3 | ||||
1406e7411862 ef95c5376f34 14 2 | 1406e7411862 ef95c5376f34 14 2 | ||||
Total: 17 5 (240.0% bigger) | |||||
Total: 17 5 (240.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
076f5e2225b3 000000000000 2 2 | 076f5e2225b3 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
z: | z: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
69a1b6752270 000000000000 2 2 | 69a1b6752270 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | Total: 2 2 (0.0% bigger) | ||||
# background prefetch with repack on rebase when wcprevset configured | # background prefetch with repack on rebase when wcprevset configured | ||||
$ hg up -r 2 | $ hg up -r 2 | ||||
3 files updated, 0 files merged, 3 files removed, 0 files unresolved | 3 files updated, 0 files merged, 3 files removed, 0 files unresolved | ||||
(leaving bookmark temporary) | (leaving bookmark temporary) | ||||
$ clearcache | $ clearcache | ||||
$ find $CACHEDIR -type f | sort | $ find $CACHEDIR -type f | sort | ||||
$ hg rebase -s temporary -d foo | $ hg rebase -s temporary -d foo | ||||
rebasing 3:58147a5b5242 "b" (temporary tip) | rebasing 3:58147a5b5242 "b" (temporary tip) | ||||
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg (glob) | saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg (glob) | ||||
3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) | ||||
$ sleep 1 | $ sleep 1 | ||||
$ hg debugwaitonprefetch >/dev/null 2>%1 | $ hg debugwaitonprefetch >/dev/null 2>%1 | ||||
$ sleep 1 | $ sleep 1 | ||||
$ hg debugwaitonrepack >/dev/null 2>%1 | $ hg debugwaitonrepack >/dev/null 2>%1 | ||||
# Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore | # Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore | ||||
# could only be downloaded by the background prefetch | # could only be downloaded by the background prefetch | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: | |||||
w: | w: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bb6ccd5dceaa 000000000000 2 2 | bb6ccd5dceaa 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef95c5376f34 000000000000 3 3 | ef95c5376f34 000000000000 3 3 | ||||
1406e7411862 ef95c5376f34 14 2 | 1406e7411862 ef95c5376f34 14 2 | ||||
Total: 17 5 (240.0% bigger) | |||||
Total: 17 5 (240.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
076f5e2225b3 000000000000 2 2 | 076f5e2225b3 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
z: | z: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
69a1b6752270 000000000000 2 2 | 69a1b6752270 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | Total: 2 2 (0.0% bigger) | ||||
# Check that foregound prefetch with no arguments blocks until background prefetches finish | # Check that foregound prefetch with no arguments blocks until background prefetches finish | ||||
$ hg up -r 3 | $ hg up -r 3 | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ clearcache | $ clearcache | ||||
$ hg prefetch --repack | $ hg prefetch --repack | ||||
$TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx | ||||
$TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/repos | $TESTTMP/hgcache/repos | ||||
# Ensure that files were prefetched | # Ensure that files were prefetched | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: | |||||
w: | w: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bb6ccd5dceaa 000000000000 2 2 | bb6ccd5dceaa 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef95c5376f34 000000000000 3 3 | ef95c5376f34 000000000000 3 3 | ||||
1406e7411862 ef95c5376f34 14 2 | 1406e7411862 ef95c5376f34 14 2 | ||||
Total: 17 5 (240.0% bigger) | |||||
Total: 17 5 (240.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
076f5e2225b3 000000000000 2 2 | 076f5e2225b3 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
z: | z: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
69a1b6752270 000000000000 2 2 | 69a1b6752270 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | Total: 2 2 (0.0% bigger) | ||||
# Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch' | # Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch' | ||||
$ clearcache | $ clearcache | ||||
$ hg prefetch --repack | $ hg prefetch --repack | ||||
waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?) | waiting for lock on prefetching in $TESTTMP/shallow held by process * on host * (glob) (?) | ||||
got lock after * seconds (glob) (?) | got lock after * seconds (glob) (?) | ||||
(running background incremental repack) | (running background incremental repack) | ||||
* files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?) | * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?) | ||||
$ sleep 0.5 | $ sleep 0.5 | ||||
$ hg debugwaitonrepack >/dev/null 2>%1 | $ hg debugwaitonrepack >/dev/null 2>%1 | ||||
$ find $CACHEDIR -type f | sort | $ find $CACHEDIR -type f | sort | ||||
$TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histidx | ||||
$TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack | $TESTTMP/hgcache/master/packs/27c52c105a1ddf8c75143a6b279b04c24b1f4bee.histpack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.dataidx | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/repos | $TESTTMP/hgcache/repos | ||||
# Ensure that files were prefetched | # Ensure that files were prefetched | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0.datapack | ||||
$TESTTMP/hgcache/master/packs/8299d5a1030f073f4adbb3b6bd2ad3bdcc276df0: | |||||
w: | w: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bb6ccd5dceaa 000000000000 2 2 | bb6ccd5dceaa 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef95c5376f34 000000000000 3 3 | ef95c5376f34 000000000000 3 3 | ||||
1406e7411862 ef95c5376f34 14 2 | 1406e7411862 ef95c5376f34 14 2 | ||||
Total: 17 5 (240.0% bigger) | |||||
Total: 17 5 (240.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
076f5e2225b3 000000000000 2 2 | 076f5e2225b3 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
z: | z: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
69a1b6752270 000000000000 2 2 | 69a1b6752270 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | Total: 2 2 (0.0% bigger) | ||||
# Test that if data was prefetched and repacked we dont need to prefetch it again | # Test that if data was prefetched and repacked we dont need to prefetch it again | ||||
# It ensures that Mercurial looks not only in loose files but in packs as well | # It ensures that Mercurial looks not only in loose files but in packs as well | ||||
$ hg prefetch --repack | $ hg prefetch --repack | ||||
(running background incremental repack) | (running background incremental repack) |
$ find $CACHEDIR | sort | grep ".datapack\|.histpack" | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" | ||||
$TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | ||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | ||||
# Ensure that all file versions were prefetched | # Ensure that all file versions were prefetched | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | ||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1406e7411862 000000000000 2 2 | 1406e7411862 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
50dbc4572b8e 000000000000 3 3 | 50dbc4572b8e 000000000000 3 3 | ||||
076f5e2225b3 50dbc4572b8e 14 2 | 076f5e2225b3 50dbc4572b8e 14 2 | ||||
Total: 17 5 (240.0% bigger) | Total: 17 5 (240.0% bigger) | ||||
# Test garbage collection during repack | # Test garbage collection during repack | ||||
$ cat >> .hg/hgrc <<EOF | $ cat >> .hg/hgrc <<EOF | ||||
> [remotefilelog] | > [remotefilelog] | ||||
> bgprefetchrevs=tip | > bgprefetchrevs=tip | ||||
> gcrepack=True | > gcrepack=True | ||||
> nodettl=86400 | > nodettl=86400 | ||||
> EOF | > EOF | ||||
$ hg repack | $ hg repack | ||||
$ sleep 0.5 | $ sleep 0.5 | ||||
$ hg debugwaitonrepack >/dev/null 2>%1 | $ hg debugwaitonrepack >/dev/null 2>%1 | ||||
$ find $CACHEDIR | sort | grep ".datapack\|.histpack" | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" | ||||
$TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33.datapack | $TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33.datapack | ||||
$TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | ||||
# Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset | # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset | ||||
# and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset. | # 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 | $ hg debugdatapack $TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33.datapack | ||||
$TESTTMP/hgcache/master/packs/05baa499c6b07f2bf0ea3d2c8151da1cb86f5e33: | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
50dbc4572b8e 000000000000 3 3 | 50dbc4572b8e 000000000000 3 3 | ||||
Total: 3 3 (0.0% bigger) | Total: 3 3 (0.0% bigger) | ||||
# Prefetch all data again and repack for later garbage collection | # Prefetch all data again and repack for later garbage collection | ||||
$ cat >> .hg/hgrc <<EOF | $ cat >> .hg/hgrc <<EOF | ||||
> [remotefilelog] | > [remotefilelog] | ||||
> bgprefetchrevs=all() | > bgprefetchrevs=all() | ||||
> EOF | > EOF | ||||
$ hg prefetch | $ hg prefetch | ||||
2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) | ||||
$ hg repack | $ hg repack | ||||
$ sleep 0.5 | $ sleep 0.5 | ||||
$ hg debugwaitonrepack >/dev/null 2>%1 | $ hg debugwaitonrepack >/dev/null 2>%1 | ||||
$ find $CACHEDIR | sort | grep ".datapack\|.histpack" | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" | ||||
$TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | ||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | ||||
# Ensure that all file versions were prefetched | # Ensure that all file versions were prefetched | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | ||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1406e7411862 000000000000 2 2 | 1406e7411862 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
50dbc4572b8e 000000000000 3 3 | 50dbc4572b8e 000000000000 3 3 | ||||
076f5e2225b3 50dbc4572b8e 14 2 | 076f5e2225b3 50dbc4572b8e 14 2 | ||||
Total: 17 5 (240.0% bigger) | 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 | # Test garbage collection during repack. Ensure that new files are not removed even though they are not in the keepset | ||||
# For the purposes of the test the TTL of a file is set to current time + 100 seconds. i.e. all commits in tests have | # For the purposes of the test the TTL of a file is set to current time + 100 seconds. i.e. all commits in tests have | ||||
# a date of 1970 and therefore to prevent garbage collection we have to set nodettl to be farther from 1970 than we are now. | # a date of 1970 and therefore to prevent garbage collection we have to set nodettl to be farther from 1970 than we are now. | ||||
$ cat >> .hg/hgrc <<EOF | $ cat >> .hg/hgrc <<EOF | ||||
> [remotefilelog] | > [remotefilelog] | ||||
> bgprefetchrevs= | > bgprefetchrevs= | ||||
> nodettl=$(($(date +%s) + 100)) | > nodettl=$(($(date +%s) + 100)) | ||||
> EOF | > EOF | ||||
$ hg repack | $ hg repack | ||||
$ sleep 0.5 | $ sleep 0.5 | ||||
$ hg debugwaitonrepack >/dev/null 2>%1 | $ hg debugwaitonrepack >/dev/null 2>%1 | ||||
$ find $CACHEDIR | sort | grep ".datapack\|.histpack" | $ find $CACHEDIR | sort | grep ".datapack\|.histpack" | ||||
$TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | $TESTTMP/hgcache/master/packs/9a2ea858fe2967db9b6ea4c0ca238881cae9d6eb.histpack | ||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | ||||
# Ensure that all file versions were prefetched | # Ensure that all file versions were prefetched | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4.datapack | ||||
$TESTTMP/hgcache/master/packs/f7a942a6e4673d2c7b697fdd926ca2d153831ca4: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1406e7411862 000000000000 2 2 | 1406e7411862 000000000000 2 2 | ||||
Total: 2 2 (0.0% bigger) | |||||
Total: 2 2 (0.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
50dbc4572b8e 000000000000 3 3 | 50dbc4572b8e 000000000000 3 3 | ||||
076f5e2225b3 50dbc4572b8e 14 2 | 076f5e2225b3 50dbc4572b8e 14 2 | ||||
Total: 17 5 (240.0% bigger) | Total: 17 5 (240.0% bigger) |
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack | $TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.dataidx | $TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.dataidx | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | $TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | ||||
$TESTTMP/hgcache/repos | $TESTTMP/hgcache/repos | ||||
# Test debug commands | # Test debug commands | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e03 000000000000 8 8 | 1bb2e6237e03 000000000000 8 8 | ||||
d4a3ed9310e5 1bb2e6237e03 12 6 | d4a3ed9310e5 1bb2e6237e03 12 6 | ||||
aee31534993a d4a3ed9310e5 12 4 | aee31534993a d4a3ed9310e5 12 4 | ||||
Total: 32 18 (77.8% bigger) | Total: 32 18 (77.8% bigger) | ||||
$ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack | $ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8 | 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8 | ||||
d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6 | d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6 | ||||
aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4 | aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4 | ||||
Total: 32 18 (77.8% bigger) | Total: 32 18 (77.8% bigger) | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216 | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216 | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15: | |||||
x | x | ||||
Node Delta Base Delta SHA1 Delta Length | Node Delta Base Delta SHA1 Delta Length | ||||
d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12 | d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12 | ||||
Node Delta Base Delta SHA1 Delta Length | Node Delta Base Delta SHA1 Delta Length | ||||
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8 | 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8 | ||||
$ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx | $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx | ||||
$ rm -rf $TESTTMP/hgcache/master/packs | $ rm -rf $TESTTMP/hgcache/master/packs | ||||
$ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs | $ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs | ||||
# Test repacking datapack without history | # Test repacking datapack without history | ||||
$ rm -rf $CACHEDIR/master/packs/*hist* | $ rm -rf $CACHEDIR/master/packs/*hist* | ||||
$ hg repack | $ hg repack | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | ||||
$TESTTMP/hgcache/master/packs/055c02949317b8507cdb7aaf2e00cc00fd0c5716: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e03 000000000000 8 8 | 1bb2e6237e03 000000000000 8 8 | ||||
aee31534993a 000000000000 4 4 | aee31534993a 000000000000 4 4 | ||||
d4a3ed9310e5 000000000000 6 6 | d4a3ed9310e5 000000000000 6 6 | ||||
Total: 18 18 (0.0% bigger) | |||||
Total: 18 18 (0.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
577959738234 000000000000 70 8 | 577959738234 000000000000 70 8 | ||||
Total: 70 8 (775.0% bigger) | Total: 70 8 (775.0% bigger) | ||||
$ hg cat -r ".^" x | $ hg cat -r ".^" x | ||||
x | x | ||||
x | x | ||||
x | x | ||||
x | x | ||||
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack | $TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.dataidx | $TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.dataidx | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | $TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15.datapack | ||||
$TESTTMP/hgcache/repos | $TESTTMP/hgcache/repos | ||||
# Test debug commands | # Test debug commands | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e03 000000000000 8 8 | 1bb2e6237e03 000000000000 8 8 | ||||
d4a3ed9310e5 1bb2e6237e03 12 6 | d4a3ed9310e5 1bb2e6237e03 12 6 | ||||
aee31534993a d4a3ed9310e5 12 4 | aee31534993a d4a3ed9310e5 12 4 | ||||
Total: 32 18 (77.8% bigger) | Total: 32 18 (77.8% bigger) | ||||
$ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack | $ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8 | 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8 | ||||
d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6 | d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 12 6 | ||||
aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4 | aee31534993a501858fb6dd96a065671922e7d51 d4a3ed9310e5bd9887e3bf779da5077efab28216 12 4 | ||||
Total: 32 18 (77.8% bigger) | Total: 32 18 (77.8% bigger) | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216 | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node d4a3ed9310e5bd9887e3bf779da5077efab28216 | ||||
$TESTTMP/hgcache/master/packs/8fe685c56f6f7edf550bfcec74eeecc5f3c2ba15: | |||||
x | x | ||||
Node Delta Base Delta SHA1 Delta Length | Node Delta Base Delta SHA1 Delta Length | ||||
d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12 | d4a3ed9310e5bd9887e3bf779da5077efab28216 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 77029ab56e83ea2115dd53ff87483682abe5d7ca 12 | ||||
Node Delta Base Delta SHA1 Delta Length | Node Delta Base Delta SHA1 Delta Length | ||||
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8 | 1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 7ca8c71a64f7b56380e77573da2f7a5fdd2ecdb5 8 | ||||
$ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx | $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx | ||||
$ rm -rf $TESTTMP/hgcache/master/packs | $ rm -rf $TESTTMP/hgcache/master/packs | ||||
$ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs | $ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs | ||||
# Test repacking datapack without history | # Test repacking datapack without history | ||||
$ rm -rf $CACHEDIR/master/packs/*hist* | $ rm -rf $CACHEDIR/master/packs/*hist* | ||||
$ hg repack | $ hg repack | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack | ||||
$TESTTMP/hgcache/master/packs/055c02949317b8507cdb7aaf2e00cc00fd0c5716: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e03 000000000000 8 8 | 1bb2e6237e03 000000000000 8 8 | ||||
aee31534993a 000000000000 4 4 | aee31534993a 000000000000 4 4 | ||||
d4a3ed9310e5 000000000000 6 6 | d4a3ed9310e5 000000000000 6 6 | ||||
Total: 18 18 (0.0% bigger) | |||||
Total: 18 18 (0.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
577959738234 000000000000 70 8 | 577959738234 000000000000 70 8 | ||||
Total: 70 8 (775.0% bigger) | Total: 70 8 (775.0% bigger) | ||||
$ hg cat -r ".^" x | $ hg cat -r ".^" x | ||||
x | x | ||||
x | x | ||||
x | x | ||||
x | x | ||||
1bb2e6237e03 => d4a3ed9310e5 000000000000 0b03bbc9e1e7 | 1bb2e6237e03 => d4a3ed9310e5 000000000000 0b03bbc9e1e7 | ||||
d4a3ed9310e5 => aee31534993a 000000000000 421535db10b6 | d4a3ed9310e5 => aee31534993a 000000000000 421535db10b6 | ||||
aee31534993a => 1406e7411862 000000000000 a89d614e2364 | aee31534993a => 1406e7411862 000000000000 a89d614e2364 | ||||
1406e7411862 => 000000000000 000000000000 b292c1e3311f | 1406e7411862 => 000000000000 000000000000 b292c1e3311f | ||||
Test limiting the max delta chain length | Test limiting the max delta chain length | ||||
$ hg repack --config packs.maxchainlen=1 | $ hg repack --config packs.maxchainlen=1 | ||||
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx | $ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/a2731c9a16403457b67337a620931797fce8c821: | |||||
x: | x: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1bb2e6237e03 000000000000 8 8 | 1bb2e6237e03 000000000000 8 8 | ||||
d4a3ed9310e5 1bb2e6237e03 12 6 | d4a3ed9310e5 1bb2e6237e03 12 6 | ||||
aee31534993a 000000000000 4 4 | aee31534993a 000000000000 4 4 | ||||
1406e7411862 aee31534993a 12 2 | 1406e7411862 aee31534993a 12 2 | ||||
Total: 36 20 (80.0% bigger) | |||||
Total: 36 20 (80.0% bigger) | |||||
y: | y: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
577959738234 000000000000 8 8 | 577959738234 000000000000 8 8 | ||||
Total: 8 8 (0.0% bigger) | Total: 8 8 (0.0% bigger) |
$ hg prefetchtrees -r '0 + 1 + 2' | $ hg prefetchtrees -r '0 + 1 + 2' | ||||
6 trees fetched over * (glob) | 6 trees fetched over * (glob) | ||||
$ ls $CACHEDIR/master/packs/manifests | $ ls $CACHEDIR/master/packs/manifests | ||||
29938257d506f677320d5abec8e34a1a9ed635fe.histidx | 29938257d506f677320d5abec8e34a1a9ed635fe.histidx | ||||
29938257d506f677320d5abec8e34a1a9ed635fe.histpack | 29938257d506f677320d5abec8e34a1a9ed635fe.histpack | ||||
8adc618d23082c0a5311a4bbf9ac08b9b9672471.dataidx | 8adc618d23082c0a5311a4bbf9ac08b9b9672471.dataidx | ||||
8adc618d23082c0a5311a4bbf9ac08b9b9672471.datapack | 8adc618d23082c0a5311a4bbf9ac08b9b9672471.datapack | ||||
$ hg debugdatapack --long $CACHEDIR/master/packs/manifests/*.dataidx | $ hg debugdatapack --long $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/8adc618d23082c0a5311a4bbf9ac08b9b9672471: | |||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a648a43a997aef53123bce309c794fd 0000000000000000000000000000000000000000 43 (missing) | ddb35f099a648a43a997aef53123bce309c794fd 0000000000000000000000000000000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1be4ab2126dd2252dcae6be2aac2561dd3ddcda0 0000000000000000000000000000000000000000 95 (missing) | 1be4ab2126dd2252dcae6be2aac2561dd3ddcda0 0000000000000000000000000000000000000000 95 (missing) | ||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76d6aab2edb46810b20fbdbd10fb4b 0000000000000000000000000000000000000000 43 (missing) | a18d21674e76d6aab2edb46810b20fbdbd10fb4b 0000000000000000000000000000000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb5aaf93ca7d9062931b0f6a0d6db5 0000000000000000000000000000000000000000 95 (missing) | 60a7f7acb6bb5aaf93ca7d9062931b0f6a0d6db5 0000000000000000000000000000000000000000 95 (missing) | ||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bc0c2c938b929f98b1c31a8c5994396ebb096bf0 0000000000000000000000000000000000000000 43 (missing) | bc0c2c938b929f98b1c31a8c5994396ebb096bf0 0000000000000000000000000000000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef362f8bbe8aa457b0cfc49f200cbeb7747984ed 0000000000000000000000000000000000000000 46 (missing) | ef362f8bbe8aa457b0cfc49f200cbeb7747984ed 0000000000000000000000000000000000000000 46 (missing) | ||||
$ hg debughistorypack $CACHEDIR/master/packs/manifests/*.histidx | $ hg debughistorypack $CACHEDIR/master/packs/manifests/*.histidx | ||||
Node P1 Node P2 Node Link Node Copy From | Node P1 Node P2 Node Link Node Copy From | ||||
60a7f7acb6bb 1be4ab2126dd 000000000000 bd6f9b289c01 | 60a7f7acb6bb 1be4ab2126dd 000000000000 bd6f9b289c01 | ||||
1be4ab2126dd ef362f8bbe8a 000000000000 f15c65c6e9bd | 1be4ab2126dd ef362f8bbe8a 000000000000 f15c65c6e9bd | ||||
ef362f8bbe8a 000000000000 000000000000 ecfb693caff5 | ef362f8bbe8a 000000000000 000000000000 ecfb693caff5 | ||||
dir | dir | ||||
Node P1 Node P2 Node Link Node Copy From | Node P1 Node P2 Node Link Node Copy From | ||||
a18d21674e76 bc0c2c938b92 000000000000 bd6f9b289c01 | a18d21674e76 bc0c2c938b92 000000000000 bd6f9b289c01 | ||||
bc0c2c938b92 000000000000 000000000000 ecfb693caff5 | bc0c2c938b92 000000000000 000000000000 ecfb693caff5 | ||||
subdir | subdir | ||||
Node P1 Node P2 Node Link Node Copy From | Node P1 Node P2 Node Link Node Copy From | ||||
ddb35f099a64 000000000000 000000000000 f15c65c6e9bd | ddb35f099a64 000000000000 000000000000 f15c65c6e9bd | ||||
$ hg debugdatapack --node ef362f8bbe8aa457b0cfc49f200cbeb7747984ed $CACHEDIR/master/packs/manifests/*.dataidx | $ hg debugdatapack --node ef362f8bbe8aa457b0cfc49f200cbeb7747984ed $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/8adc618d23082c0a5311a4bbf9ac08b9b9672471: | |||||
Node Delta Base Delta SHA1 Delta Length | Node Delta Base Delta SHA1 Delta Length | ||||
ef362f8bbe8aa457b0cfc49f200cbeb7747984ed 0000000000000000000000000000000000000000 3b295111780498d177793f9228bf736b915f0255 46 | ef362f8bbe8aa457b0cfc49f200cbeb7747984ed 0000000000000000000000000000000000000000 3b295111780498d177793f9228bf736b915f0255 46 | ||||
$ hg -R ../master debugindex ../master/.hg/store/00manifesttree.i | $ hg -R ../master debugindex ../master/.hg/store/00manifesttree.i | ||||
rev offset length delta linkrev nodeid p1 p2 | rev offset length delta linkrev nodeid p1 p2 | ||||
0 0 47 -1 0 ef362f8bbe8a 000000000000 000000000000 | 0 0 47 -1 0 ef362f8bbe8a 000000000000 000000000000 | ||||
1 47 61 0 1 1be4ab2126dd ef362f8bbe8a 000000000000 | 1 47 61 0 1 1be4ab2126dd ef362f8bbe8a 000000000000 | ||||
2 108 58 1 2 60a7f7acb6bb 1be4ab2126dd 000000000000 | 2 108 58 1 2 60a7f7acb6bb 1be4ab2126dd 000000000000 | ||||
$ hg -R ../master debugindex ../master/.hg/store/00manifest.i | $ hg -R ../master debugindex ../master/.hg/store/00manifest.i | ||||
rev offset length delta linkrev nodeid p1 p2 | rev offset length delta linkrev nodeid p1 p2 | ||||
0 0 48 -1 0 ef362f8bbe8a 000000000000 000000000000 | 0 0 48 -1 0 ef362f8bbe8a 000000000000 000000000000 | ||||
1 48 62 0 1 1be4ab2126dd ef362f8bbe8a 000000000000 | 1 48 62 0 1 1be4ab2126dd ef362f8bbe8a 000000000000 | ||||
2 110 59 1 2 60a7f7acb6bb 1be4ab2126dd 000000000000 | 2 110 59 1 2 60a7f7acb6bb 1be4ab2126dd 000000000000 | ||||
Test prefetch with base node (subdir/ shouldn't show up in the pack) | Test prefetch with base node (subdir/ shouldn't show up in the pack) | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg prefetchtrees -r '2' --base '1' | $ hg prefetchtrees -r '2' --base '1' | ||||
2 trees fetched over * (glob) | 2 trees fetched over * (glob) | ||||
$ ls $CACHEDIR/master/packs/manifests/*.dataidx | $ ls $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | $TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76 000000000000 43 (missing) | a18d21674e76 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb 000000000000 95 (missing) | 60a7f7acb6bb 000000000000 95 (missing) | ||||
Test auto prefetch during normal access | Test auto prefetch during normal access | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
|| ( exit 1 ) is needed because ls on OSX and Linux exits differently | || ( exit 1 ) is needed because ls on OSX and Linux exits differently | ||||
$ ls $CACHEDIR/master/packs/manifests || ( exit 1 ) | $ ls $CACHEDIR/master/packs/manifests || ( exit 1 ) | ||||
*No such file or directory (glob) | *No such file or directory (glob) | ||||
[1] | [1] | ||||
$ hg log -r tip --stat --pager=off | $ hg log -r tip --stat --pager=off | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | 3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | ||||
3fb59713808147bda39cbd97b9cd862406f5865c.datapack | 3fb59713808147bda39cbd97b9cd862406f5865c.datapack | ||||
524ab81400c6bc8449e3e720d81f836ebacec539.histidx | 524ab81400c6bc8449e3e720d81f836ebacec539.histidx | ||||
524ab81400c6bc8449e3e720d81f836ebacec539.histpack | 524ab81400c6bc8449e3e720d81f836ebacec539.histpack | ||||
e5c44a5c1bbfd8841df1c6c4b7cca54536e016db.histidx | e5c44a5c1bbfd8841df1c6c4b7cca54536e016db.histidx | ||||
e5c44a5c1bbfd8841df1c6c4b7cca54536e016db.histpack | e5c44a5c1bbfd8841df1c6c4b7cca54536e016db.histpack | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675 | $ hg debugdatapack $CACHEDIR/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675 | ||||
$TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bc0c2c938b92 000000000000 43 (missing) | bc0c2c938b92 000000000000 43 (missing) | ||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a64 000000000000 43 (missing) | ddb35f099a64 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1be4ab2126dd 000000000000 95 (missing) | 1be4ab2126dd 000000000000 95 (missing) | ||||
- Note that subdir/ is not downloaded again | - Note that subdir/ is not downloaded again | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c | $ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c | ||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76 000000000000 43 (missing) | a18d21674e76 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb 000000000000 95 (missing) | 60a7f7acb6bb 000000000000 95 (missing) | ||||
Test that auto prefetch scans up the changelog for base trees | Test that auto prefetch scans up the changelog for base trees | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg prefetchtrees -r 'tip^' | $ hg prefetchtrees -r 'tip^' | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg prefetchtrees -r tip | $ hg prefetchtrees -r tip | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
- Only 2 of the 3 trees from tip^ are downloaded as part of --stat's fetch | - Only 2 of the 3 trees from tip^ are downloaded as part of --stat's fetch | ||||
$ hg log -r tip --stat --pager=off > /dev/null | $ hg log -r tip --stat --pager=off > /dev/null | ||||
2 trees fetched over * (glob) | 2 trees fetched over * (glob) | ||||
Test auto prefetch during pull | Test auto prefetch during pull | ||||
- Prefetch everything | - Prefetch everything | ||||
$ echo a >> a | $ echo a >> a | ||||
$ hg commit -Aqm 'draft commit that shouldnt affect prefetch' | $ hg commit -Aqm 'draft commit that shouldnt affect prefetch' | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg pull --config treemanifest.pullprefetchcount=10 --traceback | $ hg pull --config treemanifest.pullprefetchcount=10 --traceback | ||||
pulling from ssh://user@dummy/master | pulling from ssh://user@dummy/master | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
prefetching trees | prefetching trees | ||||
6 trees fetched over * (glob) | 6 trees fetched over * (glob) | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/8adc618d23082c0a5311a4bbf9ac08b9b9672471: | |||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a64 000000000000 43 (missing) | ddb35f099a64 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1be4ab2126dd 000000000000 95 (missing) | 1be4ab2126dd 000000000000 95 (missing) | ||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76 000000000000 43 (missing) | a18d21674e76 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb 000000000000 95 (missing) | 60a7f7acb6bb 000000000000 95 (missing) | ||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bc0c2c938b92 000000000000 43 (missing) | bc0c2c938b92 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ef362f8bbe8a 000000000000 46 (missing) | ef362f8bbe8a 000000000000 46 (missing) | ||||
$ hg strip -q -r 'draft()' | $ hg strip -q -r 'draft()' | ||||
- Prefetch just the top manifest (but the full one) | - Prefetch just the top manifest (but the full one) | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg pull --config treemanifest.pullprefetchcount=1 --traceback | $ hg pull --config treemanifest.pullprefetchcount=1 --traceback | ||||
pulling from ssh://user@dummy/master | pulling from ssh://user@dummy/master | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
prefetching trees | prefetching trees | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/4ee15de76c068ec1c80e3e61f2c3c476a779078a: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76 000000000000 43 (missing) | a18d21674e76 000000000000 43 (missing) | ||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a64 000000000000 43 (missing) | ddb35f099a64 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb 000000000000 95 (missing) | 60a7f7acb6bb 000000000000 95 (missing) | ||||
- Prefetch commit 1 then minimally prefetch commit 2 | - Prefetch commit 1 then minimally prefetch commit 2 | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg prefetchtrees -r 1 | $ hg prefetchtrees -r 1 | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
$ ls $CACHEDIR/master/packs/manifests/*dataidx | $ ls $CACHEDIR/master/packs/manifests/*dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675.dataidx | $TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675.dataidx | ||||
$ hg pull --config treemanifest.pullprefetchcount=1 --traceback | $ hg pull --config treemanifest.pullprefetchcount=1 --traceback | ||||
pulling from ssh://user@dummy/master | pulling from ssh://user@dummy/master | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
prefetching trees | prefetching trees | ||||
2 trees fetched over * (glob) | 2 trees fetched over * (glob) | ||||
$ ls $CACHEDIR/master/packs/manifests/*dataidx | $ ls $CACHEDIR/master/packs/manifests/*dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675.dataidx | $TESTTMP/hgcache/master/packs/manifests/148e9eb32f473ea522c591c95be0f9e772be9675.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | $TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/3fb59713808147bda39cbd97b9cd862406f5865c: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76 000000000000 43 (missing) | a18d21674e76 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb 000000000000 95 (missing) | 60a7f7acb6bb 000000000000 95 (missing) | ||||
Test prefetching certain revs during pull | Test prefetching certain revs during pull | ||||
$ cd ../master | $ cd ../master | ||||
$ echo x >> dir/x | $ echo x >> dir/x | ||||
$ hg commit -qm "modify dir/x a third time" | $ hg commit -qm "modify dir/x a third time" | ||||
$ echo x >> dir/x | $ echo x >> dir/x | ||||
$ hg commit -qm "modify dir/x a fourth time" | $ hg commit -qm "modify dir/x a fourth time" | ||||
$ cd ../client | $ cd ../client | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg pull --config treemanifest.pullprefetchrevs='tip~2' | $ hg pull --config treemanifest.pullprefetchrevs='tip~2' | ||||
pulling from ssh://user@dummy/master | pulling from ssh://user@dummy/master | ||||
searching for changes | searching for changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
adding file changes | adding file changes | ||||
added 2 changesets with 2 changes to 1 files | added 2 changesets with 2 changes to 1 files | ||||
new changesets dece825f8add:cfacdcc4cee5 | new changesets dece825f8add:cfacdcc4cee5 | ||||
(run 'hg update' to get a working copy) | (run 'hg update' to get a working copy) | ||||
prefetching trees | prefetching trees | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/4ee15de76c068ec1c80e3e61f2c3c476a779078a: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a18d21674e76 000000000000 43 (missing) | a18d21674e76 000000000000 43 (missing) | ||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a64 000000000000 43 (missing) | ddb35f099a64 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
60a7f7acb6bb 000000000000 95 (missing) | 60a7f7acb6bb 000000000000 95 (missing) | ||||
- Test prefetching only the new tree parts for a commit who's parent tree is not | - 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. | - downloaded already. Note that subdir/z was not downloaded this time. | ||||
$ hg pull --config treemanifest.pullprefetchrevs='tip' | $ hg pull --config treemanifest.pullprefetchrevs='tip' | ||||
pulling from ssh://user@dummy/master | pulling from ssh://user@dummy/master | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
prefetching trees | prefetching trees | ||||
2 trees fetched over * (glob) | 2 trees fetched over * (glob) | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/99050e724a9236121684523ba3f4db270e62fb58.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/99050e724a9236121684523ba3f4db270e62fb58.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/99050e724a9236121684523ba3f4db270e62fb58: | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bf22bc15398b 000000000000 43 (missing) | bf22bc15398b 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
aa52a49be522 000000000000 95 (missing) | aa52a49be522 000000000000 95 (missing) | ||||
Test that prefetch refills just part of a tree when the cache is deleted | Test that prefetch refills just part of a tree when the cache is deleted | ||||
$ echo >> dir/x | $ echo >> dir/x | ||||
$ hg commit -m 'edit x locally' | $ hg commit -m 'edit x locally' | ||||
created new head | created new head | ||||
$ rm -rf $CACHEDIR/master/* | $ rm -rf $CACHEDIR/master/* | ||||
$ hg cat subdir/z | $ hg cat subdir/z | ||||
3 trees fetched over * (glob) | 3 trees fetched over * (glob) | ||||
z | z | ||||
Test prefetch non-parent commits with no base node (should fetch minimal | Test prefetch non-parent commits with no base node (should fetch minimal | ||||
trees - in this case 3 trees for commit 2, and 2 for commit 4 despite it having | trees - in this case 3 trees for commit 2, and 2 for commit 4 despite it having | ||||
3 directories) | 3 directories) | ||||
$ rm -rf $CACHEDIR/master | $ rm -rf $CACHEDIR/master | ||||
$ hg prefetchtrees -r '2 + 4' | $ hg prefetchtrees -r '2 + 4' | ||||
5 trees fetched over * (glob) | 5 trees fetched over * (glob) |
-r--r--r-- 248 bb55d9105672c45d4f82df15bd091a555ef02c79.datapack | -r--r--r-- 248 bb55d9105672c45d4f82df15bd091a555ef02c79.datapack | ||||
- Verify datapack contents | - Verify datapack contents | ||||
$ for i in $CACHEDIR/master/packs/manifests/*.datapack; do | $ for i in $CACHEDIR/master/packs/manifests/*.datapack; do | ||||
> echo $i | > echo $i | ||||
> hg debugdatapack "$i" | > hg debugdatapack "$i" | ||||
> done | > done | ||||
$TESTTMP/hgcache/master/packs/manifests/65df85879cdd898607ee3f323a0b61edc7de25b8.datapack | $TESTTMP/hgcache/master/packs/manifests/65df85879cdd898607ee3f323a0b61edc7de25b8.datapack | ||||
$TESTTMP/hgcache/master/packs/manifests/65df85879cdd898607ee3f323a0b61edc7de25b8: | |||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a0c8bcbbb45c 000000000000 43 (missing) | 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: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
23226e7a252c 000000000000 43 (missing) | 23226e7a252c 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1832e0765de9 000000000000 89 (missing) | 1832e0765de9 000000000000 89 (missing) | ||||
- Verify histpack contents | - Verify histpack contents | ||||
$ for i in $CACHEDIR/master/packs/manifests/*.histpack; do | $ for i in $CACHEDIR/master/packs/manifests/*.histpack; do | ||||
> echo $i | > echo $i | ||||
> hg debughistorypack "$i" | > hg debughistorypack "$i" | ||||
> done | > done | ||||
$TESTTMP/hgcache/master/packs/manifests/4301ce26f4c07686220c7f57d80b466cfba9899e.histpack | $TESTTMP/hgcache/master/packs/manifests/4301ce26f4c07686220c7f57d80b466cfba9899e.histpack | ||||
- Repack and reverify | - Repack and reverify | ||||
$ hg repack | $ hg repack | ||||
$ ls_l $CACHEDIR/master/packs/manifests | grep pack | $ ls_l $CACHEDIR/master/packs/manifests | grep pack | ||||
-r--r--r-- 339 56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a.datapack | -r--r--r-- 339 56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a.datapack | ||||
-r--r--r-- 262 7535b6084226436bbdff33043969e7fa963e8428.histpack | -r--r--r-- 262 7535b6084226436bbdff33043969e7fa963e8428.histpack | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.datapack | $ hg debugdatapack $CACHEDIR/master/packs/manifests/*.datapack | ||||
$TESTTMP/hgcache/master/packs/manifests/56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a: | |||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1832e0765de9 000000000000 89 89 | 1832e0765de9 000000000000 89 89 | ||||
a0c8bcbbb45c 1832e0765de9 12 43 | a0c8bcbbb45c 1832e0765de9 12 43 | ||||
Total: 101 132 (23.5% smaller) | |||||
Total: 101 132 (23.5% smaller) | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
23226e7a252c 000000000000 43 43 | 23226e7a252c 000000000000 43 43 | ||||
Total: 43 43 (0.0% bigger) | Total: 43 43 (0.0% bigger) | ||||
$ hg debughistorypack $CACHEDIR/master/packs/manifests/*.histpack | $ hg debughistorypack $CACHEDIR/master/packs/manifests/*.histpack | ||||
Node P1 Node P2 Node Link Node Copy From | Node P1 Node P2 Node Link Node Copy From | ||||
1832e0765de9 a0c8bcbbb45c 000000000000 8e83608cbe60 | 1832e0765de9 a0c8bcbbb45c 000000000000 8e83608cbe60 | ||||
a0c8bcbbb45c 000000000000 000000000000 1f0dee641bb7 | a0c8bcbbb45c 000000000000 000000000000 1f0dee641bb7 | ||||
$ hg repack | $ hg repack | ||||
$ ls .hg/cache/packs/manifests | $ ls .hg/cache/packs/manifests | ||||
56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a.dataidx | 56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a.dataidx | ||||
56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a.datapack | 56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a.datapack | ||||
7535b6084226436bbdff33043969e7fa963e8428.histidx | 7535b6084226436bbdff33043969e7fa963e8428.histidx | ||||
7535b6084226436bbdff33043969e7fa963e8428.histpack | 7535b6084226436bbdff33043969e7fa963e8428.histpack | ||||
$ hg debugdatapack .hg/cache/packs/manifests/*.datapack | $ hg debugdatapack .hg/cache/packs/manifests/*.datapack | ||||
.hg/cache/packs/manifests/56e8c6f0ca2a324b8b5ca1a2730323a1b4d0793a: | |||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1832e0765de9 000000000000 89 89 | 1832e0765de9 000000000000 89 89 | ||||
a0c8bcbbb45c 1832e0765de9 12 43 | a0c8bcbbb45c 1832e0765de9 12 43 | ||||
Total: 101 132 (23.5% smaller) | |||||
Total: 101 132 (23.5% smaller) | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
23226e7a252c 000000000000 43 43 | 23226e7a252c 000000000000 43 43 | ||||
Total: 43 43 (0.0% bigger) | Total: 43 43 (0.0% bigger) | ||||
Test incremental revlog repacking | Test incremental revlog repacking | ||||
# 1. Make commit that we'll need to repack | # 1. Make commit that we'll need to repack | ||||
$ echo >> a | $ echo >> a | ||||
$ hg commit -Aqm 'modify a' | $ hg commit -Aqm 'modify a' | ||||
$ hg debugindex .hg/store/00manifesttree.i | $ hg debugindex .hg/store/00manifesttree.i | ||||
rev offset length delta linkrev nodeid p1 p2 | rev offset length delta linkrev nodeid p1 p2 | ||||
$ hg debugdatapack .hg/cache/packs/manifests/*.datapack | grep 7878 | $ hg debugdatapack .hg/cache/packs/manifests/*.datapack | grep 7878 | ||||
[1] | [1] | ||||
$ mv .hg/store/00manifesttree.i.bak .hg/store/00manifesttree.i | $ mv .hg/store/00manifesttree.i.bak .hg/store/00manifesttree.i | ||||
Test incremental repack with limited revs only repacks those revs | Test incremental repack with limited revs only repacks those revs | ||||
$ rm -rf .hg/cache/packs/manifests | $ rm -rf .hg/cache/packs/manifests | ||||
$ hg repack --incremental --config treemanifest.repackstartrev=1 --config treemanifest.repackendrev=1 | $ hg repack --incremental --config treemanifest.repackstartrev=1 --config treemanifest.repackendrev=1 | ||||
$ hg debugdatapack .hg/cache/packs/manifests/*.datapack | $ hg debugdatapack .hg/cache/packs/manifests/*.datapack | ||||
.hg/cache/packs/manifests/e9093d2d887ff14457d43338fcb3994e92051853: | |||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
1832e0765de9 000000000000 89 89 | 1832e0765de9 000000000000 89 89 | ||||
Total: 89 89 (0.0% bigger) | |||||
Total: 89 89 (0.0% bigger) | |||||
dir: | dir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
23226e7a252c 000000000000 43 43 | 23226e7a252c 000000000000 43 43 | ||||
Total: 43 43 (0.0% bigger) | Total: 43 43 (0.0% bigger) |
[1] | [1] | ||||
$ mkdir subdir2 | $ mkdir subdir2 | ||||
$ echo z >> subdir2/z | $ echo z >> subdir2/z | ||||
$ hg commit -qAm "add subdir2/z" | $ hg commit -qAm "add subdir2/z" | ||||
2 trees fetched over * (glob) | 2 trees fetched over * (glob) | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | $ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx | ||||
$TESTTMP/hgcache/master/packs/manifests/4d21ecb6c95e12dcf807b793cd1c55eeed861734: | |||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bc0c2c938b92 000000000000 43 (missing) | bc0c2c938b92 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
85b359fdb09e 000000000000 49 (missing) | 85b359fdb09e 000000000000 49 (missing) | ||||
$ hg debugdatapack .hg/store/packs/manifests/*.dataidx | |||||
$ hg debugdatapack .hg/store/packs/manifests/*.dataidx | |||||
.hg/store/packs/manifests/e3876af326e0e51d1f3ea0444d2b1a7db2915763: | |||||
subdir2: | subdir2: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a64 000000000000 43 (missing) | ddb35f099a64 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
54cbf534b62b 000000000000 99 (missing) | 54cbf534b62b 000000000000 99 (missing) | ||||
Test pushing without pushrebase fails | Test pushing without pushrebase fails | ||||
$ hg push | $ hg push | ||||
pushing to ssh://user@dummy/master | pushing to ssh://user@dummy/master | ||||
searching for changes | searching for changes | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: rollback completed | remote: rollback completed |
(run 'hg update' to get a working copy) | (run 'hg update' to get a working copy) | ||||
$ ls_l $CACHEDIR/master/packs/manifests | $ ls_l $CACHEDIR/master/packs/manifests | ||||
-r--r--r-- 1146 678f597a73b2b96f2e120c84ef8a84069a250266.dataidx | -r--r--r-- 1146 678f597a73b2b96f2e120c84ef8a84069a250266.dataidx | ||||
-r--r--r-- 315 678f597a73b2b96f2e120c84ef8a84069a250266.datapack | -r--r--r-- 315 678f597a73b2b96f2e120c84ef8a84069a250266.datapack | ||||
-r--r--r-- 1224 ed1a27864c5d25f144a51961ad6e79088f2a7571.histidx | -r--r--r-- 1224 ed1a27864c5d25f144a51961ad6e79088f2a7571.histidx | ||||
-r--r--r-- 265 ed1a27864c5d25f144a51961ad6e79088f2a7571.histpack | -r--r--r-- 265 ed1a27864c5d25f144a51961ad6e79088f2a7571.histpack | ||||
$ hg debugdatapack $CACHEDIR/master/packs/manifests/678f597a73b2b96f2e120c84ef8a84069a250266 | $ hg debugdatapack $CACHEDIR/master/packs/manifests/678f597a73b2b96f2e120c84ef8a84069a250266 | ||||
$TESTTMP/hgcache/master/packs/manifests/678f597a73b2b96f2e120c84ef8a84069a250266: | |||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
bc0c2c938b92 000000000000 43 (missing) | bc0c2c938b92 000000000000 43 (missing) | ||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ddb35f099a64 000000000000 43 (missing) | ddb35f099a64 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
70f2c6726cec bc0c2c938b92 61 (missing) | 70f2c6726cec bc0c2c938b92 61 (missing) | ||||
Test that commit creates local trees | Test that commit creates local trees | ||||
$ hg up -q tip | $ hg up -q tip | ||||
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) | ||||
$ echo z >> subdir/z | $ echo z >> subdir/z | ||||
$ hg commit -qAm 'modify subdir/z' | $ hg commit -qAm 'modify subdir/z' | ||||
$ ls_l .hg/store/packs/manifests | $ ls_l .hg/store/packs/manifests | ||||
-r--r--r-- 1196 57710544ca24ac4f36682ec279959879c92a3275.histidx | -r--r--r-- 1196 57710544ca24ac4f36682ec279959879c92a3275.histidx | ||||
-r--r--r-- 183 57710544ca24ac4f36682ec279959879c92a3275.histpack | -r--r--r-- 183 57710544ca24ac4f36682ec279959879c92a3275.histpack | ||||
-r--r--r-- 1106 a7f7e084adff88a01cf76909345be1e56ee704a9.dataidx | -r--r--r-- 1106 a7f7e084adff88a01cf76909345be1e56ee704a9.dataidx | ||||
-r--r--r-- 254 a7f7e084adff88a01cf76909345be1e56ee704a9.datapack | -r--r--r-- 254 a7f7e084adff88a01cf76909345be1e56ee704a9.datapack | ||||
$ hg debugdatapack .hg/store/packs/manifests/a7f7e084adff88a01cf76909345be1e56ee704a9 | $ hg debugdatapack .hg/store/packs/manifests/a7f7e084adff88a01cf76909345be1e56ee704a9 | ||||
.hg/store/packs/manifests/a7f7e084adff88a01cf76909345be1e56ee704a9: | |||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ac728a786423 000000000000 43 (missing) | ac728a786423 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
7a911436836f 000000000000 92 (missing) | 7a911436836f 000000000000 92 (missing) | ||||
Test that manifest matchers work | Test that manifest matchers work | ||||
$ hg status --rev 1 --rev 2 -I subdir/a | $ hg status --rev 1 --rev 2 -I subdir/a | ||||
$ hg status --rev 1 --rev 2 -I subdir/z | $ hg status --rev 1 --rev 2 -I subdir/z | ||||
M subdir/z | M subdir/z | ||||
Test config validation | Test config validation | ||||
$ hg log -r . --config extensions.fastmanifest=! | $ hg log -r . --config extensions.fastmanifest=! | ||||
abort: cannot use treemanifest without fastmanifest | abort: cannot use treemanifest without fastmanifest | ||||
$ hg rebase -d 0 -s '.^' | $ hg rebase -d 0 -s '.^' | ||||
rebasing 3:6a2476258ba5 "modify subdir/y" | rebasing 3:6a2476258ba5 "modify subdir/y" | ||||
rebasing 4:f096b21e165f "modify subdir/y again" (tip) | rebasing 4:f096b21e165f "modify subdir/y again" (tip) | ||||
saved backup bundle to $TESTTMP/client/.hg/strip-backup/6a2476258ba5-a90056a1-rebase.hg (glob) | saved backup bundle to $TESTTMP/client/.hg/strip-backup/6a2476258ba5-a90056a1-rebase.hg (glob) | ||||
$ hg log -r '.^::.' -T '{manifest}\n' | $ hg log -r '.^::.' -T '{manifest}\n' | ||||
3:0d05c20bb7eb | 3:0d05c20bb7eb | ||||
4:8289b85c6a30 | 4:8289b85c6a30 | ||||
$ hg debugdatapack .hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7.datapack | $ hg debugdatapack .hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7.datapack | ||||
.hg/store/packs/manifests/5a5fb42e99986c90ac86b57d184561c44238b7b7: | |||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
a4e2f032ee0f 000000000000 43 (missing) | a4e2f032ee0f 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
0d05c20bb7eb 000000000000 92 (missing) | 0d05c20bb7eb 000000000000 92 (missing) | ||||
subdir: | subdir: | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
ad0a48a2ec1e 000000000000 43 (missing) | ad0a48a2ec1e 000000000000 43 (missing) | ||||
(empty name): | (empty name): | ||||
Node Delta Base Delta Length Blob Size | Node Delta Base Delta Length Blob Size | ||||
8289b85c6a30 000000000000 92 (missing) | 8289b85c6a30 000000000000 92 (missing) | ||||
Test treemanifest with sparse enabled | Test treemanifest with sparse enabled | ||||
$ cat >> .hg/hgrc <<EOF | $ cat >> .hg/hgrc <<EOF | ||||
> [extensions] | > [extensions] | ||||
> sparse = $TESTDIR/../hgext3rd/fbsparse.py | > sparse = $TESTDIR/../hgext3rd/fbsparse.py | ||||
> reset = $TESTDIR/../hgext3rd/reset.py | > reset = $TESTDIR/../hgext3rd/reset.py | ||||
> EOF | > EOF | ||||
$ hg sparse -I subdir | $ hg sparse -I subdir | ||||
$ hg reset '.^' | $ hg reset '.^' |