git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kirill Smelkov <kirr@mns.spb.ru>
To: Petr Baudis <pasky@suse.cz>
Cc: Miklos Vajna <vmiklos@frugalware.org>, Petr Baudis <pasky@ucw.cz>,
	git@vger.kernel.org, Kirill Smelkov <kirr@landau.phys.spbu.ru>
Subject: [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos
Date: Mon, 22 Mar 2010 14:08:01 +0300	[thread overview]
Message-ID: <b7d25a4325c26bed2351257521878109b71ad771.1269255835.git.kirr@mns.spb.ru> (raw)
In-Reply-To: <20100222085029.GA28744@landau.phys.spbu.ru>
In-Reply-To: <cover.1269255835.git.kirr@mns.spb.ru>

From: Kirill Smelkov <kirr@landau.phys.spbu.ru>

Currently we can mirror svn:// repos, but http:// is assumed to be used
for Git. Teach the tool to use svn+http:// style urls for http:// svn
repositories.

This is very needed, because most SVN hosting services only provide
http:// style access to their services. e.g. google code, python.org,
etc...

This has not been tested on full Girocco installation - just partly. But
if it works, let's also add svn+https later.
---
 Girocco/Util.pm |    2 +-
 jobd/update.sh  |    2 +-
 taskd/clone.sh  |    6 ++++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Girocco/Util.pm b/Girocco/Util.pm
index e2f7854..969cb3c 100644
--- a/Girocco/Util.pm
+++ b/Girocco/Util.pm
@@ -111,7 +111,7 @@ sub valid_web_url {
 }
 sub valid_repo_url {
 	$_ = $_[0];
-	/^(http|git|svn|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/;
+	/^(http|git|svn(\+http)?|darcs|bzr):\/\/[a-zA-Z0-9-.:]+(\/[_\%a-zA-Z0-9.\/~-]*)?$/;
 }
 
 
diff --git a/jobd/update.sh b/jobd/update.sh
index e09ef95..65e0455 100755
--- a/jobd/update.sh
+++ b/jobd/update.sh
@@ -38,7 +38,7 @@ mail="$(config_get owner)"
 bang git for-each-ref --format '%(refname)	%(objectname)' >.refs-before
 
 case "$url" in
-	svn://*)
+	svn://* | svn+http://*)
 		GIT_DIR=. bang git svn fetch
 		GIT_DIR=. bang git fetch
 		;;
diff --git a/taskd/clone.sh b/taskd/clone.sh
index cfcb3b1..e634388 100755
--- a/taskd/clone.sh
+++ b/taskd/clone.sh
@@ -22,8 +22,10 @@ mail="$(config_get owner)"
 # Initial mirror
 echo "Initiating mirroring..."
 case "$url" in
-	svn://*)
-		GIT_DIR=. git svn init -s "$url"
+	svn://* | svn+http://*)
+		# we just remote svn+ here, so svn+http://... becomes http://...
+		svnurl="${url#svn+}"
+		GIT_DIR=. git svn init -s "$svnurl"
 		GIT_DIR=. git svn fetch
 		# Neat Trick suggested by Miklos Vajna
 		GIT_DIR=. git config remote.origin.url .
-- 
1.7.0.2.284.gafe27d

  parent reply	other threads:[~2010-03-22 11:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-19 13:22 [BUG] girocco + git-svn: trunk is not propagated to master Kirill Smelkov
2010-02-20 23:42 ` Miklos Vajna
2010-02-21 17:19   ` Kirill Smelkov
2010-02-22  8:50     ` [PATCH] Teach Girocco to mirror http:// style SVN repos Kirill Smelkov
2010-03-22 11:07       ` [PATCH 0/3] girocco + git-svn: trunk is not propagated to master + more... (resend) Kirill Smelkov
2010-03-22 11:07         ` [PATCH 1/3] taskd/clone: Don't forget to use 'git config --add' for multivars setup Kirill Smelkov
2010-03-22 11:08         ` [PATCH 2/3] taskd/clone: quote shell metacharacters where appropriate Kirill Smelkov
2010-03-22 11:08         ` Kirill Smelkov [this message]
2010-05-05 18:54           ` [PATCH 3/3] Teach Girocco to mirror http:// style SVN repos Petr Baudis
2010-05-06  7:18             ` Kirill Smelkov
2010-05-06  7:36               ` Petr Baudis
2010-05-06  8:32                 ` Kirill Smelkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7d25a4325c26bed2351257521878109b71ad771.1269255835.git.kirr@mns.spb.ru \
    --to=kirr@mns.spb.ru \
    --cc=git@vger.kernel.org \
    --cc=kirr@landau.phys.spbu.ru \
    --cc=pasky@suse.cz \
    --cc=pasky@ucw.cz \
    --cc=vmiklos@frugalware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).