COMMON_PYLINT = --rcfile=/dev/null --reports=n \
--msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
--dummy-variables-rgx='^_'
-PYLINTOPTS = "C0103,C0301,C0326,C0111,W0110,W0141,W0311,W0312,W0603"
+PYLINTOPTS = "C0103,C0301,C0302,C0326,C1001,C0111,R0903,R0912,R0915,W0110,W0141,W0311,W0312,W0603"
pylint:
@pylint $(COMMON_PYLINT) --disable=$(PYLINTOPTS) src
"Capture the state of an RCS revision item in the log."
def __init__(self, master, revno):
self.master = master
- self.revno = revno;
+ self.revno = revno
self.revision = None
self.log = ""
self.date = None
def unixtime(self):
try:
return calendar.timegm(time.strptime(self.date, "%Y-%m-%dT%H:%M:%SZ"))
- except TypeError, ValueError:
+ except (TypeError, ValueError):
croak("garbled date %s" % self.date)
class History:
self.revlist = []
self.symbols = {}
self.branch = "trunk"
+ self.lockrevs = []
if not os.path.exists(backend.master(self.name)):
croak("%s is not registered" % self.name)
backend.parse(self)
"Is this a branch symbol?"
return ".0" in symbol
-def help_method(*args):
+def help_method(*_args):
"Summarize src commands, or (with argument) show help for a single command."
print"""
A 'revision' is a 1-origin integer, or a tag name designating an
co is a synonym for checkout.
src status ['file'...]
- A = added, U = unmodified, M = modified, ! = missing, ? = not tracked,
+ A = added, C = unmodified, M = modified, ! = missing, ? = not tracked,
I = ignored, L = locked (recover with src checkout). The L
status should only occur if you have used RCS directly on a file.
if not os.path.exists(repodir):
croak("repository subdirectory %s does not exist" % repodir)
self.start = self.end = None
+ if type(args) == type(()):
+ args = list(args)
self.args = list(args)
revspec = None
if self.args:
else:
backend.add(arg)
if not quiet and len(ctx.args) > 1:
- announce("%s -> 0" % arg)
+ announce("%s -> 0" % arg)
class CommentContext:
def __init__(self, legend, args):
croak("I see no '%s' here." % arg)
elif not os.path.exists(backend.master(arg)):
croak("%s is not registered." % arg)
- comment.edit()
+ comment.edit()
for arg in ctx.args:
with backend.lifter(arg):
backend.checkin(arg, comment.content())
if not quiet and len(args) > 1:
- announce("%s -> %d" % (arg, len(History(arg))))
+ announce("%s -> %d" % (arg, len(History(arg))))
def amend_method(*args):
"Amend coments in stored revisions."
metadata.revno_to_rcs(ctx.start),
comment.content())
if not quiet and len(args) > 1:
- announce("%s : %d" % (arg, len(metadata)))
+ announce("%s : %d" % (arg, len(metadata)))
def list_method(*args):
"Generate a summary listing of commits, one line per commit."
# there's a tiny race window here.
os.utime(backend.master(arg, None))
if not quiet and len(args) > 1:
- announce("%s <- %d" % (arg, ctx.start))
+ announce("%s <- %d" % (arg, ctx.start))
def status_method(*args):
"Get status of some or all fles."
"Move a file and its history."
do_or_die("mv {0} {1} && mv {2} {3}".format(source, target,
self.master(source),
- self.master(target)))
+ self.master(target)))
def copy(self, source, target):
"Copy a file and its history."
do_or_die("cp {0} {1} && cp {2} {3}".format(source, target,
self.master(source),
- self.master(target)))
+ self.master(target)))
def diff(self, diffspec1, diffspec2, diffopts, arg):
"Report a diff."
if diffspec1:
def parse(self, metadata):
"Get and parse the RCS log output for this file."
with popen_or_die("cd %s >/dev/null; rlog %s 2>/dev/null; cd ..>/dev/null" % (repodir, metadata.name)) as fp:
- metadata.revlist = []
- metadata.lockrevs = []
maxrevno = 0
if debug >= DEBUG_PARSE:
sys.stderr.write("\t-> init\n")
break
elif metadata.revlist:
metadata.revlist[-1].log += line
- # Now that we have the symbol table...
+ # Now that we have the symbol table...
if metadata.branch != "trunk":
for (k, v) in metadata.symbols.items():
if v == metadata.branch: