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/rpmutil.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'RepSys/rpmutil.py') diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py index 367fd45..12a8226 100644 --- a/RepSys/rpmutil.py +++ b/RepSys/rpmutil.py @@ -1,5 +1,6 @@ #!/usr/bin/python from RepSys import Error, config, RepSysTree +from RepSys import mirror from RepSys.svn import SVN from RepSys.rpm import SRPM from RepSys.log import specfile_svn2rpm @@ -357,8 +358,31 @@ def checkout(pkgdirurl, path=None, revision=None): current = os.path.join(pkgdirurl, "current") if path is None: _, path = os.path.split(pkgdirurl) + if mirror.enabled(): + current = mirror.checkout_url(current) + print "checking out from mirror", current svn.checkout(current, path, rev=revision, show=1) +def commit(target=".", message=None): + svn = SVN(noauth=True) + info = svn.info2(target) + url = info.get("URL") + if url is None: + raise Error, "working copy URL not provided by svn info" + if mirror.enabled(): + newurl = mirror.switchto_parent(svn, url, target) + print "relocated to", newurl + try: + # we can't use the svn object here because pexpect hides VISUAL + mopt = "" + if message is not None: + mopt = "-m \"%s\"" % message + os.system("svn ci %s %s" % (mopt, target)) + finally: + if mirror.enabled(): + mirror.switchto_mirror(svn, newurl, target) + print "relocated back to", url + def get_submit_info(path): path = os.path.abspath(path) -- cgit v1.2.1