Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/vcs/cvs/, pym/repoman/modules/vcs/bzr/, ...
Date: Sat, 30 Jan 2016 08:00:28
Message-Id: 1454140684.7ed3cb06a165bdd933a2faf43ff839920cf5d704.dolsen@gentoo
1 commit: 7ed3cb06a165bdd933a2faf43ff839920cf5d704
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 30 07:58:04 2016 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 30 07:58:04 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7ed3cb06
7
8 repoman: Create docstrings for all new vcs module files
9
10 pym/repoman/modules/vcs/None/changes.py | 9 ++++++++-
11 pym/repoman/modules/vcs/None/status.py | 35 ++++++++++++++++++++++++++++++---
12 pym/repoman/modules/vcs/bzr/__init__.py | 2 +-
13 pym/repoman/modules/vcs/bzr/changes.py | 9 ++++++++-
14 pym/repoman/modules/vcs/bzr/status.py | 30 ++++++++++++++++++++++++++++
15 pym/repoman/modules/vcs/changes.py | 3 +++
16 pym/repoman/modules/vcs/cvs/__init__.py | 2 +-
17 pym/repoman/modules/vcs/cvs/changes.py | 9 ++++++++-
18 pym/repoman/modules/vcs/cvs/status.py | 18 +++++++++++++++++
19 pym/repoman/modules/vcs/git/__init__.py | 2 +-
20 pym/repoman/modules/vcs/git/changes.py | 9 ++++++++-
21 pym/repoman/modules/vcs/git/status.py | 33 +++++++++++++++++++++++++++----
22 pym/repoman/modules/vcs/hg/__init__.py | 2 +-
23 pym/repoman/modules/vcs/hg/changes.py | 9 ++++++++-
24 pym/repoman/modules/vcs/hg/status.py | 31 +++++++++++++++++++++++++++++
25 pym/repoman/modules/vcs/settings.py | 2 +-
26 pym/repoman/modules/vcs/svn/__init__.py | 2 +-
27 pym/repoman/modules/vcs/svn/changes.py | 9 ++++++++-
28 pym/repoman/modules/vcs/svn/status.py | 27 ++++++++++++++++++++++---
29 19 files changed, 221 insertions(+), 22 deletions(-)
30
31 diff --git a/pym/repoman/modules/vcs/None/changes.py b/pym/repoman/modules/vcs/None/changes.py
32 index f95af69..759b554 100644
33 --- a/pym/repoman/modules/vcs/None/changes.py
34 +++ b/pym/repoman/modules/vcs/None/changes.py
35 @@ -1,4 +1,6 @@
36 -
37 +'''
38 +None module Changes class submodule
39 +'''
40
41 from repoman.modules.vcs.changes import ChangesBase
42
43 @@ -11,7 +13,12 @@ class Changes(ChangesBase):
44 vcs = 'None'
45
46 def __init__(self, options):
47 + '''Class init
48 +
49 + @param options: commandline options
50 + '''
51 super(Changes, self).__init__(options)
52
53 def scan(self):
54 + '''VCS type scan function, looks for all detectable changes'''
55 pass
56
57 diff --git a/pym/repoman/modules/vcs/None/status.py b/pym/repoman/modules/vcs/None/status.py
58 index b23fa10..d6e5ca0 100644
59 --- a/pym/repoman/modules/vcs/None/status.py
60 +++ b/pym/repoman/modules/vcs/None/status.py
61 @@ -1,24 +1,53 @@
62 -
63 +'''
64 +None (non-VCS) module Status class submodule
65 +'''
66
67
68 class Status(object):
69 + '''Performs status checks on the svn repository'''
70
71 def __init__(self, qatracker, eadded):
72 + '''Class init
73 +
74 + @param qatracker: QATracker class instance
75 + @param eadded: list
76 + '''
77 self.qatracker = qatracker
78 self.eadded = eadded
79
80 def check(self, checkdir, checkdir_relative, xpkg):
81 + '''Perform the svn status check
82 +
83 + @param checkdir: string of the directory being checked
84 + @param checkdir_relative: string of the relative directory being checked
85 + @param xpkg: string of the package being checked
86 + @returns: boolean
87 + '''
88 return True
89
90 @staticmethod
91 - def supports_gpg_sign():
92 + def detect_conflicts(options):
93 + '''Are there any merge conflicts present in the VCS tracking system
94 +
95 + @param options: command line options
96 + @returns: Boolean
97 + '''
98 return False
99
100 @staticmethod
101 - def detect_conflicts(options):
102 + def supports_gpg_sign():
103 + '''Does this vcs system support gpg commit signatures
104 +
105 + @returns: Boolean
106 + '''
107 return False
108
109 @staticmethod
110 def isVcsDir(dirname):
111 + '''Is the directory belong to the vcs system
112 +
113 + @param dirname: string, directory name
114 + @returns: Boolean
115 + '''
116 return False
117
118
119 diff --git a/pym/repoman/modules/vcs/bzr/__init__.py b/pym/repoman/modules/vcs/bzr/__init__.py
120 index 1192782..4490ed8 100644
121 --- a/pym/repoman/modules/vcs/bzr/__init__.py
122 +++ b/pym/repoman/modules/vcs/bzr/__init__.py
123 @@ -1,7 +1,7 @@
124 # Copyright 2014-2015 Gentoo Foundation
125 # Distributed under the terms of the GNU General Public License v2
126
127 -doc = """BZR plug-in module for portage.
128 +doc = """Bazaar (bzr) plug-in module for portage.
129 Performs variaous Bazaar actions and checks on repositories."""
130 __doc__ = doc[:]
131
132
133 diff --git a/pym/repoman/modules/vcs/bzr/changes.py b/pym/repoman/modules/vcs/bzr/changes.py
134 index dab5d73..751d803 100644
135 --- a/pym/repoman/modules/vcs/bzr/changes.py
136 +++ b/pym/repoman/modules/vcs/bzr/changes.py
137 @@ -1,4 +1,6 @@
138 -
139 +'''
140 +Bazaar module Changes class submodule
141 +'''
142
143 from repoman.modules.vcs.changes import ChangesBase
144 from repoman._subprocess import repoman_popen
145 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
146 vcs = 'bzr'
147
148 def __init__(self, options):
149 + '''Class init
150 +
151 + @param options: commandline options
152 + '''
153 super(Changes, self).__init__(options)
154
155 def _scan(self):
156 + '''VCS type scan function, looks for all detectable changes'''
157 with repoman_popen("bzr status -S .") as f:
158 bzrstatus = f.readlines()
159 self.changed = [
160
161 diff --git a/pym/repoman/modules/vcs/bzr/status.py b/pym/repoman/modules/vcs/bzr/status.py
162 index e375b05..d5f3326 100644
163 --- a/pym/repoman/modules/vcs/bzr/status.py
164 +++ b/pym/repoman/modules/vcs/bzr/status.py
165 @@ -1,3 +1,6 @@
166 +'''
167 +Bazaar module Status class submodule
168 +'''
169
170 from repoman._portage import portage
171 from portage import os
172 @@ -5,12 +8,25 @@ from repoman._subprocess import repoman_popen
173
174
175 class Status(object):
176 + '''Performs status checks on the svn repository'''
177
178 def __init__(self, qatracker, eadded):
179 + '''Class init
180 +
181 + @param qatracker: QATracker class instance
182 + @param eadded: list
183 + '''
184 self.qatracker = qatracker
185 self.eadded = eadded
186
187 def check(self, checkdir, checkdir_relative, xpkg):
188 + '''Perform the svn status check
189 +
190 + @param checkdir: string of the directory being checked
191 + @param checkdir_relative: string of the relative directory being checked
192 + @param xpkg: string of the package being checked
193 + @returns: boolean
194 + '''
195 try:
196 myf = repoman_popen(
197 "bzr ls -v --kind=file " +
198 @@ -29,12 +45,26 @@ class Status(object):
199
200 @staticmethod
201 def detect_conflicts(options):
202 + '''Are there any merge conflicts present in the VCS tracking system
203 +
204 + @param options: command line options
205 + @returns: Boolean
206 + '''
207 return False
208
209 @staticmethod
210 def supports_gpg_sign():
211 + '''Does this vcs system support gpg commit signatures
212 +
213 + @returns: Boolean
214 + '''
215 return False
216
217 @staticmethod
218 def isVcsDir(dirname):
219 + '''Is the directory belong to the vcs system
220 +
221 + @param dirname: string, directory name
222 + @returns: Boolean
223 + '''
224 return dirname in [".bzr"]
225
226 diff --git a/pym/repoman/modules/vcs/changes.py b/pym/repoman/modules/vcs/changes.py
227 index b677964..558ca39 100644
228 --- a/pym/repoman/modules/vcs/changes.py
229 +++ b/pym/repoman/modules/vcs/changes.py
230 @@ -1,3 +1,6 @@
231 +'''
232 +Base Changes class
233 +'''
234
235 import os
236 from itertools import chain
237
238 diff --git a/pym/repoman/modules/vcs/cvs/__init__.py b/pym/repoman/modules/vcs/cvs/__init__.py
239 index ba60e2c..0b4587b 100644
240 --- a/pym/repoman/modules/vcs/cvs/__init__.py
241 +++ b/pym/repoman/modules/vcs/cvs/__init__.py
242 @@ -1,7 +1,7 @@
243 # Copyright 2014-2015 Gentoo Foundation
244 # Distributed under the terms of the GNU General Public License v2
245
246 -doc = """CVS plug-in module for portage.
247 +doc = """CVS (cvs) plug-in module for portage.
248 Performs variaous CVS actions and checks on repositories."""
249 __doc__ = doc[:]
250
251
252 diff --git a/pym/repoman/modules/vcs/cvs/changes.py b/pym/repoman/modules/vcs/cvs/changes.py
253 index ca07f1f..a8f3311 100644
254 --- a/pym/repoman/modules/vcs/cvs/changes.py
255 +++ b/pym/repoman/modules/vcs/cvs/changes.py
256 @@ -1,4 +1,6 @@
257 -
258 +'''
259 +CVS module Changes class submodule
260 +'''
261
262 from repoman._portage import portage
263 from repoman.modules.vcs.changes import ChangesBase
264 @@ -13,9 +15,14 @@ class Changes(ChangesBase):
265 vcs = 'cvs'
266
267 def __init__(self, options):
268 + '''Class init
269 +
270 + @param options: commandline options
271 + '''
272 super(Changes, self).__init__(options)
273
274 def _scan(self):
275 + '''VCS type scan function, looks for all detectable changes'''
276 tree = portage.cvstree.getentries("./", recursive=1)
277 self.changed = cvstree.findchanged(tree, recursive=1, basedir="./")
278 self.new = cvstree.findnew(tree, recursive=1, basedir="./")
279
280 diff --git a/pym/repoman/modules/vcs/cvs/status.py b/pym/repoman/modules/vcs/cvs/status.py
281 index 24e2825..1917bde 100644
282 --- a/pym/repoman/modules/vcs/cvs/status.py
283 +++ b/pym/repoman/modules/vcs/cvs/status.py
284 @@ -1,3 +1,6 @@
285 +'''
286 +CVS module Status class submodule
287 +'''
288
289 import logging
290 import subprocess
291 @@ -11,8 +14,14 @@ from portage import _unicode_encode, _unicode_decode
292
293
294 class Status(object):
295 + '''Performs status checks on the svn repository'''
296
297 def __init__(self, qatracker, eadded):
298 + '''Class init
299 +
300 + @param qatracker: QATracker class instance
301 + @param eadded: list
302 + '''
303 self.qatracker = qatracker
304 self.eadded = eadded
305
306 @@ -106,8 +115,17 @@ class Status(object):
307
308 @staticmethod
309 def supports_gpg_sign():
310 + '''Does this vcs system support gpg commit signatures
311 +
312 + @returns: Boolean
313 + '''
314 return False
315
316 @staticmethod
317 def isVcsDir(dirname):
318 + '''Is the directory belong to the vcs system
319 +
320 + @param dirname: string, directory name
321 + @returns: Boolean
322 + '''
323 return dirname in ["CVS"]
324
325 diff --git a/pym/repoman/modules/vcs/git/__init__.py b/pym/repoman/modules/vcs/git/__init__.py
326 index e077767..eecd4a1 100644
327 --- a/pym/repoman/modules/vcs/git/__init__.py
328 +++ b/pym/repoman/modules/vcs/git/__init__.py
329 @@ -1,7 +1,7 @@
330 # Copyright 2014-2015 Gentoo Foundation
331 # Distributed under the terms of the GNU General Public License v2
332
333 -doc = """Git plug-in module for portage.
334 +doc = """Git (git) plug-in module for portage.
335 Performs variaous git actions and checks on repositories."""
336 __doc__ = doc[:]
337
338
339 diff --git a/pym/repoman/modules/vcs/git/changes.py b/pym/repoman/modules/vcs/git/changes.py
340 index 26ffff3..3ce6e9d 100644
341 --- a/pym/repoman/modules/vcs/git/changes.py
342 +++ b/pym/repoman/modules/vcs/git/changes.py
343 @@ -1,4 +1,6 @@
344 -
345 +'''
346 +Git module Changes class submodule
347 +'''
348
349 from repoman.modules.vcs.changes import ChangesBase
350 from repoman._subprocess import repoman_popen
351 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
352 vcs = 'git'
353
354 def __init__(self, options):
355 + '''Class init
356 +
357 + @param options: commandline options
358 + '''
359 super(Changes, self).__init__(options)
360
361 def _scan(self):
362 + '''VCS type scan function, looks for all detectable changes'''
363 with repoman_popen(
364 "git diff-index --name-only "
365 "--relative --diff-filter=M HEAD") as f:
366
367 diff --git a/pym/repoman/modules/vcs/git/status.py b/pym/repoman/modules/vcs/git/status.py
368 index 5ab5f94..963abf6 100644
369 --- a/pym/repoman/modules/vcs/git/status.py
370 +++ b/pym/repoman/modules/vcs/git/status.py
371 @@ -1,3 +1,6 @@
372 +'''
373 +Git module Status class submodule
374 +'''
375
376 import re
377
378 @@ -7,12 +10,25 @@ from repoman._subprocess import repoman_popen, repoman_getstatusoutput
379
380
381 class Status(object):
382 + '''Performs status checks on the svn repository'''
383
384 def __init__(self, qatracker, eadded):
385 + '''Class init
386 +
387 + @param qatracker: QATracker class instance
388 + @param eadded: list
389 + '''
390 self.qatracker = qatracker
391 self.eadded = eadded
392
393 def check(self, checkdir, checkdir_relative, xpkg):
394 + '''Perform the svn status check
395 +
396 + @param checkdir: string of the directory being checked
397 + @param checkdir_relative: string of the relative directory being checked
398 + @param xpkg: string of the package being checked
399 + @returns: boolean
400 + '''
401 myf = repoman_popen(
402 "git ls-files --others %s" %
403 (portage._shell_quote(checkdir_relative),))
404 @@ -25,7 +41,20 @@ class Status(object):
405 return True
406
407 @staticmethod
408 + def detect_conflicts(options):
409 + '''Are there any merge conflicts present in the VCS tracking system
410 +
411 + @param options: command line options
412 + @returns: Boolean
413 + '''
414 + return False
415 +
416 + @staticmethod
417 def supports_gpg_sign():
418 + '''Does this vcs system support gpg commit signatures
419 +
420 + @returns: Boolean
421 + '''
422 status, cmd_output = \
423 repoman_getstatusoutput("git --version")
424 cmd_output = cmd_output.split()
425 @@ -40,10 +69,6 @@ class Status(object):
426 return False
427
428 @staticmethod
429 - def detect_conflicts(options):
430 - return False
431 -
432 - @staticmethod
433 def isVcsDir(dirname):
434 return dirname in [".git"]
435
436
437 diff --git a/pym/repoman/modules/vcs/hg/__init__.py b/pym/repoman/modules/vcs/hg/__init__.py
438 index 6737dfb..2e39970 100644
439 --- a/pym/repoman/modules/vcs/hg/__init__.py
440 +++ b/pym/repoman/modules/vcs/hg/__init__.py
441 @@ -1,7 +1,7 @@
442 # Copyright 2014-2015 Gentoo Foundation
443 # Distributed under the terms of the GNU General Public License v2
444
445 -doc = """HG plug-in module for portage.
446 +doc = """Mercurial (hg) plug-in module for portage.
447 Performs variaous mercurial actions and checks on repositories."""
448 __doc__ = doc[:]
449
450
451 diff --git a/pym/repoman/modules/vcs/hg/changes.py b/pym/repoman/modules/vcs/hg/changes.py
452 index 621b0d4..f7103bd 100644
453 --- a/pym/repoman/modules/vcs/hg/changes.py
454 +++ b/pym/repoman/modules/vcs/hg/changes.py
455 @@ -1,4 +1,6 @@
456 -
457 +'''
458 +Mercurial module Changes class submodule
459 +'''
460
461 from repoman.modules.vcs.changes import ChangesBase
462 from repoman._subprocess import repoman_popen
463 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
464 vcs = 'hg'
465
466 def __init__(self, options):
467 + '''Class init
468 +
469 + @param options: commandline options
470 + '''
471 super(Changes, self).__init__(options)
472
473 def _scan(self):
474 + '''VCS type scan function, looks for all detectable changes'''
475 with repoman_popen("hg status --no-status --modified .") as f:
476 changed = f.readlines()
477 self.changed = ["./" + elem.rstrip() for elem in changed]
478
479 diff --git a/pym/repoman/modules/vcs/hg/status.py b/pym/repoman/modules/vcs/hg/status.py
480 index 0058794..a3081cb 100644
481 --- a/pym/repoman/modules/vcs/hg/status.py
482 +++ b/pym/repoman/modules/vcs/hg/status.py
483 @@ -1,15 +1,32 @@
484 +'''
485 +Mercurial module Status class submodule
486 +'''
487
488 from repoman._portage import portage
489 from portage import os
490 from repoman._subprocess import repoman_popen
491
492 +
493 class Status(object):
494 + '''Performs status checks on the svn repository'''
495
496 def __init__(self, qatracker, eadded):
497 + '''Class init
498 +
499 + @param qatracker: QATracker class instance
500 + @param eadded: list
501 + '''
502 self.qatracker = qatracker
503 self.eadded = eadded
504
505 def check(self, checkdir, checkdir_relative, xpkg):
506 + '''Perform the svn status check
507 +
508 + @param checkdir: string of the directory being checked
509 + @param checkdir_relative: string of the relative directory being checked
510 + @param xpkg: string of the package being checked
511 + @returns: boolean
512 + '''
513 myf = repoman_popen(
514 "hg status --no-status --unknown %s" %
515 (portage._shell_quote(checkdir_relative),))
516 @@ -23,12 +40,26 @@ class Status(object):
517
518 @staticmethod
519 def detect_conflicts(options):
520 + '''Are there any merge conflicts present in the VCS tracking system
521 +
522 + @param options: command line options
523 + @returns: Boolean
524 + '''
525 return False
526
527 @staticmethod
528 def supports_gpg_sign():
529 + '''Does this vcs system support gpg commit signatures
530 +
531 + @returns: Boolean
532 + '''
533 return False
534
535 @staticmethod
536 def isVcsDir(dirname):
537 + '''Is the directory belong to the vcs system
538 +
539 + @param dirname: string, directory name
540 + @returns: Boolean
541 + '''
542 return dirname in [".hg"]
543
544 diff --git a/pym/repoman/modules/vcs/settings.py b/pym/repoman/modules/vcs/settings.py
545 index bcd5f18..f51c3b2 100644
546 --- a/pym/repoman/modules/vcs/settings.py
547 +++ b/pym/repoman/modules/vcs/settings.py
548 @@ -89,5 +89,5 @@ class VCSSettings(object):
549 def changes(self):
550 if not self._changes:
551 changes = self.module_controller.get_class('%s_changes' % self.vcs)
552 - self._changes = changes(self.options, self.vcs)
553 + self._changes = changes(self.options)
554 return self._changes
555
556 diff --git a/pym/repoman/modules/vcs/svn/__init__.py b/pym/repoman/modules/vcs/svn/__init__.py
557 index becb93e..6bb0b9a 100644
558 --- a/pym/repoman/modules/vcs/svn/__init__.py
559 +++ b/pym/repoman/modules/vcs/svn/__init__.py
560 @@ -1,7 +1,7 @@
561 # Copyright 2014-2015 Gentoo Foundation
562 # Distributed under the terms of the GNU General Public License v2
563
564 -doc = """SVN plug-in module for portage.
565 +doc = """Subversion (svn) plug-in module for portage.
566 Performs variaous subversion actions and checks on repositories."""
567 __doc__ = doc[:]
568
569
570 diff --git a/pym/repoman/modules/vcs/svn/changes.py b/pym/repoman/modules/vcs/svn/changes.py
571 index f12b47d..17ff5b5 100644
572 --- a/pym/repoman/modules/vcs/svn/changes.py
573 +++ b/pym/repoman/modules/vcs/svn/changes.py
574 @@ -1,4 +1,6 @@
575 -
576 +'''
577 +Subversion module Changes class submodule
578 +'''
579
580 from repoman.modules.vcs.changes import ChangesBase
581 from repoman._subprocess import repoman_popen
582 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
583 vcs = 'svn'
584
585 def __init__(self, options):
586 + '''Class init
587 +
588 + @param options: commandline options
589 + '''
590 super(Changes, self).__init__(options)
591
592 def _scan(self):
593 + '''VCS type scan function, looks for all detectable changes'''
594 with repoman_popen("svn status") as f:
595 svnstatus = f.readlines()
596 self.changed = [
597
598 diff --git a/pym/repoman/modules/vcs/svn/status.py b/pym/repoman/modules/vcs/svn/status.py
599 index ea8e102..3b57149 100644
600 --- a/pym/repoman/modules/vcs/svn/status.py
601 +++ b/pym/repoman/modules/vcs/svn/status.py
602 @@ -1,5 +1,5 @@
603 '''
604 -SVN module Status class submodule
605 +Subversion module Status class submodule
606 '''
607
608 import logging
609 @@ -19,10 +19,22 @@ class Status(object):
610 '''Performs status checks on the svn repository'''
611
612 def __init__(self, qatracker, eadded):
613 + '''Class init
614 +
615 + @param qatracker: QATracker class instance
616 + @param eadded: list
617 + '''
618 self.qatracker = qatracker
619 self.eadded = eadded
620
621 def check(self, checkdir, checkdir_relative, xpkg):
622 + '''Perform the svn status check
623 +
624 + @param checkdir: string of the directory being checked
625 + @param checkdir_relative: string of the relative directory being checked
626 + @param xpkg: string of the package being checked
627 + @returns: boolean
628 + '''
629 try:
630 myf = repoman_popen(
631 "svn status --depth=files --verbose " +
632 @@ -68,8 +80,8 @@ class Status(object):
633
634 Args:
635 vcs - A string identifying the version control system in use
636 - Returns:
637 - None (calls sys.exit on fatal problems)
638 + Returns: boolean
639 + (calls sys.exit on fatal problems)
640 """
641
642 cmd = "svn status -u 2>&1 | egrep -v '^. +.*/digest-[^/]+' | head -n-1"
643 @@ -122,8 +134,17 @@ class Status(object):
644
645 @staticmethod
646 def supports_gpg_sign():
647 + '''Does this vcs system support gpg commit signatures
648 +
649 + @returns: Boolean
650 + '''
651 return False
652
653 @staticmethod
654 def isVcsDir(dirname):
655 + '''Is the directory belong to the vcs system
656 +
657 + @param dirname: string, directory name
658 + @returns: Boolean
659 + '''
660 return dirname in [".svn"]