0

我使用 svnadmin 转储/加载周期将存储库从服务器 1 迁移到服务器 2,但我只是转储了最新的 100 个版本(600~700)。我发现新存储库的修订版是从 1 到 100,而不是从 600 到 700。这是问题所在,在重新定位工作副本后,我对其进行了更新,然后出现“No such revision 700”错误。似乎是新的存储库版本错误?

有什么建议么?

4

1 回答 1

1

在加载转储之前,您似乎需要为您的 SVN 存储库生成空的填充修订:

svnadmin load mynewrepo < repo.dump然而,当它被加载回一个新的存储库(我创建了一个小脚本(svn-generate-empty-revisions)来创建许多空修订。

在使用中,将其输出拼接到 SVN 转储的开头是最有用的,例如:

svnadmin dump -r 1234:HEAD /path/to/repo > repo.dump
# Extract the first few lines of the dump, which contain metadata
head -n 4 repo.dump > repo-padded.dump
# Splice in some empty "padding" revisions to preserve revision numbering
# Note that the first revision is 1234, so we want 1233 empty revisions at start
./svn-generate-empty-revisions.sh 1233 >> repo-padded.dump
# Add the rest of the original repository dump to the file
tail -n +4 repo.dump >> repo-padded.dump

svn-generate-empty-revisions脚本本身:

#!/bin/bash
# Generate a number of empty revisions, for incorporation into an SVN dump file
# 2011 Tim Jackson <tim@timj.co.uk>

if [ -z "$1" ]; then
    echo "Usage: svn-generate-empty-revisions.sh NUMREVISIONS [TIMESTAMP]"
    exit 1
fi

timestamp=$(date +%Y-%m-%dT%H:%M:%S.000000Z)
if [ ! -z "$2" ]; then
    timestamp=$2
fi

for i in $(seq 1 $1); do
cat <<EOF
Revision-number: $i
Prop-content-length: 112
Content-length: 112

K 7
svn:log
V 38
This is an empty revision for padding.
K 8
svn:date
V 27
$timestamp
PROPS-END

EOF
done
于 2015-02-09T17:06:33.850 回答