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/, pym/repoman/modules/vcs/bzr/, ...
Date: Sun, 31 Jan 2016 20:04:02
Message-Id: 1454270391.4369c655f1eee13e1ddd3047f867b7cfdb3e79cf.dolsen@gentoo
1 commit: 4369c655f1eee13e1ddd3047f867b7cfdb3e79cf
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: Sun Jan 31 19:59:51 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4369c655
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 | 8 +++++++-
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, 220 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 41ce347..519d311 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 6eefaed..76ad591 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 cdfb4b2..3ef91cc 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 import re
263
264 @@ -15,6 +17,10 @@ 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 self._tree = None
274
275
276 diff --git a/pym/repoman/modules/vcs/cvs/status.py b/pym/repoman/modules/vcs/cvs/status.py
277 index 24e2825..1917bde 100644
278 --- a/pym/repoman/modules/vcs/cvs/status.py
279 +++ b/pym/repoman/modules/vcs/cvs/status.py
280 @@ -1,3 +1,6 @@
281 +'''
282 +CVS module Status class submodule
283 +'''
284
285 import logging
286 import subprocess
287 @@ -11,8 +14,14 @@ from portage import _unicode_encode, _unicode_decode
288
289
290 class Status(object):
291 + '''Performs status checks on the svn repository'''
292
293 def __init__(self, qatracker, eadded):
294 + '''Class init
295 +
296 + @param qatracker: QATracker class instance
297 + @param eadded: list
298 + '''
299 self.qatracker = qatracker
300 self.eadded = eadded
301
302 @@ -106,8 +115,17 @@ class Status(object):
303
304 @staticmethod
305 def supports_gpg_sign():
306 + '''Does this vcs system support gpg commit signatures
307 +
308 + @returns: Boolean
309 + '''
310 return False
311
312 @staticmethod
313 def isVcsDir(dirname):
314 + '''Is the directory belong to the vcs system
315 +
316 + @param dirname: string, directory name
317 + @returns: Boolean
318 + '''
319 return dirname in ["CVS"]
320
321 diff --git a/pym/repoman/modules/vcs/git/__init__.py b/pym/repoman/modules/vcs/git/__init__.py
322 index e077767..eecd4a1 100644
323 --- a/pym/repoman/modules/vcs/git/__init__.py
324 +++ b/pym/repoman/modules/vcs/git/__init__.py
325 @@ -1,7 +1,7 @@
326 # Copyright 2014-2015 Gentoo Foundation
327 # Distributed under the terms of the GNU General Public License v2
328
329 -doc = """Git plug-in module for portage.
330 +doc = """Git (git) plug-in module for portage.
331 Performs variaous git actions and checks on repositories."""
332 __doc__ = doc[:]
333
334
335 diff --git a/pym/repoman/modules/vcs/git/changes.py b/pym/repoman/modules/vcs/git/changes.py
336 index 0342251..d0b6acd 100644
337 --- a/pym/repoman/modules/vcs/git/changes.py
338 +++ b/pym/repoman/modules/vcs/git/changes.py
339 @@ -1,4 +1,6 @@
340 -
341 +'''
342 +Git module Changes class submodule
343 +'''
344
345 from repoman.modules.vcs.changes import ChangesBase
346 from repoman._subprocess import repoman_popen
347 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
348 vcs = 'git'
349
350 def __init__(self, options):
351 + '''Class init
352 +
353 + @param options: commandline options
354 + '''
355 super(Changes, self).__init__(options)
356
357 def _scan(self):
358 + '''VCS type scan function, looks for all detectable changes'''
359 with repoman_popen(
360 "git diff-index --name-only "
361 "--relative --diff-filter=M HEAD") as f:
362
363 diff --git a/pym/repoman/modules/vcs/git/status.py b/pym/repoman/modules/vcs/git/status.py
364 index 5ab5f94..963abf6 100644
365 --- a/pym/repoman/modules/vcs/git/status.py
366 +++ b/pym/repoman/modules/vcs/git/status.py
367 @@ -1,3 +1,6 @@
368 +'''
369 +Git module Status class submodule
370 +'''
371
372 import re
373
374 @@ -7,12 +10,25 @@ from repoman._subprocess import repoman_popen, repoman_getstatusoutput
375
376
377 class Status(object):
378 + '''Performs status checks on the svn repository'''
379
380 def __init__(self, qatracker, eadded):
381 + '''Class init
382 +
383 + @param qatracker: QATracker class instance
384 + @param eadded: list
385 + '''
386 self.qatracker = qatracker
387 self.eadded = eadded
388
389 def check(self, checkdir, checkdir_relative, xpkg):
390 + '''Perform the svn status check
391 +
392 + @param checkdir: string of the directory being checked
393 + @param checkdir_relative: string of the relative directory being checked
394 + @param xpkg: string of the package being checked
395 + @returns: boolean
396 + '''
397 myf = repoman_popen(
398 "git ls-files --others %s" %
399 (portage._shell_quote(checkdir_relative),))
400 @@ -25,7 +41,20 @@ class Status(object):
401 return True
402
403 @staticmethod
404 + def detect_conflicts(options):
405 + '''Are there any merge conflicts present in the VCS tracking system
406 +
407 + @param options: command line options
408 + @returns: Boolean
409 + '''
410 + return False
411 +
412 + @staticmethod
413 def supports_gpg_sign():
414 + '''Does this vcs system support gpg commit signatures
415 +
416 + @returns: Boolean
417 + '''
418 status, cmd_output = \
419 repoman_getstatusoutput("git --version")
420 cmd_output = cmd_output.split()
421 @@ -40,10 +69,6 @@ class Status(object):
422 return False
423
424 @staticmethod
425 - def detect_conflicts(options):
426 - return False
427 -
428 - @staticmethod
429 def isVcsDir(dirname):
430 return dirname in [".git"]
431
432
433 diff --git a/pym/repoman/modules/vcs/hg/__init__.py b/pym/repoman/modules/vcs/hg/__init__.py
434 index 6737dfb..2e39970 100644
435 --- a/pym/repoman/modules/vcs/hg/__init__.py
436 +++ b/pym/repoman/modules/vcs/hg/__init__.py
437 @@ -1,7 +1,7 @@
438 # Copyright 2014-2015 Gentoo Foundation
439 # Distributed under the terms of the GNU General Public License v2
440
441 -doc = """HG plug-in module for portage.
442 +doc = """Mercurial (hg) plug-in module for portage.
443 Performs variaous mercurial actions and checks on repositories."""
444 __doc__ = doc[:]
445
446
447 diff --git a/pym/repoman/modules/vcs/hg/changes.py b/pym/repoman/modules/vcs/hg/changes.py
448 index f4e1ec8..9729085 100644
449 --- a/pym/repoman/modules/vcs/hg/changes.py
450 +++ b/pym/repoman/modules/vcs/hg/changes.py
451 @@ -1,4 +1,6 @@
452 -
453 +'''
454 +Mercurial module Changes class submodule
455 +'''
456
457 from repoman.modules.vcs.changes import ChangesBase
458 from repoman._subprocess import repoman_popen
459 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
460 vcs = 'hg'
461
462 def __init__(self, options):
463 + '''Class init
464 +
465 + @param options: commandline options
466 + '''
467 super(Changes, self).__init__(options)
468
469 def _scan(self):
470 + '''VCS type scan function, looks for all detectable changes'''
471 with repoman_popen("hg status --no-status --modified .") as f:
472 changed = f.readlines()
473 self.changed = ["./" + elem.rstrip() for elem in changed]
474
475 diff --git a/pym/repoman/modules/vcs/hg/status.py b/pym/repoman/modules/vcs/hg/status.py
476 index 0058794..a3081cb 100644
477 --- a/pym/repoman/modules/vcs/hg/status.py
478 +++ b/pym/repoman/modules/vcs/hg/status.py
479 @@ -1,15 +1,32 @@
480 +'''
481 +Mercurial module Status class submodule
482 +'''
483
484 from repoman._portage import portage
485 from portage import os
486 from repoman._subprocess import repoman_popen
487
488 +
489 class Status(object):
490 + '''Performs status checks on the svn repository'''
491
492 def __init__(self, qatracker, eadded):
493 + '''Class init
494 +
495 + @param qatracker: QATracker class instance
496 + @param eadded: list
497 + '''
498 self.qatracker = qatracker
499 self.eadded = eadded
500
501 def check(self, checkdir, checkdir_relative, xpkg):
502 + '''Perform the svn status check
503 +
504 + @param checkdir: string of the directory being checked
505 + @param checkdir_relative: string of the relative directory being checked
506 + @param xpkg: string of the package being checked
507 + @returns: boolean
508 + '''
509 myf = repoman_popen(
510 "hg status --no-status --unknown %s" %
511 (portage._shell_quote(checkdir_relative),))
512 @@ -23,12 +40,26 @@ class Status(object):
513
514 @staticmethod
515 def detect_conflicts(options):
516 + '''Are there any merge conflicts present in the VCS tracking system
517 +
518 + @param options: command line options
519 + @returns: Boolean
520 + '''
521 return False
522
523 @staticmethod
524 def supports_gpg_sign():
525 + '''Does this vcs system support gpg commit signatures
526 +
527 + @returns: Boolean
528 + '''
529 return False
530
531 @staticmethod
532 def isVcsDir(dirname):
533 + '''Is the directory belong to the vcs system
534 +
535 + @param dirname: string, directory name
536 + @returns: Boolean
537 + '''
538 return dirname in [".hg"]
539
540 diff --git a/pym/repoman/modules/vcs/settings.py b/pym/repoman/modules/vcs/settings.py
541 index bcd5f18..f51c3b2 100644
542 --- a/pym/repoman/modules/vcs/settings.py
543 +++ b/pym/repoman/modules/vcs/settings.py
544 @@ -89,5 +89,5 @@ class VCSSettings(object):
545 def changes(self):
546 if not self._changes:
547 changes = self.module_controller.get_class('%s_changes' % self.vcs)
548 - self._changes = changes(self.options, self.vcs)
549 + self._changes = changes(self.options)
550 return self._changes
551
552 diff --git a/pym/repoman/modules/vcs/svn/__init__.py b/pym/repoman/modules/vcs/svn/__init__.py
553 index becb93e..6bb0b9a 100644
554 --- a/pym/repoman/modules/vcs/svn/__init__.py
555 +++ b/pym/repoman/modules/vcs/svn/__init__.py
556 @@ -1,7 +1,7 @@
557 # Copyright 2014-2015 Gentoo Foundation
558 # Distributed under the terms of the GNU General Public License v2
559
560 -doc = """SVN plug-in module for portage.
561 +doc = """Subversion (svn) plug-in module for portage.
562 Performs variaous subversion actions and checks on repositories."""
563 __doc__ = doc[:]
564
565
566 diff --git a/pym/repoman/modules/vcs/svn/changes.py b/pym/repoman/modules/vcs/svn/changes.py
567 index 639ee9f..9a0efbf 100644
568 --- a/pym/repoman/modules/vcs/svn/changes.py
569 +++ b/pym/repoman/modules/vcs/svn/changes.py
570 @@ -1,4 +1,6 @@
571 -
572 +'''
573 +Subversion module Changes class submodule
574 +'''
575
576 from repoman.modules.vcs.changes import ChangesBase
577 from repoman._subprocess import repoman_popen
578 @@ -12,9 +14,14 @@ class Changes(ChangesBase):
579 vcs = 'svn'
580
581 def __init__(self, options):
582 + '''Class init
583 +
584 + @param options: commandline options
585 + '''
586 super(Changes, self).__init__(options)
587
588 def _scan(self):
589 + '''VCS type scan function, looks for all detectable changes'''
590 with repoman_popen("svn status") as f:
591 svnstatus = f.readlines()
592 self.changed = [
593
594 diff --git a/pym/repoman/modules/vcs/svn/status.py b/pym/repoman/modules/vcs/svn/status.py
595 index ea8e102..3b57149 100644
596 --- a/pym/repoman/modules/vcs/svn/status.py
597 +++ b/pym/repoman/modules/vcs/svn/status.py
598 @@ -1,5 +1,5 @@
599 '''
600 -SVN module Status class submodule
601 +Subversion module Status class submodule
602 '''
603
604 import logging
605 @@ -19,10 +19,22 @@ class Status(object):
606 '''Performs status checks on the svn repository'''
607
608 def __init__(self, qatracker, eadded):
609 + '''Class init
610 +
611 + @param qatracker: QATracker class instance
612 + @param eadded: list
613 + '''
614 self.qatracker = qatracker
615 self.eadded = eadded
616
617 def check(self, checkdir, checkdir_relative, xpkg):
618 + '''Perform the svn status check
619 +
620 + @param checkdir: string of the directory being checked
621 + @param checkdir_relative: string of the relative directory being checked
622 + @param xpkg: string of the package being checked
623 + @returns: boolean
624 + '''
625 try:
626 myf = repoman_popen(
627 "svn status --depth=files --verbose " +
628 @@ -68,8 +80,8 @@ class Status(object):
629
630 Args:
631 vcs - A string identifying the version control system in use
632 - Returns:
633 - None (calls sys.exit on fatal problems)
634 + Returns: boolean
635 + (calls sys.exit on fatal problems)
636 """
637
638 cmd = "svn status -u 2>&1 | egrep -v '^. +.*/digest-[^/]+' | head -n-1"
639 @@ -122,8 +134,17 @@ class Status(object):
640
641 @staticmethod
642 def supports_gpg_sign():
643 + '''Does this vcs system support gpg commit signatures
644 +
645 + @returns: Boolean
646 + '''
647 return False
648
649 @staticmethod
650 def isVcsDir(dirname):
651 + '''Is the directory belong to the vcs system
652 +
653 + @param dirname: string, directory name
654 + @returns: Boolean
655 + '''
656 return dirname in [".svn"]