2019-05-28 13:12:27 +03:00
|
|
|
$ setconfig extensions.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
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
|
|
|
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
|
2016-06-06 20:04:18 +03:00
|
|
|
$ find $CACHEDIR | sort
|
|
|
|
$TESTTMP/hgcache
|
|
|
|
$TESTTMP/hgcache/master
|
|
|
|
$TESTTMP/hgcache/master/11
|
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072
|
2016-05-05 00:52:37 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/aee31534993a501858fb6dd96a065671922e7d51
|
2018-10-26 11:13:41 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/filename
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
2016-05-05 00:52:43 +03:00
|
|
|
|
2019-03-21 19:56:43 +03:00
|
|
|
$ hg repack --config "devel.print-metrics=1"
|
|
|
|
{ metrics : { filestore : { shared : { blobnum : 1, blobsize : 175}}}}
|
2016-05-05 00:52:43 +03:00
|
|
|
|
2016-06-06 20:04:18 +03:00
|
|
|
$ find $CACHEDIR | sort
|
|
|
|
$TESTTMP/hgcache
|
|
|
|
$TESTTMP/hgcache/master
|
|
|
|
$TESTTMP/hgcache/master/packs
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
2017-05-02 05:03:25 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 1074 8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.dataidx
|
2017-05-02 05:03:25 +03:00
|
|
|
-r--r--r-- 69 8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.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
|
2016-05-05 00:53:16 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-05 00:52:52 +03:00
|
|
|
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
|
2018-10-26 11:13:41 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/filename
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
2017-11-09 21:32:15 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2017-11-09 21:32:15 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
|
|
|
|
|
|
|
# First assert that with --packsonly, the loose object will be ignored:
|
|
|
|
|
2019-03-21 19:56:43 +03:00
|
|
|
$ hg repack --packsonly --config "devel.print-metrics=1"
|
2017-11-09 21:32:15 +03:00
|
|
|
|
|
|
|
$ find $CACHEDIR -type f | sort
|
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/d4a3ed9310e5bd9887e3bf779da5077efab28216
|
2018-10-26 11:13:41 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/filename
|
2017-11-09 21:32:15 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
2017-05-02 05:03:25 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
2016-05-05 00:52:52 +03:00
|
|
|
|
2018-03-16 23:45:58 +03:00
|
|
|
# Now test that --looseonly will only repack the loose file, leaving
|
|
|
|
# the old packs:
|
|
|
|
|
2019-03-21 19:56:43 +03:00
|
|
|
$ hg repack --looseonly --traceback --config "devel.print-metrics=1"
|
|
|
|
{ metrics : { filestore : { shared : { blobnum : 1, blobsize : 258}}}}
|
2018-03-16 23:45:58 +03:00
|
|
|
|
|
|
|
$ find $CACHEDIR -type f | sort
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/276d308429d0303762befa376788300f0310f90e.histpack
|
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/8e25dec685d5e0bb1f1b39df3acebda0e0d75c6e.datapack
|
|
|
|
$TESTTMP/hgcache/master/packs/c7dbbb9c994bc2491614201a8004dc59d8b3136b.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/c7dbbb9c994bc2491614201a8004dc59d8b3136b.datapack
|
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
|
|
|
$TESTTMP/hgcache/repos
|
|
|
|
|
|
|
|
# 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
|
|
|
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/78c70662acc13eec7fa17c74b8d324db0bd3620e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/78c70662acc13eec7fa17c74b8d324db0bd3620e.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
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
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/78c70662acc13eec7fa17c74b8d324db0bd3620e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/78c70662acc13eec7fa17c74b8d324db0bd3620e.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
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
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1bb2e6237e035c8f8ef508e281f1ce075bc6db72
|
2018-10-26 11:13:41 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/filename
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/78c70662acc13eec7fa17c74b8d324db0bd3620e.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/78c70662acc13eec7fa17c74b8d324db0bd3620e.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
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
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/31644f0145978fff5de678a97e3e302e9d21931d.dataidx
|
|
|
|
$TESTTMP/hgcache/master/packs/31644f0145978fff5de678a97e3e302e9d21931d.datapack
|
2017-11-30 01:57:10 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
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-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/31644f0145978fff5de678a97e3e302e9d21931d:
|
2017-11-06 08:45:40 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
1bb2e6237e03 000000000000 8 8
|
2019-08-13 20:46:19 +03:00
|
|
|
aee31534993a 000000000000 4 4
|
|
|
|
d4a3ed9310e5 000000000000 6 6
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2019-08-13 20:46:19 +03:00
|
|
|
Total: 18 18 (0.0% bigger)
|
2017-04-27 05:50:36 +03:00
|
|
|
$ hg debugdatapack --long $TESTTMP/hgcache/master/packs/*.datapack
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/31644f0145978fff5de678a97e3e302e9d21931d:
|
2017-11-06 08:45:40 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
1bb2e6237e035c8f8ef508e281f1ce075bc6db72 0000000000000000000000000000000000000000 8 8
|
2019-08-13 20:46:19 +03:00
|
|
|
aee31534993a501858fb6dd96a065671922e7d51 0000000000000000000000000000000000000000 4 4
|
|
|
|
d4a3ed9310e5bd9887e3bf779da5077efab28216 0000000000000000000000000000000000000000 6 6
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2019-08-13 20:46:19 +03:00
|
|
|
Total: 18 18 (0.0% bigger)
|
2018-11-07 01:03:38 +03:00
|
|
|
$ hg debugdatapack $TESTTMP/hgcache/master/packs/*.datapack --node-delta d4a3ed9310e5bd9887e3bf779da5077efab28216
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/31644f0145978fff5de678a97e3e302e9d21931d:
|
2016-07-29 03:15:21 +03:00
|
|
|
|
|
|
|
x
|
|
|
|
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
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
$ 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'
|
|
|
|
$ hg revert -r 0 x
|
|
|
|
$ 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
|
|
|
|
2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
$ hg repack
|
|
|
|
$ ls $TESTTMP/hgcache/master/packs
|
2019-08-13 20:46:19 +03:00
|
|
|
1b9924fa45d3206101b16b754571b44fef1b0914.dataidx
|
|
|
|
1b9924fa45d3206101b16b754571b44fef1b0914.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
|
2017-04-20 07:14:04 +03:00
|
|
|
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
|
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
|
2017-04-20 07:14:04 +03:00
|
|
|
saved backup bundle to $TESTTMP/master/.hg/strip-backup/609547eda446-b26b56a8-backup.hg (glob)
|
2016-07-08 01:58:47 +03:00
|
|
|
|
|
|
|
$ 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-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/055c02949317b8507cdb7aaf2e00cc00fd0c5716:
|
2017-11-06 08:45:40 +03:00
|
|
|
x:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
1bb2e6237e03 000000000000 8 8
|
2019-08-13 20:46:19 +03:00
|
|
|
aee31534993a 000000000000 4 4
|
|
|
|
d4a3ed9310e5 000000000000 6 6
|
2016-05-16 20:59:09 +03:00
|
|
|
|
2019-08-13 20:46:19 +03:00
|
|
|
Total: 18 18 (0.0% bigger)
|
2017-11-06 08:45:40 +03:00
|
|
|
y:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
577959738234 000000000000 70 8
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2017-11-06 08:45:40 +03:00
|
|
|
Total: 70 8 (775.0% bigger)
|
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
|
|
|
|
$ hg prefetch -r 0
|
2019-02-06 21:23:06 +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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
|
2016-05-20 19:31:25 +03:00
|
|
|
|
|
|
|
3 gen1 packs, 1 gen0 pack - packs 3 gen1 into 1
|
|
|
|
$ hg prefetch -r 1
|
2019-02-06 21:23:06 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-20 19:31:25 +03:00
|
|
|
$ hg prefetch -r 2
|
2019-02-06 21:23:06 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-20 19:31:25 +03:00
|
|
|
$ hg prefetch -r 3
|
2019-02-06 21:23:06 +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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
|
|
|
-r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
|
|
|
-r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack
|
|
|
|
-r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
|
2017-12-05 22:55:39 +03:00
|
|
|
|
|
|
|
For the data packs, setting the limit for the repackmaxpacksize to be 64 such
|
|
|
|
that data pack with size 65 is more than the limit. This effectively ensures
|
|
|
|
that no generation has 3 packs and therefore, no packs are chosen for the
|
|
|
|
incremental repacking. As for the history packs, setting repackmaxpacksize to be
|
|
|
|
0 which should always result in no repacking.
|
|
|
|
$ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=64 \
|
|
|
|
> --config remotefilelog.history.repackmaxpacksize=0
|
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
|
2019-08-13 20:46:19 +03:00
|
|
|
-r--r--r-- 261 c155d24742424ff6f6eec6c54d232c3f550b6922.datapack
|
2017-12-05 22:55:39 +03:00
|
|
|
$ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
|
|
|
|
-r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
|
|
|
|
|
|
|
Setting limit for the repackmaxpacksize to be the size of the biggest pack file
|
|
|
|
which ensures that it is effectively ignored in the incremental repacking.
|
|
|
|
$ hg repack --incremental --config remotefilelog.data.repackmaxpacksize=65 \
|
|
|
|
> --config remotefilelog.history.repackmaxpacksize=336
|
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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
2016-05-20 19:31:25 +03:00
|
|
|
|
|
|
|
1 gen3 pack, 1 gen0 pack - does nothing
|
|
|
|
$ 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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.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
|
|
|
|
$ hg prefetch -r 0
|
2019-02-06 21:23:06 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-20 19:31:28 +03:00
|
|
|
$ hg prefetch -r 1
|
2019-02-06 21:23:06 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-20 19:31:28 +03:00
|
|
|
$ hg prefetch -r 2
|
2019-02-06 21:23:06 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-05-20 19:31:28 +03:00
|
|
|
$ hg prefetch -r 3
|
2019-02-06 21:23:06 +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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 254 077e7ce5dfe862dc40cc8f3c9742d96a056865f2.histpack
|
|
|
|
-r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
|
|
|
-r--r--r-- 172 276d308429d0303762befa376788300f0310f90e.histpack
|
|
|
|
-r--r--r-- 90 c3399b56e035f73c3295276ed098235a08a0ed8c.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
|
2017-05-03 20:19:45 +03:00
|
|
|
-r--r--r-- 336 094b530486dad4427a0faf6bcbc031571b99ca24.histpack
|
2016-06-03 19:45:58 +03:00
|
|
|
|
|
|
|
Test environment variable resolution
|
|
|
|
$ CACHEPATH=$TESTTMP/envcache hg prefetch --config 'remotefilelog.cachepath=$CACHEPATH'
|
2019-02-06 21:23:06 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2016-06-03 19:45:58 +03:00
|
|
|
$ find $TESTTMP/envcache | sort
|
|
|
|
$TESTTMP/envcache
|
|
|
|
$TESTTMP/envcache/master
|
|
|
|
$TESTTMP/envcache/master/packs
|
2019-04-09 20:31:26 +03:00
|
|
|
$TESTTMP/envcache/master/packs/2021b67b6df3cec03f6ca46b83a3e69a67b204ec.dataidx
|
|
|
|
$TESTTMP/envcache/master/packs/2021b67b6df3cec03f6ca46b83a3e69a67b204ec.datapack
|
2017-05-03 20:19:45 +03:00
|
|
|
$TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histidx
|
|
|
|
$TESTTMP/envcache/master/packs/dcebd8e8d4d97ee88e40dd8f92d8678c10e1a3ad.histpack
|
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
|
|
|
|
|
|
|
Test huge pack cleanup using different values of packs.maxpacksize:
|
|
|
|
$ hg repack --incremental --debug
|
|
|
|
$ hg repack --incremental --debug --config packs.maxpacksize=512
|
2019-09-10 23:07:07 +03:00
|
|
|
removing oversize packfile $TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922.datapack (261 bytes)
|
|
|
|
removing oversize packfile $TESTTMP/hgcache/master/packs/c155d24742424ff6f6eec6c54d232c3f550b6922.dataidx (1.17 KB)
|
2018-08-20 14:21:50 +03:00
|
|
|
|
|
|
|
# Test repacking loose files
|
|
|
|
$ findfilessorted .hg/store/data
|
|
|
|
$ findfilessorted .hg/store/packs
|
|
|
|
|
|
|
|
# new loose file is created
|
|
|
|
$ echo "new commit" > new_file
|
|
|
|
$ hg commit -qAm "one more node"
|
2019-09-10 23:07:07 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over 0.00s
|
2018-08-20 14:21:50 +03:00
|
|
|
$ findfilessorted .hg/store/data
|
|
|
|
|
|
|
|
# repacking only loose files
|
|
|
|
$ hg repack --looseonly
|
|
|
|
$ findfilessorted .hg/store/packs
|
2019-09-10 23:07:07 +03:00
|
|
|
.hg/store/packs/114243ab99c9697960e23423df9d98f259a0159d.histidx
|
|
|
|
.hg/store/packs/114243ab99c9697960e23423df9d98f259a0159d.histpack
|
|
|
|
.hg/store/packs/6fdfb86776d8d88be3b98aa72ae1c06ca54765f2.dataidx
|
|
|
|
.hg/store/packs/6fdfb86776d8d88be3b98aa72ae1c06ca54765f2.datapack
|
2018-08-20 14:21:50 +03:00
|
|
|
|
|
|
|
# check that loose files have been removed
|
|
|
|
$ findfilessorted .hg/store/data
|
|
|
|
|
|
|
|
# repacking all
|
|
|
|
$ hg repack
|
|
|
|
$ findfilessorted .hg/store/packs
|
2019-09-10 23:07:07 +03:00
|
|
|
.hg/store/packs/114243ab99c9697960e23423df9d98f259a0159d.histidx
|
|
|
|
.hg/store/packs/114243ab99c9697960e23423df9d98f259a0159d.histpack
|
|
|
|
.hg/store/packs/6fdfb86776d8d88be3b98aa72ae1c06ca54765f2.dataidx
|
|
|
|
.hg/store/packs/6fdfb86776d8d88be3b98aa72ae1c06ca54765f2.datapack
|
2018-08-20 14:21:50 +03:00
|
|
|
|
2018-10-26 11:13:42 +03:00
|
|
|
# incremental repacking with a maxpacksize setting doesn't delete local data even if the pack files are large
|
|
|
|
$ hg repack --incremental --debug --config packs.maxpacksize=1
|
2019-09-10 23:07:07 +03:00
|
|
|
removing oversize packfile $TESTTMP/hgcache/master/packs/2021b67b6df3cec03f6ca46b83a3e69a67b204ec.datapack (130 bytes)
|
|
|
|
removing oversize packfile $TESTTMP/hgcache/master/packs/2021b67b6df3cec03f6ca46b83a3e69a67b204ec.dataidx (1.05 KB)
|
2018-10-26 11:13:42 +03:00
|
|
|
|
2018-08-20 14:21:50 +03:00
|
|
|
# check the commit data
|
|
|
|
$ hg cat -r . new_file
|
|
|
|
new commit
|
|
|
|
|
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
|
2019-01-15 01:49:34 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/28c4bd4f9174a2c5f750bd5612d53e3212e0aaf9.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/28c4bd4f9174a2c5f750bd5612d53e3212e0aaf9.histpack
|
2019-01-15 01:49:34 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/foo.datapack-tmp
|
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|
|
|
|
$ hg repack
|
|
|
|
$ find $CACHEDIR -type f | sort
|
2019-08-13 20:46:19 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/28c4bd4f9174a2c5f750bd5612d53e3212e0aaf9.histidx
|
|
|
|
$TESTTMP/hgcache/master/packs/28c4bd4f9174a2c5f750bd5612d53e3212e0aaf9.histpack
|
2019-01-15 01:49:34 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/repacklock
|