2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2017-02-10 05:02:52 +03:00
|
|
|
|
2016-05-05 00:52:37 +03:00
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
|
|
|
|
$ hginit master
|
|
|
|
$ cd master
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [remotefilelog]
|
|
|
|
> server=True
|
|
|
|
> serverexpiration=-1
|
|
|
|
> EOF
|
|
|
|
$ echo x > x
|
|
|
|
$ hg commit -qAm x
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -qAm x2
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master shallow -q
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) (?)
|
2016-05-05 00:52:37 +03:00
|
|
|
|
2017-08-16 23:21:31 +03:00
|
|
|
# Set the prefetchdays config to zero so that all commits are prefetched
|
|
|
|
# no matter what their creation date is.
|
|
|
|
$ cd shallow
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [remotefilelog]
|
2018-08-20 14:21:50 +03:00
|
|
|
> localdatarepack=True
|
2017-08-16 23:21:31 +03:00
|
|
|
> prefetchdays=0
|
|
|
|
> EOF
|
|
|
|
$ cd ..
|
|
|
|
|
2016-05-05 00:52:37 +03:00
|
|
|
# Test that repack cleans up the old files and creates new packs
|
2019-03-21 19:56:43 +03:00
|
|
|
# metrics should show the total size and counf of the loose files
|
2016-05-05 00:52:37 +03:00
|
|
|
|
|
|
|
$ cd shallow
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs | sort
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
|
|
|
$TESTTMP/hgcache/master/packs/887690f1138ae5b99c50d754ed02262874bf8ecb.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/887690f1138ae5b99c50d754ed02262874bf8ecb.datapack
|
2016-05-05 00:52:43 +03:00
|
|
|
|
2019-03-21 19:56:43 +03:00
|
|
|
$ hg repack --config "devel.print-metrics=1"
|
2016-05-05 00:52:43 +03:00
|
|
|
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs | sort
|
2016-06-06 20:04:18 +03:00
|
|
|
$TESTTMP/hgcache/master/packs
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/887690f1138ae5b99c50d754ed02262874bf8ecb.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/887690f1138ae5b99c50d754ed02262874bf8ecb.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-05 00:52:37 +03:00
|
|
|
|
2016-05-05 00:53:07 +03:00
|
|
|
# Test that the packs are readonly
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $CACHEDIR/master/packs
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 1145 276d308429d0303762befa376788300f0310f90e.histidx
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
-r--r--r-- 1074 887690f1138ae5b99c50d754ed02262874bf8ecb.dataidx
|
|
|
|
-r--r--r-- 65 887690f1138ae5b99c50d754ed02262874bf8ecb.datapack
|
2019-07-09 03:44:32 +03:00
|
|
|
-rw-rw-r-- 0 repacklock
|
2016-05-05 00:53:07 +03:00
|
|
|
|
2016-05-05 00:52:37 +03:00
|
|
|
# Test that the data in the new packs is accessible
|
|
|
|
$ hg cat -r . x
|
|
|
|
x
|
|
|
|
x
|
2016-05-05 00:52:52 +03:00
|
|
|
|
|
|
|
# Test that adding new data and repacking it results in the loose data and the
|
|
|
|
# old packs being combined.
|
|
|
|
|
|
|
|
$ cd ../master
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -m x3
|
|
|
|
$ cd ../shallow
|
|
|
|
$ hg pull -q
|
|
|
|
$ hg up -q tip
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2016-05-05 00:52:52 +03:00
|
|
|
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/384bdd4f40c2a4fc8f60ab4612381b9052ebe917.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/384bdd4f40c2a4fc8f60ab4612381b9052ebe917.datapack
|
|
|
|
$TESTTMP/hgcache/master/packs/887690f1138ae5b99c50d754ed02262874bf8ecb.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/887690f1138ae5b99c50d754ed02262874bf8ecb.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2017-11-09 21:32:15 +03:00
|
|
|
|
2018-03-16 23:45:58 +03:00
|
|
|
# A full repack creates the optimal packing:
|
|
|
|
|
2019-03-21 19:56:43 +03:00
|
|
|
$ hg repack --traceback --config "devel.print-metrics=1"
|
2016-05-05 00:52:52 +03:00
|
|
|
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/fe74acc023664cd7eda12330d321b4a2423cc4f8.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/fe74acc023664cd7eda12330d321b4a2423cc4f8.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-05 00:52:52 +03:00
|
|
|
|
|
|
|
# Verify all the file data is still available
|
|
|
|
$ hg cat -r . x
|
|
|
|
x
|
|
|
|
x
|
|
|
|
x
|
|
|
|
$ hg cat -r '.^' x
|
|
|
|
x
|
|
|
|
x
|
2016-05-05 00:53:10 +03:00
|
|
|
|
2019-03-21 19:56:43 +03:00
|
|
|
|
2016-05-05 00:53:10 +03:00
|
|
|
# Test that repacking again without new data does not delete the pack files
|
|
|
|
# and did not change the pack names
|
|
|
|
$ hg repack
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/fe74acc023664cd7eda12330d321b4a2423cc4f8.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/fe74acc023664cd7eda12330d321b4a2423cc4f8.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-05 00:53:19 +03:00
|
|
|
|
|
|
|
# Run two repacks at once
|
2016-06-20 05:05:55 +03:00
|
|
|
$ hg repack --config "hooks.prerepack=sleep 3" &
|
|
|
|
$ sleep 1
|
2016-05-05 00:53:19 +03:00
|
|
|
$ hg repack
|
2017-12-13 03:16:53 +03:00
|
|
|
skipping repack - another repack is already running
|
2016-05-20 19:31:28 +03:00
|
|
|
$ hg debugwaitonrepack >/dev/null 2>&1
|
2016-05-05 00:53:23 +03:00
|
|
|
|
|
|
|
# Run repack in the background
|
|
|
|
$ cd ../master
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -m x4
|
|
|
|
$ cd ../shallow
|
|
|
|
$ hg pull -q
|
|
|
|
$ hg up -q tip
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
|
|
|
$TESTTMP/hgcache/master/packs/20e1a91049a48630732a9b2ceaf4fa783a3af6c5.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/20e1a91049a48630732a9b2ceaf4fa783a3af6c5.datapack
|
|
|
|
$TESTTMP/hgcache/master/packs/fe74acc023664cd7eda12330d321b4a2423cc4f8.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/fe74acc023664cd7eda12330d321b4a2423cc4f8.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2017-05-03 20:19:45 +03:00
|
|
|
|
2016-05-05 00:53:23 +03:00
|
|
|
$ hg repack --background
|
2016-05-20 19:31:22 +03:00
|
|
|
(running background repack)
|
2016-05-20 19:31:28 +03:00
|
|
|
$ sleep 0.5
|
|
|
|
$ hg debugwaitonrepack >/dev/null 2>&1
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/d16759ce28060a639a43d64b9a243e4f86b26a46.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/d16759ce28060a639a43d64b9a243e4f86b26a46.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-16 20:59:09 +03:00
|
|
|
|
2016-05-16 20:59:09 +03:00
|
|
|
# Test debug commands
|
|
|
|
|
2017-04-27 05:50:36 +03:00
|
|
|
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/d16759ce28060a639a43d64b9a243e4f86b26a46:
|
2017-11-06 08:45:40 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-17 00:19:36 +03:00
|
|
|
1bb2e6237e03 000000000000 8 (missing)
|
|
|
|
d4a3ed9310e5 000000000000 6 (missing)
|
|
|
|
aee31534993a 000000000000 4 (missing)
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2017-04-27 05:50:36 +03:00
|
|
|
$ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/d16759ce28060a639a43d64b9a243e4f86b26a46:
|
2017-11-06 08:45:40 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-17 00:19:36 +03:00
|
|
|
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 (missing)
|
|
|
|
d4a3ed9310e5bd9887e3bf779da5077efab28216 0000000000000000000000000000000000000000 6 (missing)
|
|
|
|
aee31534993a501858fb6dd96a065671922e7d51 0000000000000000000000000000000000000000 4 (missing)
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2018-11-07 01:03:38 +03:00
|
|
|
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node-delta d4a3ed9310e5bd9887e3bf779da5077efab28216
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/d16759ce28060a639a43d64b9a243e4f86b26a46:
|
2016-07-29 03:15:21 +03:00
|
|
|
|
2020-05-07 21:01:42 +03:00
|
|
|
|
2016-07-29 03:15:21 +03:00
|
|
|
Node Delta Base Delta SHA1 Delta Length
|
2019-08-13 20:46:19 +03:00
|
|
|
d4a3ed9310e5bd9887e3bf779da5077efab28216 0000000000000000000000000000000000000000 86e1b96c0167d9d28fe9bd21ea208d21033c869c 6
|
2017-05-03 20:19:45 +03:00
|
|
|
$ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
|
2016-05-16 20:59:09 +03:00
|
|
|
|
|
|
|
x
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
|
|
|
1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
|
|
|
|
d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
|
|
|
|
aee31534993a 1406e7411862 000000000000 a89d614e2364
|
|
|
|
1406e7411862 000000000000 000000000000 b292c1e3311f
|
|
|
|
|
2016-05-16 20:59:09 +03:00
|
|
|
# Test copy tracing from a pack
|
|
|
|
$ cd ../master
|
|
|
|
$ hg mv x y
|
|
|
|
$ hg commit -m 'move x to y'
|
|
|
|
$ cd ../shallow
|
|
|
|
$ hg pull -q
|
|
|
|
$ hg up -q tip
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2016-05-16 20:59:09 +03:00
|
|
|
$ hg repack
|
|
|
|
$ hg log -f y -T '{desc}\n'
|
|
|
|
move x to y
|
|
|
|
x4
|
|
|
|
x3
|
|
|
|
x2
|
|
|
|
x
|
2016-05-16 20:59:09 +03:00
|
|
|
|
2016-07-08 01:58:47 +03:00
|
|
|
# Test copy trace across rename and back
|
2016-11-30 23:58:08 +03:00
|
|
|
$ cp -R $TESTTMP/hgcache/master/packs $TESTTMP/backuppacks
|
2016-07-08 01:58:47 +03:00
|
|
|
$ cd ../master
|
|
|
|
$ hg mv y x
|
|
|
|
$ hg commit -m 'move y back to x'
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg revert -r b292c1e3311fd0f13ae83b409caae4a6d1fb348c x
|
2016-07-08 01:58:47 +03:00
|
|
|
$ mv x y
|
|
|
|
$ hg add y
|
2017-04-20 07:14:04 +03:00
|
|
|
$ echo >> y
|
2016-07-08 01:58:47 +03:00
|
|
|
$ hg revert x
|
|
|
|
$ hg commit -m 'add y back without metadata'
|
|
|
|
$ cd ../shallow
|
|
|
|
$ hg pull -q
|
|
|
|
$ hg up -q tip
|
2020-01-09 18:44:55 +03:00
|
|
|
2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over * (glob) (?)
|
2016-07-08 01:58:47 +03:00
|
|
|
$ hg repack
|
|
|
|
$ ls $TESTTMP/hgcache/master/packs
|
2019-10-17 00:19:36 +03:00
|
|
|
73d5a02cfb63aa0417c03a9cb2ba8504bb6f312b.dataidx
|
|
|
|
73d5a02cfb63aa0417c03a9cb2ba8504bb6f312b.datapack
|
2017-05-03 20:19:45 +03:00
|
|
|
ebbd7411e00456c0eec8d1150a77e2b3ef490f3f.histidx
|
|
|
|
ebbd7411e00456c0eec8d1150a77e2b3ef490f3f.histpack
|
2017-11-30 01:57:10 +03:00
|
|
|
repacklock
|
2017-04-20 07:14:04 +03:00
|
|
|
$ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx
|
2016-07-08 01:58:47 +03:00
|
|
|
|
|
|
|
x
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
|
|
|
cd410a44d584 577959738234 000000000000 609547eda446 y
|
|
|
|
1bb2e6237e03 d4a3ed9310e5 000000000000 0b03bbc9e1e7
|
|
|
|
d4a3ed9310e5 aee31534993a 000000000000 421535db10b6
|
|
|
|
aee31534993a 1406e7411862 000000000000 a89d614e2364
|
|
|
|
1406e7411862 000000000000 000000000000 b292c1e3311f
|
|
|
|
|
|
|
|
y
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
|
|
|
577959738234 1bb2e6237e03 000000000000 c7faf2fc439a x
|
2017-04-27 20:44:34 +03:00
|
|
|
21f46f2721e7 000000000000 000000000000 d6868642b790
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg debugstrip -r '.^'
|
2016-07-08 01:58:47 +03:00
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg -R ../master debugstrip -r '.^'
|
2016-07-08 01:58:47 +03:00
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ rm -rf $TESTTMP/hgcache/master/packs
|
2016-11-30 23:58:08 +03:00
|
|
|
$ cp -R $TESTTMP/backuppacks $TESTTMP/hgcache/master/packs
|
2016-07-08 01:58:47 +03:00
|
|
|
|
2016-05-16 20:59:09 +03:00
|
|
|
# Test repacking datapack without history
|
|
|
|
$ rm -rf $CACHEDIR/master/packs/*hist*
|
|
|
|
$ hg repack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack
|
2019-10-17 00:19:36 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/4fbad80d995df2af342caa2aea3480958a5601ec:
|
|
|
|
y:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-17 00:19:36 +03:00
|
|
|
577959738234 000000000000 70 (missing)
|
2016-05-16 20:59:09 +03:00
|
|
|
|
2019-10-17 00:19:36 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-17 00:19:36 +03:00
|
|
|
1bb2e6237e03 000000000000 8 (missing)
|
|
|
|
d4a3ed9310e5 000000000000 6 (missing)
|
|
|
|
aee31534993a 000000000000 4 (missing)
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2016-05-16 20:59:09 +03:00
|
|
|
|
|
|
|
$ hg cat -r ".^" x
|
|
|
|
x
|
|
|
|
x
|
|
|
|
x
|
|
|
|
x
|
2016-05-20 19:31:25 +03:00
|
|
|
|
|
|
|
Incremental repack
|
|
|
|
$ rm -rf $CACHEDIR/master/packs/*
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [remotefilelog]
|
|
|
|
> data.generations=60
|
|
|
|
> 150
|
|
|
|
> fetchpacks=True
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Single pack - repack does nothing
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r b292c1e3311fd0f13ae83b409caae4a6d1fb348c
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2018-12-16 03:23:20 +03:00
|
|
|
-r--r--r-- 63 2d66e09c3bf8a000428af1630d978127182e496e.datapack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
2020-10-09 23:50:58 +03:00
|
|
|
-r--r--r-- 90 b6b3154993cad4c2f5335bd43d96da57dc942de0.histpack
|
2016-05-20 19:31:25 +03:00
|
|
|
$ hg repack --incremental
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2018-12-16 03:23:20 +03:00
|
|
|
-r--r--r-- 63 2d66e09c3bf8a000428af1630d978127182e496e.datapack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
2020-10-09 23:50:58 +03:00
|
|
|
-r--r--r-- 90 b6b3154993cad4c2f5335bd43d96da57dc942de0.histpack
|
2016-05-20 19:31:25 +03:00
|
|
|
|
|
|
|
3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r 'desc(x2)'
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r 'desc(x3)'
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r 'desc(x4)'
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2018-12-16 03:23:20 +03:00
|
|
|
-r--r--r-- 69 20e1a91049a48630732a9b2ceaf4fa783a3af6c5.datapack
|
|
|
|
-r--r--r-- 63 2d66e09c3bf8a000428af1630d978127182e496e.datapack
|
|
|
|
-r--r--r-- 67 384bdd4f40c2a4fc8f60ab4612381b9052ebe917.datapack
|
|
|
|
-r--r--r-- 65 887690f1138ae5b99c50d754ed02262874bf8ecb.datapack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
2020-10-09 23:50:58 +03:00
|
|
|
-r--r--r-- 336 5d6262f212403636b919bd00c1c4e605e4838f64.histpack
|
|
|
|
-r--r--r-- 90 b6b3154993cad4c2f5335bd43d96da57dc942de0.histpack
|
|
|
|
-r--r--r-- 172 bd49a1b041fe7e7ef5db58dc7b0b0cc60a8644fd.histpack
|
|
|
|
-r--r--r-- 254 bde16a8c8d6731dc786b491225897d416f75b55f.histpack
|
2017-12-05 22:55:39 +03:00
|
|
|
|
2016-05-20 19:31:25 +03:00
|
|
|
$ hg repack --incremental
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2019-08-13 20:46:19 +03:00
|
|
|
-r--r--r-- 261 c155d24742424ff6f6eec6c54d232c3f550b6922.datapack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
2020-10-09 23:50:58 +03:00
|
|
|
-r--r--r-- 336 5d6262f212403636b919bd00c1c4e605e4838f64.histpack
|
2016-05-20 19:31:28 +03:00
|
|
|
|
|
|
|
Pull should run background repack
|
2016-06-01 20:06:35 +03:00
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [remotefilelog]
|
|
|
|
> backgroundrepack=True
|
|
|
|
> EOF
|
2016-05-20 19:31:28 +03:00
|
|
|
$ clearcache
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r b292c1e3311fd0f13ae83b409caae4a6d1fb348c
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r 'desc(x2)'
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r 'desc(x3)'
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg prefetch -r 'desc(x4)'
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2018-12-16 03:23:20 +03:00
|
|
|
-r--r--r-- 69 20e1a91049a48630732a9b2ceaf4fa783a3af6c5.datapack
|
|
|
|
-r--r--r-- 63 2d66e09c3bf8a000428af1630d978127182e496e.datapack
|
|
|
|
-r--r--r-- 67 384bdd4f40c2a4fc8f60ab4612381b9052ebe917.datapack
|
|
|
|
-r--r--r-- 65 887690f1138ae5b99c50d754ed02262874bf8ecb.datapack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
2020-10-09 23:50:58 +03:00
|
|
|
-r--r--r-- 336 5d6262f212403636b919bd00c1c4e605e4838f64.histpack
|
|
|
|
-r--r--r-- 90 b6b3154993cad4c2f5335bd43d96da57dc942de0.histpack
|
|
|
|
-r--r--r-- 172 bd49a1b041fe7e7ef5db58dc7b0b0cc60a8644fd.histpack
|
|
|
|
-r--r--r-- 254 bde16a8c8d6731dc786b491225897d416f75b55f.histpack
|
2016-05-20 19:31:31 +03:00
|
|
|
|
2016-05-20 19:31:28 +03:00
|
|
|
$ hg pull
|
|
|
|
pulling from ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
(running background incremental repack)
|
|
|
|
$ sleep 0.5
|
|
|
|
$ hg debugwaitonrepack >/dev/null 2>&1
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2019-08-13 20:46:19 +03:00
|
|
|
-r--r--r-- 261 c155d24742424ff6f6eec6c54d232c3f550b6922.datapack
|
2017-04-27 05:50:36 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
2020-10-09 23:50:58 +03:00
|
|
|
-r--r--r-- 336 5d6262f212403636b919bd00c1c4e605e4838f64.histpack
|
2016-06-03 19:45:58 +03:00
|
|
|
|
|
|
|
Test environment variable resolution
|
|
|
|
$ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
|
2020-07-02 23:11:57 +03:00
|
|
|
$ [ -d $TESTTMP/envcache/master/packs ]
|
2016-06-07 01:07:27 +03:00
|
|
|
|
2017-05-22 03:09:08 +03:00
|
|
|
Test limiting the max delta chain length
|
|
|
|
$ hg repack --config packs.maxchainlen=1
|
|
|
|
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.dataidx
|
2019-09-10 23:07:07 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922:
|
2019-08-13 20:46:19 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-08-13 20:46:19 +03:00
|
|
|
1406e7411862 000000000000 2 (missing)
|
|
|
|
aee31534993a 000000000000 4 (missing)
|
|
|
|
d4a3ed9310e5 000000000000 6 (missing)
|
|
|
|
1bb2e6237e03 000000000000 8 (missing)
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2017-11-30 23:46:54 +03:00
|
|
|
|
2019-01-15 01:49:34 +03:00
|
|
|
# Verify that temporary datapacks are removed
|
2019-01-15 20:41:07 +03:00
|
|
|
$ touch -a -t 201901010000 $TESTTMP/hgcache/master/packs/foo.datapack-tmp
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2020-10-09 23:50:58 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/5d6262f212403636b919bd00c1c4e605e4838f64.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/5d6262f212403636b919bd00c1c4e605e4838f64.histpack
|
2020-01-15 00:44:39 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922.datapack
|
2019-01-15 01:49:34 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/foo.datapack-tmp
|
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
|
|
|
$ hg repack
|
2020-03-27 04:59:47 +03:00
|
|
|
$ find $CACHEDIR/master/packs -type f | sort
|
2020-10-09 23:50:58 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/5d6262f212403636b919bd00c1c4e605e4838f64.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/5d6262f212403636b919bd00c1c4e605e4838f64.histpack
|
2020-01-15 00:44:39 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922.datapack
|
2019-01-15 01:49:34 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|