From 647595e6fb05db38b7c45fe37ab67254cad60fb7 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Thu, 24 Jul 2008 13:11:07 -0400 Subject: [PATCH] svn: give configure_repo an optional parameter for better reuse --- plugins/svn.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/svn.py b/plugins/svn.py index 858f723..97e2a93 100644 --- a/plugins/svn.py +++ b/plugins/svn.py @@ -14,12 +14,16 @@ class SvnPlugin(YapPlugin): raise YapError("Not an SVN repo: %s" % url) return root[0] - def _configure_repo(self, url): + def _configure_repo(self, url, fetch=None): root = self._get_root(url) os.system("git config svn-remote.svn.url %s" % root) - trunk = url.replace(root, '').strip('/') - os.system("git config svn-remote.svn.fetch %s:refs/remotes/svn/trunk" - % trunk) + if fetch is None: + trunk = url.replace(root, '').strip('/') + else: + trunk = fetch.split(':')[0] + os.system("git config svn-remote.svn.fetch %s:refs/remotes/svn/trunk" + % trunk) + branches = trunk.replace('trunk', 'branches') os.system("git config svn-remote.svn.branches %s/*:refs/remotes/svn/*" % branches) -- 2.11.4.GIT