aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-01-29 23:58:04 -0800
committerBrian Dolbec <dolsen@gentoo.org>2016-03-12 09:57:40 -0800
commit193d69273226897073b8bdd1581e44620df07d4e (patch)
tree23e4e65c293bd2dc4be9227603a27d6b10d8334c
parentrepoman: Migrate actions.py vcs code to the vcs modules (diff)
downloadportage-193d6927.tar.gz
portage-193d6927.tar.bz2
portage-193d6927.zip
repoman: Create docstrings for all new vcs module files
-rw-r--r--pym/repoman/modules/vcs/None/changes.py9
-rw-r--r--pym/repoman/modules/vcs/None/status.py35
-rw-r--r--pym/repoman/modules/vcs/bzr/__init__.py2
-rw-r--r--pym/repoman/modules/vcs/bzr/changes.py9
-rw-r--r--pym/repoman/modules/vcs/bzr/status.py30
-rw-r--r--pym/repoman/modules/vcs/changes.py3
-rw-r--r--pym/repoman/modules/vcs/cvs/__init__.py2
-rw-r--r--pym/repoman/modules/vcs/cvs/changes.py8
-rw-r--r--pym/repoman/modules/vcs/cvs/status.py18
-rw-r--r--pym/repoman/modules/vcs/git/__init__.py2
-rw-r--r--pym/repoman/modules/vcs/git/changes.py9
-rw-r--r--pym/repoman/modules/vcs/git/status.py33
-rw-r--r--pym/repoman/modules/vcs/hg/__init__.py2
-rw-r--r--pym/repoman/modules/vcs/hg/changes.py9
-rw-r--r--pym/repoman/modules/vcs/hg/status.py31
-rw-r--r--pym/repoman/modules/vcs/settings.py2
-rw-r--r--pym/repoman/modules/vcs/svn/__init__.py2
-rw-r--r--pym/repoman/modules/vcs/svn/changes.py9
-rw-r--r--pym/repoman/modules/vcs/svn/status.py27
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 f95af6927..759b5545b 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 b23fa10c4..d6e5ca0e4 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 11927823f..4490ed86c 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 41ce34700..519d311dc 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 repoman.modules.vcs.changes import ChangesBase
from repoman._subprocess import repoman_popen
@@ -12,9 +14,14 @@ class Changes(ChangesBase):
vcs = 'bzr'
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'''
with repoman_popen("bzr status -S .") as f:
bzrstatus = f.readlines()
self.changed = [
diff --git a/pym/repoman/modules/vcs/bzr/status.py b/pym/repoman/modules/vcs/bzr/status.py
index e375b05bd..d5f332683 100644
--- a/pym/repoman/modules/vcs/bzr/status.py
+++ b/pym/repoman/modules/vcs/bzr/status.py
@@ -1,3 +1,6 @@
+'''
+Bazaar module Status class submodule
+'''
from repoman._portage import portage
from portage import os
@@ -5,12 +8,25 @@ from repoman._subprocess import repoman_popen
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
+ '''
try:
myf = repoman_popen(
"bzr ls -v --kind=file " +
@@ -29,12 +45,26 @@ class Status(object):
@staticmethod
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 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 dirname in [".bzr"]
diff --git a/pym/repoman/modules/vcs/changes.py b/pym/repoman/modules/vcs/changes.py
index 6eefaed87..76ad59101 100644
--- a/pym/repoman/modules/vcs/changes.py
+++ b/pym/repoman/modules/vcs/changes.py
@@ -1,3 +1,6 @@
+'''
+Base Changes class
+'''
import os
from itertools import chain
diff --git a/pym/repoman/modules/vcs/cvs/__init__.py b/pym/repoman/modules/vcs/cvs/__init__.py
index ba60e2c0b..0b4587bc6 100644
--- a/pym/repoman/modules/vcs/cvs/__init__.py
+++ b/pym/repoman/modules/vcs/cvs/__init__.py
@@ -1,7 +1,7 @@
# Copyright 2014-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-doc = """CVS plug-in module for portage.
+doc = """CVS (cvs) plug-in module for portage.
Performs variaous CVS actions and checks on repositories."""
__doc__ = doc[:]
diff --git a/pym/repoman/modules/vcs/cvs/changes.py b/pym/repoman/modules/vcs/cvs/changes.py
index cdfb4b281..3ef91cc3d 100644
--- a/pym/repoman/modules/vcs/cvs/changes.py
+++ b/pym/repoman/modules/vcs/cvs/changes.py
@@ -1,4 +1,6 @@
-
+'''
+CVS module Changes class submodule
+'''
import re
@@ -15,6 +17,10 @@ class Changes(ChangesBase):
vcs = 'cvs'
def __init__(self, options):
+ '''Class init
+
+ @param options: commandline options
+ '''
super(Changes, self).__init__(options)
self._tree = None
diff --git a/pym/repoman/modules/vcs/cvs/status.py b/pym/repoman/modules/vcs/cvs/status.py
index 24e2825ea..1917bde08 100644
--- a/pym/repoman/modules/vcs/cvs/status.py
+++ b/pym/repoman/modules/vcs/cvs/status.py
@@ -1,3 +1,6 @@
+'''
+CVS module Status class submodule
+'''
import logging
import subprocess
@@ -11,8 +14,14 @@ from portage import _unicode_encode, _unicode_decode
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
@@ -106,8 +115,17 @@ class Status(object):
@staticmethod
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 dirname in ["CVS"]
diff --git a/pym/repoman/modules/vcs/git/__init__.py b/pym/repoman/modules/vcs/git/__init__.py
index e0777679c..eecd4a1d0 100644
--- a/pym/repoman/modules/vcs/git/__init__.py
+++ b/pym/repoman/modules/vcs/git/__init__.py
@@ -1,7 +1,7 @@
# Copyright 2014-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-doc = """Git plug-in module for portage.
+doc = """Git (git) plug-in module for portage.
Performs variaous git actions and checks on repositories."""
__doc__ = doc[:]
diff --git a/pym/repoman/modules/vcs/git/changes.py b/pym/repoman/modules/vcs/git/changes.py
index 03422514a..d0b6acd4d 100644
--- a/pym/repoman/modules/vcs/git/changes.py
+++ b/pym/repoman/modules/vcs/git/changes.py
@@ -1,4 +1,6 @@
-
+'''
+Git module Changes class submodule
+'''
from repoman.modules.vcs.changes import ChangesBase
from repoman._subprocess import repoman_popen
@@ -12,9 +14,14 @@ class Changes(ChangesBase):
vcs = 'git'
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'''
with repoman_popen(
"git diff-index --name-only "
"--relative --diff-filter=M HEAD") as f:
diff --git a/pym/repoman/modules/vcs/git/status.py b/pym/repoman/modules/vcs/git/status.py
index 5ab5f946f..963abf615 100644
--- a/pym/repoman/modules/vcs/git/status.py
+++ b/pym/repoman/modules/vcs/git/status.py
@@ -1,3 +1,6 @@
+'''
+Git module Status class submodule
+'''
import re
@@ -7,12 +10,25 @@ from repoman._subprocess import repoman_popen, repoman_getstatusoutput
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
+ '''
myf = repoman_popen(
"git ls-files --others %s" %
(portage._shell_quote(checkdir_relative),))
@@ -25,7 +41,20 @@ class Status(object):
return True
@staticmethod
+ 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 supports_gpg_sign():
+ '''Does this vcs system support gpg commit signatures
+
+ @returns: Boolean
+ '''
status, cmd_output = \
repoman_getstatusoutput("git --version")
cmd_output = cmd_output.split()
@@ -40,10 +69,6 @@ class Status(object):
return False
@staticmethod
- def detect_conflicts(options):
- return False
-
- @staticmethod
def isVcsDir(dirname):
return dirname in [".git"]
diff --git a/pym/repoman/modules/vcs/hg/__init__.py b/pym/repoman/modules/vcs/hg/__init__.py
index 6737dfb96..2e39970f7 100644
--- a/pym/repoman/modules/vcs/hg/__init__.py
+++ b/pym/repoman/modules/vcs/hg/__init__.py
@@ -1,7 +1,7 @@
# Copyright 2014-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-doc = """HG plug-in module for portage.
+doc = """Mercurial (hg) plug-in module for portage.
Performs variaous mercurial actions and checks on repositories."""
__doc__ = doc[:]
diff --git a/pym/repoman/modules/vcs/hg/changes.py b/pym/repoman/modules/vcs/hg/changes.py
index f4e1ec84b..97290858d 100644
--- a/pym/repoman/modules/vcs/hg/changes.py
+++ b/pym/repoman/modules/vcs/hg/changes.py
@@ -1,4 +1,6 @@
-
+'''
+Mercurial module Changes class submodule
+'''
from repoman.modules.vcs.changes import ChangesBase
from repoman._subprocess import repoman_popen
@@ -12,9 +14,14 @@ class Changes(ChangesBase):
vcs = 'hg'
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'''
with repoman_popen("hg status --no-status --modified .") as f:
changed = f.readlines()
self.changed = ["./" + elem.rstrip() for elem in changed]
diff --git a/pym/repoman/modules/vcs/hg/status.py b/pym/repoman/modules/vcs/hg/status.py
index 00587940c..a3081cb78 100644
--- a/pym/repoman/modules/vcs/hg/status.py
+++ b/pym/repoman/modules/vcs/hg/status.py
@@ -1,15 +1,32 @@
+'''
+Mercurial module Status class submodule
+'''
from repoman._portage import portage
from portage import os
from repoman._subprocess import repoman_popen
+
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
+ '''
myf = repoman_popen(
"hg status --no-status --unknown %s" %
(portage._shell_quote(checkdir_relative),))
@@ -23,12 +40,26 @@ class Status(object):
@staticmethod
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 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 dirname in [".hg"]
diff --git a/pym/repoman/modules/vcs/settings.py b/pym/repoman/modules/vcs/settings.py
index bcd5f187e..f51c3b250 100644
--- a/pym/repoman/modules/vcs/settings.py
+++ b/pym/repoman/modules/vcs/settings.py
@@ -89,5 +89,5 @@ class VCSSettings(object):
def changes(self):
if not self._changes:
changes = self.module_controller.get_class('%s_changes' % self.vcs)
- self._changes = changes(self.options, self.vcs)
+ self._changes = changes(self.options)
return self._changes
diff --git a/pym/repoman/modules/vcs/svn/__init__.py b/pym/repoman/modules/vcs/svn/__init__.py
index becb93e4f..6bb0b9af4 100644
--- a/pym/repoman/modules/vcs/svn/__init__.py
+++ b/pym/repoman/modules/vcs/svn/__init__.py
@@ -1,7 +1,7 @@
# Copyright 2014-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-doc = """SVN plug-in module for portage.
+doc = """Subversion (svn) plug-in module for portage.
Performs variaous subversion actions and checks on repositories."""
__doc__ = doc[:]
diff --git a/pym/repoman/modules/vcs/svn/changes.py b/pym/repoman/modules/vcs/svn/changes.py
index 639ee9f64..9a0efbf57 100644
--- a/pym/repoman/modules/vcs/svn/changes.py
+++ b/pym/repoman/modules/vcs/svn/changes.py
@@ -1,4 +1,6 @@
-
+'''
+Subversion module Changes class submodule
+'''
from repoman.modules.vcs.changes import ChangesBase
from repoman._subprocess import repoman_popen
@@ -12,9 +14,14 @@ class Changes(ChangesBase):
vcs = 'svn'
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'''
with repoman_popen("svn status") as f:
svnstatus = f.readlines()
self.changed = [
diff --git a/pym/repoman/modules/vcs/svn/status.py b/pym/repoman/modules/vcs/svn/status.py
index ea8e1027b..3b57149b8 100644
--- a/pym/repoman/modules/vcs/svn/status.py
+++ b/pym/repoman/modules/vcs/svn/status.py
@@ -1,5 +1,5 @@
'''
-SVN module Status class submodule
+Subversion module Status class submodule
'''
import logging
@@ -19,10 +19,22 @@ 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
+ '''
try:
myf = repoman_popen(
"svn status --depth=files --verbose " +
@@ -68,8 +80,8 @@ class Status(object):
Args:
vcs - A string identifying the version control system in use
- Returns:
- None (calls sys.exit on fatal problems)
+ Returns: boolean
+ (calls sys.exit on fatal problems)
"""
cmd = "svn status -u 2>&1 | egrep -v '^. +.*/digest-[^/]+' | head -n-1"
@@ -122,8 +134,17 @@ class Status(object):
@staticmethod
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 dirname in [".svn"]