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