aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-02-11 01:40:17 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-02-11 01:40:17 +0000
commita47ac614f60b75138803069e0a63726b3d492a2d (patch)
tree1db8975c1491a0c25752164652f014c7fe19d827
parent0570a4adf898533ec592c7f12e4ca3fcafc6f85c (diff)
downloadpaludis-a47ac614f60b75138803069e0a63726b3d492a2d.tar.gz
paludis-a47ac614f60b75138803069e0a63726b3d492a2d.tar.xz
Use svn switch if appropriate.
-rw-r--r--paludis/syncers/dosvn.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/paludis/syncers/dosvn.in b/paludis/syncers/dosvn.in
index ba1490c..815b79b 100644
--- a/paludis/syncers/dosvn.in
+++ b/paludis/syncers/dosvn.in
@@ -68,5 +68,16 @@ fi
[[ "${REMOTE}" == svn+http* || "${REMOTE}" == svn+file://* ]] && REMOTE="${REMOTE#svn+}"
+if [[ -d "${LOCAL}/.svn" ]]; then
+ cd "${LOCAL}"
+ OLD_REMOTE="$(${SVN_WRAPPER} svn info | sed -ne 's/^URL: //p')"
+ if [[ "${OLD_REMOTE}" != "${REMOTE}" ]]; then
+ if ! ${SVN_WRAPPER} svn switch --relocate "${OLD_REMOTE}" "${REMOTE}"; then
+ eerror "${0}: could not switch from '${OLD_REMOTE}' to '${REMOTE}'"
+ exit 1
+ fi
+ fi
+fi
+
${SVN_WRAPPER} svn checkout "${SVN_CHECKOUT_OPTIONS[@]}" "${REMOTE}" "${LOCAL}/"