Patchwork [01,of,19] localrepo: always set the variable r in status method

login
register
mail settings
Submitter Sean Farley
Date May 15, 2014, 9:16 p.m.
Message ID <ac2d57df1c2160e6da43.1400188579@laptop.local>
Download mbox | patch
Permalink /patch/4760/
State Accepted
Commit 2edb8648c500cdd1b8071461a84b339532b3a5d8
Headers show

Comments

Sean Farley - May 15, 2014, 9:16 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1394580939 18000
#      Tue Mar 11 18:35:39 2014 -0500
# Node ID ac2d57df1c2160e6da43d112b9eadfe688415472
# Parent  ebb8d8589abc77031a3ec59fc4365f9984bce505
localrepo: always set the variable r in status method

This is a small patch to help streamline keeping tracking of the list of files
for status in a variable already called 'r' ('s' is for subrepos in this
method). We now move the setting of it out of an 'if' block so that we can
later refactor more code into the context objects.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1553,14 +1553,16 @@  class localrepository(object):
                 # so 'f not in ctx1' is not enough
                 if f not in ctx1 and f not in ctx1.dirs():
                     self.ui.warn('%s: %s\n' % (self.dirstate.pathto(f), msg))
             match.bad = bad
 
+        r = [[], [], [], [], [], [], []]
         if working: # we need to scan the working dir
             r = ctx2._dirstatestatus(match=match, ignored=listignored,
                                      clean=listclean, unknown=listunknown)
-            modified, added, removed, deleted, unknown, ignored, clean = r
+
+        modified, added, removed, deleted, unknown, ignored, clean = r
 
         if not parentworking:
             mf1 = mfmatches(ctx1)
             if working:
                 # we are comparing working dir against non-parent