git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/5] svn-fe: allow svnadmin instead of svnrdump in svn helper

From
Dmitry Ivankov <divanorama@gmail.com>
Date
Jul 5, 2011, 16:45 UTC
Message-ID
<1309884350-13415-3-git-send-email-divanorama@gmail.com>
In-Reply-To
<1309884350-13415-1-git-send-email-divanorama@gmail.com>

svnrdump produces the same stream as svnadmin dump. svnrdump is able to do it via any svn remote protocol while svnadmin needs access to the repository filesystem and can't produce subdirectory dumps. But svnrdump is a newer tool and may be unavailable on some systems.

Try to use svnadmin dump for file:// repository urls if there is no svnrdump in the PATH. First of all this is to be used in tests, where the repository is indeed local most of the time.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
---
 contrib/svn-fe/git-remote-svn-alpha |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/contrib/svn-fe/git-remote-svn-alpha b/contrib/svn-fe/git-remote-svn-alpha
index 61c9b07..84d841e 100755
--- a/contrib/svn-fe/git-remote-svn-alpha
+++ b/contrib/svn-fe/git-remote-svn-alpha
@@ -12,10 +12,32 @@ usage () {
 	exit 129
 }
 
+try_svnrdump () {
+	command -v svnrdump >/dev/null &&
+	echo "svnrdump dump --non-interactive --username=Guest --password= \
+		--quiet --incremental" ||
+	true
+}
+
+svnadmin_wrap () {
+	path=${1##file://} &&
+	test "z$path" != "z$1" &&
+	svnadmin dump --incremental --deltas --quiet "$path" "$2"
+}
+
+try_svnadmin () {
+	command -v svnadmin >/dev/null &&
+	echo svnadmin_wrap ||
+	true
+}
+
+SVNDUMP=""
+SVNDUMP=${SVNDUMP:-`try_svnrdump`}
+SVNDUMP=${SVNDUMP:-`try_svnadmin`}
+
 do_import () {
 	revs=$1 url=$2
-	(svnrdump dump --non-interactive --username=Guest --password= \
-		-r"$revs" "$url" --quiet | svn-fe) 3<&0 || die "FAILURE"
+	(eval "$SVNDUMP \"$url\" -r\"$revs\"" |	svn-fe) 3<&0 || die "FAILURE"
 	exec 1>&-
 }
 
-- 
1.7.3.4
Previous: Dmitry IvankovNext: Ramkumar Ramachandra
Message 3 of 12 in “remote-svn-alpha updates”
  1. 0/5 remote-svn-alpha updatesDmitry Ivankov, Jul 5, 2011
  2. 1/5 svn-fe: use svnrdump --quiet in remote-svn-alphaDmitry Ivankov, Jul 5, 2011
  3. 2/5 svn-fe: allow svnadmin instead of svnrdump in svn helperDmitry Ivankov, Jul 5, 2011
  4. Ramkumar RamachandraJul 6, 2011
  5. Dmitry IvankovJul 6, 2011
  6. Ramkumar RamachandraJul 6, 2011
  7. Jonathan NiederJul 6, 2011
  8. 3/5 svn-fe: add a test for remote-svn-alphaDmitry Ivankov, Jul 5, 2011
  9. 4/5 svn-fe: use svn-fe --no-progress in remote-svn-alphaDmitry Ivankov, Jul 5, 2011
  10. Ramkumar RamachandraJul 6, 2011
  11. Jonathan NiederJul 6, 2011
  12. 5/5 svn-fe: use proper refspec in remote-svn-alphaDmitry Ivankov, Jul 5, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.