0

I migrated the repository from server 1 to server 2 with svnadmin dump/load cycle, but I just dumped the latest 100 reversion(600~700). I found that the new repository's revision was from 1 to 100 instead of from 600 to 700. Here is the problem, after relocating the working copy, I update it and then I get "No such revision 700" error. It seems like the new repository version error?

Any suggestions?

world000
  • 1,267
  • 1
  • 8
  • 13

1 Answers1

1

It seems that you need to generate empty padding revisions for your SVN repo before loading dump:

However, when this is loaded back into a new repository (svnadmin load mynewrepo < repo.dump), the revisions are renumbered starting at 1, so that what was revision 1234 becomes revision 1. This is undesirable, as I have existing bugs and changelogs referring to SVN revision numbers, so I created a small script (svn-generate-empty-revisions) to create a number of empty revisions.

In use, it’s most useful to splice its output into the start of an SVN dump, for example:

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 script itself:

#!/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
beatcracker
  • 6,714
  • 1
  • 18
  • 41