[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/cvs/, pym/repoman/modules/vcs/None/, ...

2016-03-10 Thread Brian Dolbec
commit: 2dd56cc49565387512d5cf209c4c003f19741bf9
Author: Brian Dolbec  gentoo  org>
AuthorDate: Sat Jan 30 07:58:04 2016 +
Commit: Brian Dolbec  gentoo  org>
CommitDate: Thu Mar 10 23:47:35 2016 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2dd56cc4

repoman: Create docstrings for all new vcs module files

 pym/repoman/modules/vcs/None/changes.py |  9 -
 pym/repoman/modules/vcs/None/status.py  | 35 ++---
 pym/repoman/modules/vcs/bzr/__init__.py |  2 +-
 pym/repoman/modules/vcs/bzr/changes.py  |  9 -
 pym/repoman/modules/vcs/bzr/status.py   | 30 
 pym/repoman/modules/vcs/changes.py  |  3 +++
 pym/repoman/modules/vcs/cvs/__init__.py |  2 +-
 pym/repoman/modules/vcs/cvs/changes.py  |  8 +++-
 pym/repoman/modules/vcs/cvs/status.py   | 18 +
 pym/repoman/modules/vcs/git/__init__.py |  2 +-
 pym/repoman/modules/vcs/git/changes.py  |  9 -
 pym/repoman/modules/vcs/git/status.py   | 33 +++
 pym/repoman/modules/vcs/hg/__init__.py  |  2 +-
 pym/repoman/modules/vcs/hg/changes.py   |  9 -
 pym/repoman/modules/vcs/hg/status.py| 31 +
 pym/repoman/modules/vcs/settings.py |  2 +-
 pym/repoman/modules/vcs/svn/__init__.py |  2 +-
 pym/repoman/modules/vcs/svn/changes.py  |  9 -
 pym/repoman/modules/vcs/svn/status.py   | 27 ++---
 19 files changed, 220 insertions(+), 22 deletions(-)

diff --git a/pym/repoman/modules/vcs/None/changes.py 
b/pym/repoman/modules/vcs/None/changes.py
index f95af69..759b554 100644
--- a/pym/repoman/modules/vcs/None/changes.py
+++ b/pym/repoman/modules/vcs/None/changes.py
@@ -1,4 +1,6 @@
-
+'''
+None module Changes class submodule
+'''
 
 from repoman.modules.vcs.changes import ChangesBase
 
@@ -11,7 +13,12 @@ class Changes(ChangesBase):
vcs = 'None'
 
def __init__(self, options):
+   '''Class init
+
+   @param options: commandline options
+   '''
super(Changes, self).__init__(options)
 
def scan(self):
+   '''VCS type scan function, looks for all detectable changes'''
pass

diff --git a/pym/repoman/modules/vcs/None/status.py 
b/pym/repoman/modules/vcs/None/status.py
index b23fa10..d6e5ca0 100644
--- a/pym/repoman/modules/vcs/None/status.py
+++ b/pym/repoman/modules/vcs/None/status.py
@@ -1,24 +1,53 @@
-
+'''
+None (non-VCS) module Status class submodule
+'''
 
 
 class Status(object):
+   '''Performs status checks on the svn repository'''
 
def __init__(self, qatracker, eadded):
+   '''Class init
+
+   @param qatracker: QATracker class instance
+   @param eadded: list
+   '''
self.qatracker = qatracker
self.eadded = eadded
 
def check(self, checkdir, checkdir_relative, xpkg):
+   '''Perform the svn status check
+
+   @param checkdir: string of the directory being checked
+   @param checkdir_relative: string of the relative directory 
being checked
+   @param xpkg: string of the package being checked
+   @returns: boolean
+   '''
return True
 
@staticmethod
-   def supports_gpg_sign():
+   def detect_conflicts(options):
+   '''Are there any merge conflicts present in the VCS tracking 
system
+
+   @param options: command line options
+   @returns: Boolean
+   '''
return False
 
@staticmethod
-   def detect_conflicts(options):
+   def supports_gpg_sign():
+   '''Does this vcs system support gpg commit signatures
+
+   @returns: Boolean
+   '''
return False
 
@staticmethod
def isVcsDir(dirname):
+   '''Is the directory belong to the vcs system
+
+   @param dirname: string, directory name
+   @returns: Boolean
+   '''
return False
 

diff --git a/pym/repoman/modules/vcs/bzr/__init__.py 
b/pym/repoman/modules/vcs/bzr/__init__.py
index 1192782..4490ed8 100644
--- a/pym/repoman/modules/vcs/bzr/__init__.py
+++ b/pym/repoman/modules/vcs/bzr/__init__.py
@@ -1,7 +1,7 @@
 # Copyright 2014-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-doc = """BZR plug-in module for portage.
+doc = """Bazaar (bzr) plug-in module for portage.
 Performs variaous Bazaar actions and checks on repositories."""
 __doc__ = doc[:]
 

diff --git a/pym/repoman/modules/vcs/bzr/changes.py 
b/pym/repoman/modules/vcs/bzr/changes.py
index 41ce347..519d311 100644
--- a/pym/repoman/modules/vcs/bzr/changes.py
+++ b/pym/repoman/modules/vcs/bzr/changes.py
@@ -1,4 +1,6 @@
-
+'''
+Bazaar module Changes class submodule
+'''
 
 from 

[gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/cvs/, pym/repoman/modules/vcs/None/, ...

2016-03-07 Thread Brian Dolbec
commit: d6f695d66ac9160842256970a1aea63d4f47f6b0
Author: Brian Dolbec  gentoo  org>
AuthorDate: Tue Feb 16 20:06:30 2016 +
Commit: Brian Dolbec  gentoo  org>
CommitDate: Tue Mar  8 03:13:28 2016 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d6f695d6

repoman: Migrate the commit code to the vcs modules

 pym/repoman/actions.py  | 84 +
 pym/repoman/modules/vcs/None/changes.py | 13 +
 pym/repoman/modules/vcs/bzr/changes.py  |  1 -
 pym/repoman/modules/vcs/changes.py  | 20 
 pym/repoman/modules/vcs/cvs/changes.py  |  1 -
 pym/repoman/modules/vcs/git/changes.py  | 10 
 pym/repoman/modules/vcs/hg/changes.py   | 16 +++
 7 files changed, 82 insertions(+), 63 deletions(-)

diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index d2e4fc1..4aec1e0 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -7,21 +7,19 @@ import io
 import logging
 import platform
 import signal
-import subprocess
 import sys
 import tempfile
 from itertools import chain
 
 from _emerge.UserQuery import UserQuery
 
-import portage
+from repoman._portage import portage
 from portage import os
 from portage import _encodings
 from portage import _unicode_encode
 from portage.output import (
bold, create_color_func, green, red)
 from portage.package.ebuild.digestgen import digestgen
-from portage.process import find_binary, spawn
 from portage.util import writemsg_level
 
 from repoman.gpg import gpgsign, need_signature
@@ -432,43 +430,18 @@ class Actions(object):
mymsg.write(_unicode_encode(commitmessage))
mymsg.close()
 
-   commit_cmd = []
-   if self.options.pretend and self.vcs_settings.vcs is None:
-   # substitute a bogus value for pretend output
-   commit_cmd.append("cvs")
-   else:
-   commit_cmd.append(self.vcs_settings.vcs)
-   commit_cmd.extend(self.vcs_settings.vcs_global_opts)
-   commit_cmd.append("commit")
-   commit_cmd.extend(self.vcs_settings.vcs_local_opts)
-   if self.vcs_settings.vcs == "hg":
-   commit_cmd.extend(["--logfile", commitmessagefile])
-   commit_cmd.extend(myfiles)
-   else:
-   commit_cmd.extend(["-F", commitmessagefile])
-   commit_cmd.extend(f.lstrip("./") for f in myfiles)
-
+   retval = self.vcs_settings.changes.commit(myfiles, 
commitmessagefile)
+   # cleanup the commit message before possibly exiting
try:
-   if self.options.pretend:
-   print("(%s)" % (" ".join(commit_cmd),))
-   else:
-   retval = spawn(commit_cmd, 
env=self.repo_settings.commit_env)
-   if retval != os.EX_OK:
-   if 
self.repo_settings.repo_config.sign_commit and not 
self.vcs_settings.status.supports_gpg_sign():
-   # Inform user that newer git is 
needed (bug #403323).
-   logging.error(
-   "Git >=1.7.9 is 
required for signed commits!")
-
-   writemsg_level(
-   "!!! Exiting on %s (shell) "
-   "error code: %s\n" % 
(self.vcs_settings.vcs, retval),
-   level=logging.ERROR, 
noiselevel=-1)
-   sys.exit(retval)
-   finally:
-   try:
-   os.unlink(commitmessagefile)
-   except OSError:
-   pass
+   os.unlink(commitmessagefile)
+   except OSError:
+   pass
+   if retval != os.EX_OK:
+   writemsg_level(
+   "!!! Exiting on %s (shell) "
+   "error code: %s\n" % (self.vcs_settings.vcs, 
retval),
+   level=logging.ERROR, noiselevel=-1)
+   sys.exit(retval)
 
 
def priming_commit(self, myupdates, myremoved, commitmessage):
@@ -492,29 +465,18 @@ class Actions(object):
# so strip the prefix.
myfiles = [f.lstrip("./") for f in myfiles]
 
-   commit_cmd = [self.vcs_settings.vcs]
-   commit_cmd.extend(self.vcs_settings.vcs_global_opts)
-   commit_cmd.append("commit")
-   commit_cmd.extend(self.vcs_settings.vcs_local_opts)
-   commit_cmd.extend(["-F", commitmessagefile])
-   commit_cmd.extend(myfiles)