mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
67f6d86cd7
Summary: This adds a test for hg repack --incremental handling tree packs. It fixes a few bugs that were caught in the process: 1. Since remotefilelog was being imported via it's file path, it was being loaded into the process as hgext_remotefilelog. When treemanifest loaded it into the process via 'import remotefilelog' it was being imported as 'remotefilelog'. This meant we had the same types imported into the same process with two different names, which meant 'isinstance()' checks could fail when they shouldn't (which affects incremental repacks). So we just drop the filepath. 2. We need to allow repacking local tree manifest data even if the full delta chain isn't available (since part of the delta chain may be in the cache). So we add allowincomplete to the data pack in this case. Test Plan: Ran it Reviewers: #mercurial, rmcelroy Reviewed By: rmcelroy Subscribers: rmcelroy, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4262412 Signature: t1:4262412:1480706110:45bb0a1e1b031f9cfd4658a5071bbac5df2f6543
50 lines
677 B
Bash
50 lines
677 B
Bash
${PYTHON:-python} -c 'import lz4' || exit 80
|
|
|
|
CACHEDIR=$PWD/hgcache
|
|
cat >> $HGRCPATH <<EOF
|
|
[remotefilelog]
|
|
cachepath=$CACHEDIR
|
|
debug=True
|
|
[extensions]
|
|
remotefilelog=
|
|
rebase=
|
|
mq=
|
|
[ui]
|
|
ssh=python "$TESTDIR/dummyssh"
|
|
[server]
|
|
preferuncompressed=True
|
|
[experimental]
|
|
changegroup3=True
|
|
EOF
|
|
|
|
hgcloneshallow() {
|
|
local name
|
|
local dest
|
|
orig=$1
|
|
shift
|
|
dest=$1
|
|
shift
|
|
hg clone --shallow --config remotefilelog.reponame=master $orig $dest $@
|
|
cat >> $dest/.hg/hgrc <<EOF
|
|
[remotefilelog]
|
|
reponame=master
|
|
EOF
|
|
}
|
|
|
|
hginit() {
|
|
local name
|
|
name=$1
|
|
shift
|
|
hg init $name $@
|
|
}
|
|
|
|
clearcache() {
|
|
rm -rf $CACHEDIR/*
|
|
}
|
|
|
|
mkcommit() {
|
|
echo "$1" > "$1"
|
|
hg add "$1"
|
|
hg ci -m "$1"
|
|
}
|