Commits

Anonymous committed 0252d63

Added pylint configuration file, and fixed errors and warnings reported
by pylint.

  • Participants
  • Parent commits 0c95a7e

Comments (0)

Files changed (2)

File editcommitmsgs.py

 import os
 
 from mercurial import extensions
-from mercurial import patch
-from mercurial import util
 from mercurial import cmdutil
 from mercurial.i18n import _
 
         ui.warn(_('No patches applied'))
         return
 
-    allmessages = introductiontext();
+    allmessages = introductiontext()
     patchmap = {}
     appliedbefore = repo.mq.applied[:]
 
     #temporarily disable writing
     oldwrite = ui.write
-    def nowrite(self, *args, **opts):
+    def nowrite(*_args):
+        """Noop write function"""
         pass
     ui.write = nowrite
 
-    for patch in repo.mq.applied:
-        patchheader = mq.patchheader(os.path.join(repo.mq.path, patch.name))
-        patchmap[patch.name] = patchheader
-        allmessages += _patchlinestarter + patch.name + '\n'
-        ctx = repo[patch.node]
+    for appliedpatch in repo.mq.applied:
+        patchheader = mq.patchheader(
+            os.path.join(repo.mq.path, appliedpatch.name))
+        patchmap[appliedpatch.name] = patchheader
+        allmessages += _patchlinestarter + appliedpatch.name + '\n'
         if opts.get('showstatus'):
-            allmessages += ('\n').join(fullstatus(repo, patch.node)) + '\n'
+            allmessages += ('\n').join(
+                fullstatus(repo, appliedpatch.node)) + '\n'
         allmessages += ('\n').join(patchheader.message) + '\n'
         allmessages += "HG: --\n"
 
     """Gets status between ode1 and its first parent."""
     ctx = repo[node1]
     node2 = ctx.p1().node()
-    modified, added, removed, deleted, unknown, ignored, clean = \
-        repo.status(node2, node1, cmdutil.match(repo))
+    modified, added, removed = repo.status(node2, node1,
+                                           cmdutil.match(repo))[:3]
 
     fulltext = []
     fulltext.append(_("HG: user: %s") % ctx.user())
        "HG: edit them\n"
        "HG: --\n"
        "HG: Applied patches:\n"
-       "HG: --\n");
+       "HG: --\n")
 
 def parsemessage(text):
     """Parses the edited text.
     one by one, while updating the commit messages.
     """
     mq.pop(ui, repo, all=True)
-    for patch in appliedbefore:
-        mq.push(ui, repo, patch.name)
-        message = '\n'.join(commitmessages[patch.name])
+    for appliedpatch in appliedbefore:
+        mq.push(ui, repo, appliedpatch.name)
+        message = '\n'.join(commitmessages[appliedpatch.name])
         mq.refresh(ui, repo, message=message)
 
 def uisetup(ui):
+    """Adds the command to command table if mq is found."""
     try:
-        mq = extensions.find('mq')
+        extensions.find('mq')
     except KeyError:
+        ui.warn(_('could not find mq extensions'))
         return
 
     ccmdtable = {"qeditcommitmsgs":
+[BASIC]
+const-rgx=(([a-zA-Z_][a-zA-Z0-9]*)|(__.*__))$
+variable-rgx=[a-z_][a-z0-9]{0,30}$
+argument-rgx=[a-z_][a-z0-9_]{0,30}$
+
+[VARIABLES]
+dummy-variables=_args
+
+[REPORTS]
+# Include message's id in output
+include-ids=yes