From 2e0c7def5895fea29177718abb690b75bc21695e Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Wed, 2 May 2007 19:41:47 +0000 Subject: Added initial support to mirrors, as requested by mrl. It was added an option "mirror" to repsys.conf, that will contain an URL to the mirror repository. Also added the subcommand "ci", which will relocate one working copy to the master repository before effectively commiting. --- RepSys/svn.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'RepSys/svn.py') 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) -- cgit v1.2.1