Patchwork [7,of,7] cleanup: name unused variables using convention of leading _

login
register
mail settings
Submitter Mads Kiilerich
Date Aug. 15, 2014, 2:21 p.m.
Message ID <8c720044deccfa025baf.1408112483@mk-desktop>
Download mbox | patch
Permalink /patch/5429/
State Accepted
Headers show

Comments

Mads Kiilerich - Aug. 15, 2014, 2:21 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1408070266 -7200
#      Fri Aug 15 04:37:46 2014 +0200
# Node ID 8c720044deccfa025baf6f0f0192a23eb91e6143
# Parent  cd9f59027952dd5513c4e45dc4e50a37894a7088
cleanup: name unused variables using convention of leading _

This helps checker tools ... and readability for those who knows and follows
the convention.
Matt Mackall - Aug. 15, 2014, 4:27 p.m.
On Fri, 2014-08-15 at 16:21 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1408070266 -7200
> #      Fri Aug 15 04:37:46 2014 +0200
> # Node ID 8c720044deccfa025baf6f0f0192a23eb91e6143
> # Parent  cd9f59027952dd5513c4e45dc4e50a37894a7088
> cleanup: name unused variables using convention of leading _

These are queued for default, thanks.

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -24,7 +24,7 @@  def active(func):
     return _active
 
 def _playback(journal, report, opener, entries, backupentries, unlink=True):
-    for f, o, ignore in entries:
+    for f, o, _ignore in entries:
         if o or not unlink:
             try:
                 fp = opener(f, 'a')
@@ -41,7 +41,7 @@  def _playback(journal, report, opener, e
                     raise
 
     backupfiles = []
-    for f, b, ignore in backupentries:
+    for f, b, _ignore in backupentries:
         filepath = opener.join(f)
         backuppath = opener.join(b)
         try:
@@ -265,7 +265,7 @@  class transaction(object):
             self.opener.unlink(self.journal)
         if self.opener.isfile(self.backupjournal):
             self.opener.unlink(self.backupjournal)
-            for f, b, _ignore in self.backupentries:
+            for _f, b, _ignore in self.backupentries:
                 self.opener.unlink(b)
         self.backupentries = []
         self.journal = None