From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/modules/vcs/bzr/, ...
Date: Sun, 31 Jan 2016 20:03:32 +0000 (UTC) [thread overview]
Message-ID: <1454270391.4369c655f1eee13e1ddd3047f867b7cfdb3e79cf.dolsen@gentoo> (raw)
commit: 4369c655f1eee13e1ddd3047f867b7cfdb3e79cf
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 30 07:58:04 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jan 31 19:59:51 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4369c655
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 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 e375b05..d5f3326 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 6eefaed..76ad591 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 ba60e2c..0b4587b 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 cdfb4b2..3ef91cc 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 24e2825..1917bde 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 e077767..eecd4a1 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 0342251..d0b6acd 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 5ab5f94..963abf6 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 6737dfb..2e39970 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 f4e1ec8..9729085 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 0058794..a3081cb 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 bcd5f18..f51c3b2 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 becb93e..6bb0b9a 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 639ee9f..9a0efbf 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 ea8e102..3b57149 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"]
next reply other threads:[~2016-01-31 20:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-31 20:03 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-03-11 1:07 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/, pym/repoman/modules/vcs/bzr/, Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454270391.4369c655f1eee13e1ddd3047f867b7cfdb3e79cf.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox