Show More
@@ -42,12 +42,12 import sys | |||
|
42 | 42 | def generatestates(maxchangesets, parentcontents): |
|
43 | 43 | depth = len(parentcontents) |
|
44 | 44 | if depth == maxchangesets + 1: |
|
45 | for tracked in ('untracked', 'tracked'): | |
|
46 |
filename = "_".join([(content is None and 'missing' or content) |
|
|
47 | content in parentcontents]) + "-" + tracked | |
|
45 | for tracked in (b'untracked', b'tracked'): | |
|
46 | filename = b"_".join([(content is None and b'missing' or content) | |
|
47 | for content in parentcontents]) + b"-" + tracked | |
|
48 | 48 | yield (filename, parentcontents) |
|
49 | 49 | else: |
|
50 |
for content in ({None, 'content' + |
|
|
50 | for content in ({None, b'content' + (b"%d" % (depth + 1))} | | |
|
51 | 51 | set(parentcontents)): |
|
52 | 52 | for combination in generatestates(maxchangesets, |
|
53 | 53 | parentcontents + [content]): |
@@ -71,7 +71,7 for filename, states in combinations: | |||
|
71 | 71 | if depth == 'wc': |
|
72 | 72 | # Make sure there is content so the file gets written and can be |
|
73 | 73 | # tracked. It will be deleted outside of this script. |
|
74 | content.append((filename, states[maxchangesets] or 'TOBEDELETED')) | |
|
74 | content.append((filename, states[maxchangesets] or b'TOBEDELETED')) | |
|
75 | 75 | else: |
|
76 | 76 | content.append((filename, states[int(depth) - 1])) |
|
77 | 77 | else: |
@@ -82,7 +82,7 for filename, states in combinations: | |||
|
82 | 82 | for filename, data in content: |
|
83 | 83 | if data is not None: |
|
84 | 84 | f = open(filename, 'wb') |
|
85 | f.write(data + '\n') | |
|
85 | f.write(data + b'\n') | |
|
86 | 86 | f.close() |
|
87 | 87 | elif os.path.exists(filename): |
|
88 | 88 | os.remove(filename) |
General Comments 0
You need to be logged in to leave comments.
Login now