You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2012/02/29 02:06:33 UTC
svn commit: r1294921 -
/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
Author: gstein
Date: Wed Feb 29 01:06:32 2012
New Revision: 1294921
URL: http://svn.apache.org/viewvc?rev=1294921&view=rev
Log:
Ensure that the configured Subversion binary is used throughout
(rather than just "svn" on PATH).
* tools/server-side/svnpubsub/svnwcsub.py:
(SvnClient.__init__): take an svnbin param
(SvnClient._run_info, SvnClient.update): use self.svnbin
(ProcSvnClient.__init__): pass svnbin to the superclas
(WorkingCopy._get_match): pass svnbin to the SvnClient constructor
Modified:
subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
Modified: subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py?rev=1294921&r1=1294920&r2=1294921&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/trunk/tools/server-side/svnpubsub/svnwcsub.py Wed Feb 29 01:06:32 2012
@@ -56,7 +56,8 @@ Yes, this exposes accessors for each pie
simpler.
"""
class SvnClient(object):
- def __init__(self, path, url):
+ def __init__(self, svnbin, path, url):
+ self.svnbin = svnbin
self.path = path
self.url = url
self.info = {}
@@ -68,12 +69,12 @@ class SvnClient(object):
def _run_info(self):
"run `svn info` and return the output"
- argv = ["svn", "info", "--non-interactive", "--", self.path]
+ argv = [self.svnbin, "info", "--non-interactive", "--", self.path]
output = None
if not os.path.isdir(self.path):
log.msg("autopopulate %s from %s" % ( self.path, self.url))
- subprocess.check_call(['svn', 'co', '-q', '--non-interactive', '--config-dir', '/home/svnwc/.subversion', '--', self.url, self.path])
+ subprocess.check_call([self.svnbin, 'co', '-q', '--non-interactive', '--config-dir', '/home/svnwc/.subversion', '--', self.url, self.path])
if hasattr(subprocess, 'check_output'):
output = subprocess.check_output(argv)
@@ -115,7 +116,7 @@ class SvnClient(object):
def update(self):
subprocess.check_call(
- ["svn", "update", "--non-interactive", "-q", "--", self.path]
+ [self.svnbin, "update", "--non-interactive", "-q", "--", self.path]
)
self._get_info(True)
return int(self.info['revision'])
@@ -128,8 +129,7 @@ class SvnClient(object):
used pysvn."""
class ProcSvnClient(SvnClient):
def __init__(self, path, svnbin="svn", env=None, url=None):
- super(ProcSvnClient, self).__init__(path, url)
- self.svnbin = svnbin
+ super(ProcSvnClient, self).__init__(svnbin, path, url)
self.env = env
@defer.inlineCallbacks
@@ -204,7 +204,7 @@ class WorkingCopy(object):
def _get_match(self):
self.lock.acquire()
try:
- c = SvnClient(self.path, self.url)
+ c = SvnClient(self.bdec.svnbin, self.path, self.url)
repos = c.get_repos()
url = c.get_url()
uuid = c.get_uuid()