From 060610c572b21d00bb09ebbab664c0452c7eac9d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 8 Dec 2007 23:27:41 -0800 Subject: git-svn: replace .rev_db with a more space-efficient .rev_map format Migrations are done automatically on an as-needed basis when new revisions are to be fetched. Stale remote branches do not get migrated, yet. However, unless you set noMetadata or useSvkProps it's safe to just do: find $GIT_DIR/svn -name '.rev_db*' -print0 | xargs rm -f to purge all the old .rev_db files. The new format is a one-way migration and is NOT compatible with old versions of git-svn. This is the replacement for the rev_db format, which was too big and inefficient for large repositories with a lot of sparse history (mainly tags). The format is this: - 24 bytes for every record, * 4 bytes for the integer representing an SVN revision number * 20 bytes representing the sha1 of a git commit - No empty padding records like the old format - new records are written append-only since SVN revision numbers increase monotonically - lookups on SVN revision number are done via a binary search - Piping the file to xxd(1) -c24 is a good way of dumping it for viewing or editing, should the need ever arise. As with .rev_db, these files are disposable unless noMetadata or useSvmProps is set. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- t/t9107-git-svn-migrate.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 't/t9107-git-svn-migrate.sh') diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh index 67fdf7023f..0a41d52c7a 100755 --- a/t/t9107-git-svn-migrate.sh +++ b/t/t9107-git-svn-migrate.sh @@ -97,15 +97,19 @@ test_expect_success 'migrate --minimize on old inited layout' " grep '^:refs/remotes/git-svn' fetch.out " -test_expect_success ".rev_db auto-converted to .rev_db.UUID" " +test_expect_success ".rev_db auto-converted to .rev_map.UUID" " git-svn fetch -i trunk && - expect=$GIT_DIR/svn/trunk/.rev_db.* && + test -z \"\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\" && + expect=\"\$(ls $GIT_DIR/svn/trunk/.rev_map.*)\" && test -n \"\$expect\" && - mv \$expect $GIT_DIR/svn/trunk/.rev_db && + rev_db=\$(echo \$expect | sed -e 's,_map,_db,') && + convert_to_rev_db \$expect \$rev_db && + rm -f \$expect && + test -f \$rev_db && git-svn fetch -i trunk && - test -L $GIT_DIR/svn/trunk/.rev_db && - test -f \$expect && - cmp \$expect $GIT_DIR/svn/trunk/.rev_db + test -z \"\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\" && + test ! -e $GIT_DIR/svn/trunk/.rev_db && + test -f \$expect " test_done -- cgit v1.2.3