Package: reposurgeon
Version: 3.42-2
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Hi Anthony,

We have noticed that reposurgeon fails to build in Ubuntu, because Ubuntu
has updated pylint to version 1.7.2, bringing with it new warnings:

$ make -e --quiet pylint

************* Module reposurgeon
reposurgeon:1041: [W0621(redefined-outer-name), 
GitExtractor.find_all_references] Redefining name 'line' from outer scope (line 
1030)
reposurgeon:1151: [R1705(no-else-return), HgExtractor.hg_or_die] Unnecessary 
"else" after "return"
reposurgeon:1170: [C1801(len-as-condition), HgExtractor.hg_with_err] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:1362: [C1801(len-as-condition), HgExtractor.checkout] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:1367: [C1801(len-as-condition), HgExtractor.checkout] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:2017: [R1705(no-else-return), Tag.showlegacy] Unnecessary "else" 
after "return"
reposurgeon:2288: [R1705(no-else-return), FileOp.relevant] Unnecessary "else" 
after "return"
reposurgeon:2415: [R1705(no-else-return), Commit.showlegacy] Unnecessary "else" 
after "return"
reposurgeon:2688: [R1705(no-else-return), Commit.descended_from] Unnecessary 
"else" after "return"
reposurgeon:3169: [R1705(no-else-return), PathMap._split_path] Unnecessary 
"else" after "return"
reposurgeon:5233: [R1705(no-else-return), SubversionDumper.commitbranch] 
Unnecessary "else" after "return"
reposurgeon:5251: [R1705(no-else-return), SubversionDumper.svnbranch] 
Unnecessary "else" after "return"
reposurgeon:5340: [R1704(redefined-argument-from-local), 
SubversionDumper.directory_create] Redefining argument with the local name 
'path'
reposurgeon:5506: [C1801(len-as-condition), SubversionDumper.dump] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:5631: [R1705(no-else-return), Repository.subdir] Unnecessary "else" 
after "return"
reposurgeon:5974: [R1705(no-else-return), Repository.tagify_empty.default_name] 
Unnecessary "else" after "return"
reposurgeon:6108: [R1705(no-else-return), Repository.export_style] Unnecessary 
"else" after "return"
reposurgeon:6266: [R1705(no-else-return), Repository.__compose] Unnecessary 
"else" after "return"
reposurgeon:6273: [R1705(no-else-return), Repository.__compose] Unnecessary 
"else" after "return"
reposurgeon:6307: [R1705(no-else-return), Repository.__compose] Unnecessary 
"else" after "return"
reposurgeon:6316: [R1705(no-else-return), Repository.__compose] Unnecessary 
"else" after "return"
reposurgeon:6334: [R1705(no-else-return), Repository.__compose] Unnecessary 
"else" after "return"
reposurgeon:6705: [C1801(len-as-condition), Repository.resort] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:6711: [C1801(len-as-condition), Repository.resort] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:6715: [C1801(len-as-condition), Repository.resort] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:6723: [C1801(len-as-condition), Repository.resort] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:6725: [C1801(len-as-condition), Repository.resort] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:6908: [C1801(len-as-condition), Repository.graft] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:7433: [R1705(no-else-return), RepositoryList.uniquify] Unnecessary 
"else" after "return"
reposurgeon:7930: [R0123(literal-comparison), RepoSurgeon.postcmd] Comparison 
to literal
reposurgeon:8008: [R1705(no-else-return), RepoSurgeon.pop] Unnecessary "else" 
after "return"
reposurgeon:8500: [R1705(no-else-return), RepoSurgeon.amp_handler] Unnecessary 
"else" after "return"
reposurgeon:8524: [R1705(no-else-return), RepoSurgeon.pre_handler] Unnecessary 
"else" after "return"
reposurgeon:8530: [R1705(no-else-return), RepoSurgeon.suc_handler] Unnecessary 
"else" after "return"
reposurgeon:8612: [C1801(len-as-condition), RepoSurgeon.edit] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:9005: [R1704(redefined-argument-from-local), 
RepoSurgeon.do_history] Redefining argument with the local name 'line'
reposurgeon:10644: [C1801(len-as-condition), RepoSurgeon.do_divide] Do not use 
`len(SEQUENCE)` as condition value
reposurgeon:11277: [C1801(len-as-condition), RepoSurgeon.do_reparent] Do not 
use `len(SEQUENCE)` as condition value
reposurgeon:11806: [R1705(no-else-return), 
RepoSurgeon.do_references.substitute] Unnecessary "else" after "return"
reposurgeon:11908: [R1704(redefined-argument-from-local), RepoSurgeon.do_diff] 
Redefining argument with the local name 'line'
reposurgeon:12076: [R1704(redefined-argument-from-local), 
RepoSurgeon.do_define] Redefining argument with the local name 'line'
reposurgeon:12109: [R1704(redefined-argument-from-local), RepoSurgeon.do_do] 
Redefining argument with the local name 'line'
reposurgeon:12275: [W0231(super-init-not-called), OrderedSet.__init__] __init__ 
method from base class 'MutableSet' is not called
reposurgeon:12366: [W0621(redefined-outer-name), main] Redefining name 'arg' 
from outer scope (line 12365)

