You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by le...@apache.org on 2005/01/07 22:57:56 UTC
svn commit: r124582 - /gump/branches/Gump3/pygump/python/gump/config.py /gump/branches/Gump3/pygump/python/gump/model/__init__.py /gump/branches/Gump3/pygump/python/gump/plugins/updater.py
Author: leosimons
Date: Fri Jan 7 13:57:54 2005
New Revision: 124582
URL: http://svn.apache.org/viewcvs?view=rev&rev=124582
Log:
The CVS updater is now, basically, working. There's some weird bugs in here. Really need to start on those unit tests....
Modified:
gump/branches/Gump3/pygump/python/gump/config.py
gump/branches/Gump3/pygump/python/gump/model/__init__.py
gump/branches/Gump3/pygump/python/gump/plugins/updater.py
Modified: gump/branches/Gump3/pygump/python/gump/config.py
Url: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?view=diff&rev=124582&p1=gump/branches/Gump3/pygump/python/gump/config.py&r1=124581&p2=gump/branches/Gump3/pygump/python/gump/config.py&r2=124582
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Fri Jan 7 13:57:54 2005
@@ -90,6 +90,11 @@
from gump.plugins.instrumentation import TimerPlugin
pre_process_plugins.append(TimerPlugin("run_start"))
+ from gump.plugins.updater import CvsUpdater, SvnUpdater
+ pre_process_plugins.append(CvsUpdater(config.paths_work))
+ pre_process_plugins.append(SvnUpdater(config.paths_work))
+
+
plugins = []
# TODO: append more plugins here...
Modified: gump/branches/Gump3/pygump/python/gump/model/__init__.py
Url: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/model/__init__.py?view=diff&rev=124582&p1=gump/branches/Gump3/pygump/python/gump/model/__init__.py&r1=124581&p2=gump/branches/Gump3/pygump/python/gump/model/__init__.py&r2=124582
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/model/__init__.py (original)
+++ gump/branches/Gump3/pygump/python/gump/model/__init__.py Fri Jan 7 13:57:54 2005
@@ -112,6 +112,7 @@
user = None,
password = None):
Repository.__init__(self, workspace, name, title, home_page, cvsweb, redistributable)
+
self.hostname = hostname
self.path = path,
self.method = method,
@@ -119,10 +120,10 @@
self.password = password
def to_url(self):
- url = method + ':'
- if user:
- url += user + '@'
- url += hostname + ':' + path
+ url = ":%s:" % self.method
+ if self.user:
+ url = "%s%s@" % (url, tuple(self.user)[0]) #TODO figure out where on earth this becomes a tuple!!!
+ url = "%s%s:%s" % (url, self.hostname, tuple(self.path)[0])
return url
Modified: gump/branches/Gump3/pygump/python/gump/plugins/updater.py
Url: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/updater.py?view=diff&rev=124582&p1=gump/branches/Gump3/pygump/python/gump/plugins/updater.py&r1=124581&p2=gump/branches/Gump3/pygump/python/gump/plugins/updater.py&r2=124582
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/updater.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/updater.py Fri Jan 7 13:57:54 2005
@@ -33,12 +33,12 @@
self.workdir = workdir
def visit_repository(self, repository):
- repopath = self.get_repo_path()
+ repopath = self.get_repo_path(repository)
if not os.path.exists(repopath):
os.mkdir(repopath)
def visit_module(self, module):
- modulepath = self.get_module_path()
+ modulepath = self.get_module_path(module)
if not os.path.exists(modulepath):
os.mkdir(modulepath)
@@ -46,7 +46,7 @@
return os.path.join(self.workdir, repository.name)
def get_module_path(self, module):
- return os.path.join(self.get_repo_path(), module.name)
+ return os.path.join(self.get_repo_path(module.repository), module.name)
class CvsUpdater(ModuleUpdater):
def __init__(self, workdir):
@@ -57,30 +57,29 @@
ModuleUpdater.visit_repository(self, repository)
def visit_module(self, module):
- if not isinstance(repository, CvsRepository): return
+ if not isinstance(module.repository, CvsRepository): return
ModuleUpdater.visit_module(self, module)
- modulepath = self.get_module_path()
+ repopath = self.get_repo_path(module)
current = os.path.curdir
- os.chdir(modulepath)
- cvsdir = os.path.join(modulepath, 'CVS')
+ os.chdir(repopath)
+ cvsdir = os.path.join(repopath, module.name, 'CVS')
if not os.path.exists(cvsdir):
self.checkout(module)
else:
self.update(module)
os.chdir(current)
- def checkout(self, module, modulepath):
+ def checkout(self, module):
repository = module.repository.to_url()
- cmd = 'cvs -d %s checkout -P %s .' % (repository, module.name)
-
+ cmd = 'cvs -d %s checkout %s' % (repository, module.name)
(status, output) = commands.getstatusoutput(cmd)
module.update_log = output
module.update_exit_status = status
module.update_type = UPDATE_TYPE_CHECKOUT
- def update(self, module, modulepath):
+ def update(self, module):
cmd = 'cvs up -Pd'
(status, output) = commands.getstatusoutput(cmd)
@@ -97,11 +96,11 @@
ModuleUpdater.visit_repository(self, repository)
def visit_module(self, module):
- if not isinstance(repository, SvnRepository): return
+ if not isinstance(module.repository, SvnRepository): return
ModuleUpdater.visit_module(self, module)
- modulepath = self.get_module_path()
+ modulepath = self.get_module_path(module)
current = os.path.curdir
os.chdir(modulepath)
svndir = os.path.join(modulepath, '.svn')
@@ -111,7 +110,7 @@
self.update(module)
os.chdir(current)
- def checkout(self, module, modulepath):
+ def checkout(self, module):
repository = module.repository.url + '/' + module.path
cmd = 'svn checkout %s .' % repository
@@ -120,7 +119,7 @@
module.update_exit_status = status
module.update_type = UPDATE_TYPE_CHECKOUT
- def update(self, module, modulepath):
+ def update(self, module):
cmd = 'svn up'
(status, output) = commands.getstatusoutput(cmd)