Mercurial > hg
comparison tests/generate-working-copy-states.py @ 23445:390a2610eaef
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.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 29 Nov 2014 14:39:33 -0800 |
parents | 29977b315be1 |
children | e51027c85dcd |
comparison
equal
deleted
inserted
replaced
23444:88629daa727b | 23445:390a2610eaef |
---|---|
5 # build the combination of possible states | 5 # build the combination of possible states |
6 combination = [] | 6 combination = [] |
7 for base in [None, 'content1']: | 7 for base in [None, 'content1']: |
8 for parent in set([None, 'content2']) | set([base]): | 8 for parent in set([None, 'content2']) | set([base]): |
9 for wcc in set([None, 'content3']) | set([base, parent]): | 9 for wcc in set([None, 'content3']) | set([base, parent]): |
10 for tracked in (False, True): | 10 for tracked in ('untracked', 'tracked'): |
11 def statestring(content): | 11 def statestring(content): |
12 return content is None and 'missing' or content | 12 return content is None and 'missing' or content |
13 trackedstring = tracked and 'tracked' or 'untracked' | |
14 filename = "%s_%s_%s-%s" % (statestring(base), | 13 filename = "%s_%s_%s-%s" % (statestring(base), |
15 statestring(parent), | 14 statestring(parent), |
16 statestring(wcc), | 15 statestring(wcc), |
17 trackedstring) | 16 tracked) |
18 combination.append((filename, base, parent, wcc)) | 17 combination.append((filename, base, parent, wcc)) |
19 | 18 |
20 # make sure we have stable output | 19 # make sure we have stable output |
21 combination.sort() | 20 combination.sort() |
22 | 21 |