-----------------------------------
Your code has been rated at 9.95/10

This is not a fatal error today, but I believe pylint was updated as part of
the python3.6 transition in Debian so we can expect this build failure to
start to apply to Debian soon as well.

This is also a regression vs. reposurgeon 3.37-1; I have not looked to see
if that's because the previous version did not have a pylint test, or if
there were other changes.

Since 3.42-2 also has an extensive unit test suite that runs at build time,
I've gone ahead and made changes to the code to pass the pylint tests,
uploading the result to Ubuntu.  Please find the resulting patch attached.

Hope that helps,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru reposurgeon-3.42/debian/patches/pylint-fixes.patch 
reposurgeon-3.42/debian/patches/pylint-fixes.patch
--- reposurgeon-3.42/debian/patches/pylint-fixes.patch  1969-12-31 
16:00:00.000000000 -0800
+++ reposurgeon-3.42/debian/patches/pylint-fixes.patch  2017-08-27 
00:39:48.000000000 -0700
@@ -0,0 +1,571 @@
+Description: fixes for new python linting warnings
+ pylint 1.7.2 introduces a number of new warnings.  Fix the code to pass.
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+
+Index: reposurgeon-3.42/reposurgeon
+===================================================================
+--- reposurgeon-3.42.orig/reposurgeon
++++ reposurgeon-3.42/reposurgeon
+@@ -1027,8 +1027,8 @@
+                     self.refs[ref[5:]] = polystr(fp.read()).strip()
+         baton.twirl()
+         with popen_or_die("git tag -l") as fp:
+-            for line in fp:
+-                tag = polystr(line).strip()
++            for tagline in fp:
++                tag = polystr(tagline).strip()
+                 with popen_or_die("git rev-parse %s" % tag) as fp:
+                     taghash = polystr(fp.read()).strip()
+                 # Annotated tags are first-class objects with their
+@@ -1150,13 +1150,12 @@
+     def hg_or_die(self, *cmdline):
+         if hglib is not None and self.hgclient is not None:
+             return self._hg_or_die(self.hgclient, *cmdline)
+-        else:
+-            # We know this quoting is sufficient, because the only variables
+-            # we ever pass into this function are revision IDs, which are
+-            # shell-safe.  It'd be nice to use pipes.quote or shlex.quote, but
+-            # pipes.quote is deprecated in 2.7 and shlex.quote doesn't appear
+-            # until 3.3.
+-            return popen_or_die("hg "+" ".join(["'%s'"%(s,) for s in 
cmdline]))
++        # We know this quoting is sufficient, because the only variables
++        # we ever pass into this function are revision IDs, which are
++        # shell-safe.  It'd be nice to use pipes.quote or shlex.quote, but
++        # pipes.quote is deprecated in 2.7 and shlex.quote doesn't appear
++        # until 3.3.
++        return popen_or_die("hg "+" ".join(["'%s'"%(s,) for s in cmdline]))
+     def hg_with_err(self, *cmdline):
+         "Call hg and collect the error code. Returns the data directly, not a 
stream."
+         errcode = []
+@@ -1167,7 +1166,7 @@
+                                          errhandler=lambda e: 
[errcode.append(e), True][1]
+                                          ) as fp:
+             output = polystr(fp.read())
+-        return (output, errcode[0] if len(errcode) > 0 else 0)
++        return (output, errcode[0] if errcode else 0)
+     def hg_capture(self, *cmdline):
+         with self.hg_or_die(*cmdline) as fp:
+             output = polystr(fp.read())
+@@ -1359,12 +1358,12 @@
+                         dirnames.remove(".hg") # Don't remove the very first 
.hg
+                 for filename in filenames:
+                     os.remove(os.path.join(dirpath,filename))
+-                if len(dirnames) == 0:
++                if not dirnames:
+                     os.removedirs(dirpath)
+ 
+             # If there are subrepos, use revert to fake an update, but exclude
+             # the subrepo paths, which are probably borken.
+-            if len(subrepo_args) > 0:
++            if subrepo_args:
+                 self.hg_capture("revert", "--all", "--no-backup", "-r", rev, 
*subrepo_args)
+                 os.chdir(pwd)
+                 self.hg_capture("debugsetparents", rev)
+@@ -2016,8 +2015,7 @@
+         # Special case for Subversion
+         if self.repo and self.repo.vcs and self.repo.vcs.name == "svn":
+             return "r" + self.legacy_id
+-        else:
+-            return self.legacy_id
++        return self.legacy_id
+     def tags(self, _modifiers, eventnum, _cols):
+         "Enable do_tags() to report tags."
+         return "%6d\ttag\t%s" % (eventnum+1, self.name)
+@@ -2287,8 +2285,7 @@
+         "Do two fileops touch the same file(s)?"
+         if self.op == "deleteall" or other.op == "deleteall":
+             return True
+-        else:
+-            return self.paths() & other.paths()
++        return self.paths() & other.paths()
+     def dump(self, vcs=None, options=None):
+         "Dump this fileop in import-stream format."
+         pacify_pylint(vcs)
+@@ -2414,8 +2411,7 @@
+         # Special case for Subversion
+         if self.repo and self.repo.vcs and self.repo.vcs.name == "svn":
+             return "r" + self.legacy_id
+-        else:
+-            return self.legacy_id
++        return self.legacy_id
+     def lister(self, _modifiers, eventnum, cols):
+         "Enable do_list() to report commits."
+         topline = self.comment.split("\n")[0]
+@@ -2689,9 +2685,8 @@
+             return False
+         elif other in self.parents():
+             return True
+-        else:
+-            return any(parent.descended_from(other) \
+-                        for parent in self.parents())
++        return any(parent.descended_from(other) \
++                   for parent in self.parents())
+     def cliques(self):
+         "Return a dictionary mapping filenames to associated M cliques."
+         cliques = collections.OrderedDict()
+@@ -3169,9 +3164,8 @@
+         if isinstance(path, str):
+             components = [f for f in os.path.normpath(path).split(os.sep) if 
f]
+             return (components.pop() if components else None, components)
+-        else:
+-            return (PathMap._self_value,
+-                    [f for f in os.path.normpath(path[0]).split(os.sep) if f])
++        return (PathMap._self_value,
++                [f for f in os.path.normpath(path[0]).split(os.sep) if f])
+ 
+ class RepoStreamer:
+     "Repository factory driver class for all repo analyzers."
+@@ -5232,8 +5226,7 @@
+                 candidatebranch = childbranch
+         if candidatebranch and not commit.branch.startswith("refs/heads/"):
+             return candidatebranch
+-        else:
+-            return commit.branch
++        return commit.branch
+     @staticmethod
+     def svnbranch(branch):
+         "The branch directory corresponding to a specified git branch."
+@@ -5250,8 +5243,7 @@
+             svnbase += "-git"
+         if segments[1] == "tags":
+             return os.path.join("tags", svnbase)
+-        else:
+-            return os.path.join("branches", svnbase)
++        return os.path.join("branches", svnbase)
+     def svnize(self, branch, path=""):
+         "Return SVN path corresponding to a specified gitspace branch and 
path."
+         if self.nobranch:
+@@ -5337,16 +5329,16 @@
+                 fullpath = os.path.join(svnout, parentdir)
+                 if fullpath not in self.pathmap[revision]:
+                     creations.append((fullpath, None, None))
+-        for (path, from_rev, from_path) in creations:
++        for (fullpath, from_rev, from_path) in creations:
+             SubversionDumper.dump_node(fp,
+-                                       path=path,
++                                       path=fullpath,
+                                        kind="dir",
+                                        action="add",
+                                        from_rev=from_rev,
+                                        from_path=from_path)
+-            self.pathmap[revision][path] = 
SubversionDumper.FlowState(revision)
+-            self.pathmap[revision][path].is_directory = True
+-            parentdir = os.path.dirname(path)
++            self.pathmap[revision][fullpath] = 
SubversionDumper.FlowState(revision)
++            self.pathmap[revision][fullpath].is_directory = True
++            parentdir = os.path.dirname(fullpath)
+             if parentdir in self.pathmap[revision]:
+                 self.pathmap[revision][parentdir].subfiles += 1
+     def filemodify(self, fp, revision, branch, mode, ref, path, inline, 
parents):
+@@ -5503,7 +5495,7 @@
+                                 content = 
content.replace(SubversionDumper.dfltignores,"") # Strip out default SVN ignores
+                                 if svnpath not in self.pathmap[revision]:
+                                     self.pathmap[revision][svnpath] = 
SubversionDumper.FlowState(revision)
+-                                if len(content) > 0 or "svn:ignore" in 
self.pathmap[revision][svnpath].props:
++                                if content or "svn:ignore" in 
self.pathmap[revision][svnpath].props:
+                                     
self.pathmap[revision][svnpath].props["svn:ignore"] = content
+                                     SubversionDumper.dump_node(fp,
+                                               path=os.path.dirname(svnpath),
+@@ -5630,8 +5622,7 @@
+             name = self.name
+         if not name:
+             return os.path.join(self.basedir, ".rs" + repr(os.getpid()))
+-        else:
+-            return os.path.join(self.basedir, ".rs" + repr(os.getpid())+ "-" 
+ name)
++        return os.path.join(self.basedir, ".rs" + repr(os.getpid())+ "-" + 
name)
+     def makedir(self):
+         try:
+             if debug_enable(DEBUG_SHUFFLE):
+@@ -5975,8 +5966,7 @@
+                 return "emptycommit-" + commit.legacy_id
+             elif commit.mark:
+                 return "emptycommit-mark" + commit.mark[1:]
+-            else:
+-                return "emptycommit-index" + commit.index()
++            return "emptycommit-index" + commit.index()
+         # Use a separate loop because delete() invalidates manifests.
+         if canonicalize:
+             for _, commit in self.iterevents(commits, types=Commit):
+@@ -6107,9 +6097,8 @@
+         "How should we tune the export dump format?"
+         if self.vcs:
+             return self.vcs.styleflags
+-        else:
+-            # Default to git style
+-            return ("nl-after-commit",)
++        # Default to git style
++        return ("nl-after-commit",)
+     def fast_export(self, selection, fp, options, target=None, 
progress=False):
+         "Dump the repo object in Subversion dump or fast-export format."
+         if target and target.name == "svn":
+@@ -6265,8 +6254,7 @@
+         elif left.op == "M" and right.op in "D":
+             if self.ancestor_count(event, left.path) == 1:
+                 return (True, None, None, None, 1)
+-            else:
+-                return (True, right, None, None, 2)
++            return (True, right, None, None, 2)
+         elif left.op == "M" and right.op == "R":
+             # M a + R a b -> R a b M b, so R falls towards start of list
+             if left.path == right.source:
+@@ -6274,10 +6262,9 @@
+                     # M a has no ancestors, preceding R can be dropped
+                     left.path = right.target
+                     return (True, left, None, None, 3)
+-                else:
+-                    # M a has ancestors, R is still needed
+-                    left.path = right.target
+-                    return (True, right, left, None, 4)
++                # M a has ancestors, R is still needed
++                left.path = right.target
++                return (True, right, left, None, 4)
+             # M b + R a b can't happen.  If you try to generate this with
+             # git mv it throws an error.  An ordinary mv results in D b M a.
+             elif left.path == right.target:
+@@ -6307,8 +6294,7 @@
+             if left.path == right.source:
+                 return (False, left, right,
+                         "R or C of %s after deletion?" % left.path, -3)
+-            else:
+-                return (False, left, right, None, 8)
++            return (False, left, right, None, 8)
+         #
+         # First op R
+         #
+@@ -6317,11 +6303,10 @@
+                 # Rename followed by delete of target composes to source 
delete
+                 right.path = left.source
+                 return (True, None, right, None, 9)
+-            else:
+-                # On rename followed by delete of source discard the delete
+-                # but user should be warned.
+-                return (False, left, None,
+-                        "delete of %s after renaming to %s?" % (right.path, 
left.source), -4)
++            # On rename followed by delete of source discard the delete
++            # but user should be warned.
++            return (False, left, None,
++                    "delete of %s after renaming to %s?" % (right.path, 
left.source), -4)
+         # Rename followed by deleteall shouldn't be possible
+         elif pair == ("R", "deleteall") and left.target == right.path:
+             return (False, None, right,
+@@ -6334,10 +6319,9 @@
+             if left.target == right.source:
+                 left.target = right.target
+                 return (True, left, None, None, 11)
+-            else:
+-                return (False, left, right,
+-                        "R %s %s is inconsistent with following operation" \
+-                        % (left.source, left.target), -6)
++            return (False, left, right,
++                    "R %s %s is inconsistent with following operation" \
++                    % (left.source, left.target), -6)
+         # We could do R a b + C b c -> C a c + R a b, but why?
+         if left.op == "R" and right.op == "C":
+             return (False, left, right, None, 12)
+@@ -6702,17 +6686,17 @@
+         heapq.heapify(s)
+         tsorted = []
+         old_index_to_new = {}
+-        while len(s):
++        while s:
+             n = heapq.heappop(s)
+             assert n not in old_index_to_new
+             old_index_to_new[n] = len(tsorted)
+             tsorted.append(n)
+             ein = dag[n].ein
+-            while len(ein):
++            while ein:
+                 m = ein.pop()
+                 medges = dag[m]
+                 medges.eout.remove(n)
+-                if not len(medges.eout):
++                if not medges.eout:
+                     heapq.heappush(s, m)
+ 
+         orig = range(len(self.events))
+@@ -6720,9 +6704,9 @@
+             t = set(tsorted)
+             assert len(t) == len(tsorted)
+             o = set(orig)
+-            assert len(t - o) == 0
++            assert not (t - o)
+             leftout = o - t
+-            if (len(leftout)):
++            if leftout:
+                 complain('event re-sort failed due to one or more dependency' 
\
+                          + ' cycles involving the following events: ' \
+                          + ', '.join(str(x+1) for x in sorted(leftout)))
+@@ -6905,7 +6889,7 @@
+             for (idx, parent) in enumerate(commit.parents()):
+                 if Commit.is_callout(parent.mark):
+                     attach = self.named(parent.mark)
+-                    if len(attach) == 0:
++                    if not attach:
+                         raise Recoverable("no match for %s in %s" \
+                                           % (parent.mark, graft_repo.name))
+                     elif len(attach) >= 2:
+@@ -7432,12 +7416,11 @@
+             name = name[:-4]
+         if name not in self.reponames():
+             return name
+-        else:
+-            # repo "foo" is #1
+-            seq = 2
+-            while name + str(seq) in self.reponames():
+-                seq += 1
+-            return name + str(seq)
++        # repo "foo" is #1
++        seq = 2
++        while name + str(seq) in self.reponames():
++            seq += 1
++        return name + str(seq)
+     def repo_by_name(self, name):
+         "Retrieve a repo by name."
+         try:
+@@ -7927,7 +7910,7 @@
+         except Recoverable as e:
+             complain(e.msg)
+     def postcmd(self, unused, line):
+-        assert unused is not []   # pacify pylint
++        assert unused is not None   # pacify pylint
+         try:
+             self.prompt = self.prompt_format % {"chosen":self.chosen() and 
self.chosen().name}
+         except ValueError:
+@@ -8007,10 +7990,9 @@
+     def pop(self):
+         if not self.line:
+             return ''
+-        else:
+-            c = self.line[0]
+-            self.line = self.line[1:]
+-            return c
++        c = self.line[0]
++        self.line = self.line[1:]
++        return c
+     # this should only be called from a @debug_lexer function (it
+     # depends on state set up by that decorator)
+     def _debug_lexer(self, msg):
+@@ -8499,8 +8481,7 @@
+         "Amplify - map empty set to empty, nonempty set to all."
+         if subarg:
+             return OrderedSet(self.chosen().all())
+-        else:
+-            return subarg
++        return subarg
+     def chn_handler(self, subarg):
+         "All children of commits in the selection set."
+         return self._accumulate_commits(subarg,
+@@ -8523,14 +8504,12 @@
+         "Predecessors function; all events previous to argument set."
+         if not subarg or min(subarg) == 0:
+             return OrderedSet()
+-        else:
+-            return OrderedSet(range(0, min(subarg)))
++        return OrderedSet(range(0, min(subarg)))
+     def suc_handler(self, subarg):
+         "Successors function; all events following argument set."
+         if not subarg or max(subarg) >= len(self.chosen().events) - 1:
+             return OrderedSet()
+-        else:
+-            return OrderedSet(range(max(subarg)+1, len(self.chosen().events)))
++        return OrderedSet(range(max(subarg)+1, len(self.chosen().events)))
+     def srt_handler(self, subarg):
+         "Sort the argument set."
+         return OrderedSet(sorted(subarg))
+@@ -8609,7 +8588,7 @@
+                 for event in self.chosen().commits():
+                     for fileop in event.operations():
+                         if fileop.op == 'M' and fileop.ref == singleton.mark:
+-                            if len(find_successor(event, fileop.path)) > 0:
++                            if find_successor(event, fileop.path):
+                                 complain("beware: not the last 'M %s' on its 
branch" % fileop.path)
+                             break
+                 os.system(editor + " " + singleton.materialize())
+@@ -9000,8 +8979,9 @@
+         except IOError as e:
+             complain("script failure on '%s': %s" % (line, e))
+ 
+-    def do_history(self, line):
++    def do_history(self, unused):
+         "Dump your command list from this session so far."
++        assert unused is not None   # pacify pylint
+         for line in self.history:
+             sys.stdout.write(line + "\n")
+ 
+@@ -10641,7 +10621,7 @@
+             return
+         if self.selection is None:
+             self.selection = []
+-        if len(self.selection) == 0:
++        if not self.selection:
+             complain("one or possibly two arguments specifying a link are 
required")
+             return
+         early = self.chosen()[self.selection[0]]
+@@ -11274,7 +11254,7 @@
+             line = parse.line
+         try:
+             selected = list(self.selected(Commit))
+-            if not len(selected): raise ValueError()
++            if not selected: raise ValueError()
+             if len(self.selection) != len(selected): raise ValueError()
+         except (TypeError, ValueError):
+             raise Recoverable("reparent requires one or more selected 
commits")
+@@ -11809,9 +11789,8 @@
+                 elif commit:
+                     text = commit.action_stamp()
+                     return polybytes(text)
+-                else:
+-                    complain("cannot resolve %s" % payload)
+-                    return matchobj.group(0) # no replacement
++                complain("cannot resolve %s" % payload)
++                return matchobj.group(0) # no replacement
+             for (regexp, getter) in \
+                     ((r"CVS:[^:\]]+:[0-9.]+",
+                       lambda p: repo.legacy_map.get(p) or 
repo.dollar_map.get(p)),
+@@ -11905,11 +11884,11 @@
+                         lines1 = totext.split('\n')
+                         file0 = path + " (" + bounds[0].mark + ")"
+                         file1 = path + " (" + bounds[1].mark + ")"
+-                        for line in difflib.unified_diff(lines0, lines1,
+-                                                         fromfile=file0,
+-                                                         tofile=file1,
+-                                                         lineterm=""):
+-                            parse.stdout.write(line + "\n")
++                        for l in difflib.unified_diff(lines0, lines1,
++                                                      fromfile=file0,
++                                                      tofile=file1,
++                                                      lineterm=""):
++                            parse.stdout.write(l + "\n")
+                 elif path in dir1:
+                     parse.stdout.write("%s: removed\n" % path)
+                 elif path in dir2:
+@@ -12073,8 +12052,8 @@
+                     sys.stdout.write("define %s %s\n" % (name, body[0]))
+                 else:
+                     sys.stdout.write("define %s {\n" % name)
+-                    for line in body:
+-                        sys.stdout.write(line)
++                    for l in body:
++                        sys.stdout.write(l)
+                     sys.stdout.write("}\n")
+         elif body[0] != '{':
+             self.definitions[name] = [body]
+@@ -12106,15 +12085,15 @@
+         except ValueError as e:
+             raise Recoverable("macro parse failed, %s" % e)
+         do_selection = self.selection
+-        for line in self.definitions[name]:
++        for l in self.definitions[name]:
+             try:
+-                line = line.format(*args)
++                l = l.format(*args)
+             except IndexError:
+                 raise Recoverable("macro argument error")
+             # If a leading portion of the expansion body is a selection
+             # expression, use it.  Otherwise we'll restore whatever
+             # selection set came before the do keyword.
+-            expansion = self.precmd(line)
++            expansion = self.precmd(l)
+             if self.selection is None:
+                 self.selection = do_selection
+             # Call the base method so RecoverableExceptions
+@@ -12273,6 +12252,7 @@
+ class OrderedSet(collections.MutableSet):
+ 
+     def __init__(self, iterable=None):
++        super(OrderedSet, self).__init__()
+         self.end = end = []
+         end += [None, end, end]         # sentinel node for doubly linked list
+         self.map = {}                   # key --> [key, prev, next]
+@@ -12362,8 +12342,8 @@
+         if not sys.argv[1:]:
+             sys.argv.append("-")
+         try:
+-            for arg in sys.argv[1:]:
+-                for arg in arg.split(";"):
++            for top_arg in sys.argv[1:]:
++                for arg in top_arg.split(";"):
+                     if arg == '-':
+                         if interpreter.profile_log is None:
+                             interactive()
+Index: reposurgeon-3.42/repodiffer
+===================================================================
+--- reposurgeon-3.42.orig/repodiffer
++++ reposurgeon-3.42/repodiffer
+@@ -173,8 +173,7 @@
+         "Human part of user name."
+         if "email" in ignores:
+             return fld.split("<")[0].strip()
+-        else:
+-            return fld
++        return fld
+     @staticmethod
+     def email(fld):
+         "Email part of user name."
+@@ -195,16 +194,14 @@
+         "Time equality check, which sometimes wants to ignore timezone skew."
+         if "timezone" in ignores:
+             return int(a.split()[0]) % 360 != int(b.split()[0]) % 360
+-        else:
+-            return a != b
++        return a != b
+     def __str__(self):
+         "Generate an ID for this commit that is useful to humans."
+         if self.repo.streamed:
+             return self.mark
+         elif fullhash:
+             return self.commit
+-        else:
+-            return self.commit[:7]
++        return self.commit[:7]
+     def __repr__(self):
+         r = "commit %s\n" % str(self)
+         r += "committer %s %s\n" % (self.committer, self.commitdate)
+Index: reposurgeon-3.42/Makefile
+===================================================================
+--- reposurgeon-3.42.orig/Makefile
++++ reposurgeon-3.42/Makefile
+@@ -91,7 +91,7 @@
+       --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
+       --dummy-variables-rgx='^_'
+ PYLINTOPTS1 = 
"C0103,C0111,C0301,C0302,C0322,C0324,C0325,C0321,C0323,C0330,C0410,C0411,C0412,C0413,C1001,R0201,R0101,R0204,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,W0108,W0110,W0123,W0122,W0141,W0142,W0212,W0221,W0232,W0233,W0603,W0632,W0640,W0511,W0611,E0611,E1101,E1103,E1124,E1133,I0011,F0401"
+-PYLINTOPTS2 = 
"C0103,C0111,C0325,C0301,C0326,C0330,C0410,C1001,W0603,W0621,E1101,E1103,R0401,R0902,R0903,R0912,R0914,R0915"
++PYLINTOPTS2 = 
"C0103,C0111,C0325,C0301,C0326,C0330,C0410,C1001,W0603,W0621,E0601,E0602,E1101,E1103,R0401,R0902,R0903,R0912,R0914,R0915"
+ PYLINTOPTS3 = "C0103,C0301,C0410,C1001,R0401,R0903,W0621"
+ PYLINTOPTS4 = 
"C0103,C0301,C0302,C0325,C0111,C0410,C0413,C1001,R0101,R0903,R0401,R0912,R0913,R0914,R0915,W0110,W0141,W0621,W1504"
+ pylint:
+Index: reposurgeon-3.42/repocutter
+===================================================================
+--- reposurgeon-3.42.orig/repocutter
++++ reposurgeon-3.42/repocutter
+@@ -500,8 +500,7 @@
+         "What is the uppermost revision in the spec?"
+         if self.intervals[-1][1] == "HEAD":
+             return sys.maxint
+-        else:
+-            return self.intervals[-1][1]
++        return self.intervals[-1][1]
+     def __repr__(self):
+         return self.txt
+ 
+@@ -958,9 +957,8 @@
+     offs = header.find(hd + ": ")
+     if offs == -1:
+         return None
+-    else:
+-        offs += len(hd) + 2
+-        return header[offs:offs+header[offs:].index("\n")]
++    offs += len(hd) + 2
++    return header[offs:offs+header[offs:].index("\n")]
+ 
+ def see(source, selection):
+     "Strip out ops defined by a revision selection and a path regexp."
+@@ -1016,7 +1014,7 @@
+                 progress = False
+             elif switch in ('-r', '--range'):
+                 selection = SubversionRange(val)
+-        if len(arguments) == 0:
++        if not arguments:
+             sys.stderr.write("Type 'repocutter help' for usage.\n")
+             sys.exit(1)
+         baton = None
diff -Nru reposurgeon-3.42/debian/patches/series 
reposurgeon-3.42/debian/patches/series
--- reposurgeon-3.42/debian/patches/series      1969-12-31 16:00:00.000000000 
-0800
+++ reposurgeon-3.42/debian/patches/series      2017-08-26 21:20:36.000000000 
-0700
@@ -0,0 +1 @@
+pylint-fixes.patch

Reply via email to