From f81735f238927eface0fb987bb062163bdc8dc68 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 27 Jan 2011 21:21:43 +0000 Subject: add commit option --- MgaRepo/binrepo.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MgaRepo/binrepo.py b/MgaRepo/binrepo.py index bb9f16a..9eb5c03 100644 --- a/MgaRepo/binrepo.py +++ b/MgaRepo/binrepo.py @@ -319,7 +319,7 @@ def remove(path, message=None, commit=True): if commit: svn.commit(binpath, log=message) -def upload(path, message=None): +def upload(path, message=None, commit=True): from MgaRepo.rpmutil import getpkgtopdir svn = SVN() if not os.path.exists(path): @@ -343,7 +343,8 @@ def upload(path, message=None): pass if not os.path.exists(bindir): create_package_dirs(bintopdir) - svn.commit(topdir, log="%s: created binrepo structure" % silent) + if commit: + svn.commit(topdir, log="%s: created binrepo structure" % silent) download(topdir, show=False) for path in paths: if svn.info2(path): @@ -365,13 +366,15 @@ def upload(path, message=None): if svn.info2(sources): svn.update(sources) update = update_sources_threaded(topdir, added=paths) - rev = svn.commit(binpath, log=message) + if commit: + rev = svn.commit(binpath, log=message) if svn.info2(sources): svn.update(sources) else: svn.add(sources) update.join() - svn.commit(sources, log=message, nonrecursive=True) + if commit: + svn.commit(sources, log=message, nonrecursive=True) def mapped_revision(target, revision, wc=False): """Maps a txtrepo revision to a binrepo datespec -- cgit v1.2.1