aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys/svn.py
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-04-25 20:41:53 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-04-25 20:41:53 +0000
commit9ff10dd337e9de6e954b4125a17d89ec2b7cd8e9 (patch)
tree2ade2e1c6cc9791192a39eda2341161381f352c2 /RepSys/svn.py
parent20cc82e177aee8c69478998847d52d183b39a99d (diff)
downloadmgarepo-9ff10dd337e9de6e954b4125a17d89ec2b7cd8e9.tar
mgarepo-9ff10dd337e9de6e954b4125a17d89ec2b7cd8e9.tar.gz
mgarepo-9ff10dd337e9de6e954b4125a17d89ec2b7cd8e9.tar.bz2
mgarepo-9ff10dd337e9de6e954b4125a17d89ec2b7cd8e9.tar.xz
mgarepo-9ff10dd337e9de6e954b4125a17d89ec2b7cd8e9.zip
Added support to "mirror repositories" for the subcommands co and ci.
Mirrors are intended to be used in read-only operations (such as co and rpmlog). For the moment the subcommand co will checkout the package source from the mirror, when it is defined. Also it was added the subcommand ci in order to allow relocating one package working copy to the write-enabled server before commiting, and then relocating back to the mirror when it is finished.
Diffstat (limited to 'RepSys/svn.py')
-rw-r--r--RepSys/svn.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/RepSys/svn.py b/RepSys/svn.py
index 4e073dc..a13db8b 100644
--- a/RepSys/svn.py
+++ b/RepSys/svn.py
@@ -169,6 +169,12 @@ class SVN:
if status == 0:
return output.splitlines()
return None
+
+ def info2(self, *args, **kwargs):
+ lines = self.info(*args, **kwargs)
+ pairs = [[w.strip() for w in line.split(":", 1)] for line in lines]
+ info = dict(pairs)
+ return info
def ls(self, path, **kwargs):
cmd = ["ls", path]
@@ -197,6 +203,19 @@ class SVN:
return [x.split() for x in output.split()]
return None
+ def switch(self, url, oldurl=None, path=None, relocate=False, **kwargs):
+ cmd = ["switch"]
+ if relocate:
+ if oldurl is None:
+ raise Error, "You must supply the old URL when "\
+ "relocating working copies"
+ cmd.append("--relocate")
+ cmd.append(oldurl)
+ cmd.append(url)
+ if path is not None:
+ cmd.append(path)
+ return self._execsvn_success(*cmd, **kwargs)
+
def update(self, path, **kwargs):
cmd = ["update", path]
self._add_revision(cmd, kwargs, optional=1)