Patchwork [1,of,5] generate-working-copy-states: make 'tracked' a string

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 1, 2014, 6:14 a.m.
Message ID <678ce9eea4ef12eaa369.1417414496@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6928/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Dec. 1, 2014, 6:14 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417300773 28800
#      Sat Nov 29 14:39:33 2014 -0800
# Node ID 678ce9eea4ef12eaa369a9ea2a5b2d256cb797a5
# Parent  b913c394386f0a6ebbdcb7e321ff82816d7799fe
generate-working-copy-states: make 'tracked' a string

The only places the 'tracked' variable is only used is where it's
converted to a string, so let's simplify by using the string value
directly.

Patch

diff --git a/tests/generate-working-copy-states.py b/tests/generate-working-copy-states.py
--- a/tests/generate-working-copy-states.py
+++ b/tests/generate-working-copy-states.py
@@ -7,14 +7,13 @@ 
 for base in [None, 'content1']:
     for parent in set([None, 'content2']) | set([base]):
         for wcc in set([None, 'content3']) | set([base, parent]):
-            for tracked in (False, True):
+            for tracked in ('untracked', 'tracked'):
                 def statestring(content):
                     return content is None and 'missing' or content
-                trackedstring = tracked and 'tracked' or 'untracked'
                 filename = "%s_%s_%s-%s" % (statestring(base),
                                             statestring(parent),
                                             statestring(wcc),
-                                            trackedstring)
+                                            tracked)
                 combination.append((filename, base, parent, wcc))
 
 # make sure we have stable output