]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(svn): Add script `rdump-load`
authorOleg Broytman <phd@phdru.name>
Sat, 1 Feb 2020 09:26:38 +0000 (12:26 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 1 Feb 2020 09:26:38 +0000 (12:26 +0300)
Dump remote Subversion repository and load it into a local one
to speed up following `git-svn` operations.

svn/rdump-load [new file with mode: 0755]

diff --git a/svn/rdump-load b/svn/rdump-load
new file mode 100755 (executable)
index 0000000..75b12e6
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+if [ -z "$1" ]; then
+   echo "Usage: $0 svn_url [dir]" >&2
+   exit 1
+fi
+
+url="$1"
+
+if [ -z "$2" ]; then
+   dir="`basename $url`"
+else
+   dir="$2"
+fi
+
+if [ -z "$dir" ]; then
+   echo "Usage: $0 $url dir" >&2
+   exit 1
+fi
+
+svnrdump dump --non-interactive "$url" > "$dir".svndump &&
+svnadmin create "$dir".svn &&
+exec svnadmin load "$dir".svn < "$dir".svndump