Show More
@@ -29,7 +29,7 b' def pack_dirstate(fakenow, orig, dmap, c' | |||
|
29 | 29 | # execute what original parsers.pack_dirstate should do actually |
|
30 | 30 | # for consistency |
|
31 | 31 | actualnow = int(now) |
|
32 |
for f, e in dmap. |
|
|
32 | for f, e in dmap.items(): | |
|
33 | 33 | if e[0] == 'n' and e[3] == actualnow: |
|
34 | 34 | e = parsers.dirstatetuple(e[0], e[1], e[2], -1) |
|
35 | 35 | dmap[f] = e |
@@ -19,7 +19,7 b' origui = myui.load()' | |||
|
19 | 19 | |
|
20 | 20 | def writeauth(items): |
|
21 | 21 | ui = origui.copy() |
|
22 |
for name, value in items. |
|
|
22 | for name, value in items.items(): | |
|
23 | 23 | ui.setconfig('auth', name, value) |
|
24 | 24 | return ui |
|
25 | 25 | |
@@ -36,7 +36,7 b' def test(auth, urls=None):' | |||
|
36 | 36 | for name in ('.username', '.password'): |
|
37 | 37 | if (p + name) not in auth: |
|
38 | 38 | auth[p + name] = p |
|
39 |
auth = dict((k, v) for k, v in auth. |
|
|
39 | auth = dict((k, v) for k, v in auth.items() if v is not None) | |
|
40 | 40 | |
|
41 | 41 | ui = writeauth(auth) |
|
42 | 42 |
@@ -2258,7 +2258,7 b' Check that adding an arbitrary name show' | |||
|
2258 | 2258 | > foo = {'foo': repo[0].node()} |
|
2259 | 2259 | > names = lambda r: foo.keys() |
|
2260 | 2260 | > namemap = lambda r, name: foo.get(name) |
|
2261 |
> nodemap = lambda r, node: [name for name, n in foo. |
|
|
2261 | > nodemap = lambda r, node: [name for name, n in foo.items() | |
|
2262 | 2262 | > if n == node] |
|
2263 | 2263 | > ns = namespaces.namespace( |
|
2264 | 2264 | > "bars", templatename="bar", logname="barlog", |
@@ -223,7 +223,7 b' class basemanifesttests(object):' | |||
|
223 | 223 | self.assertEqual(want, m[b'foo']) |
|
224 | 224 | self.assertEqual([(b'bar/baz/qux.py', BIN_HASH_2), |
|
225 | 225 | (b'foo', BIN_HASH_1 + b'a')], |
|
226 |
list(m. |
|
|
226 | list(m.items())) | |
|
227 | 227 | # Sometimes it even tries a 22-byte fake hash, but we can |
|
228 | 228 | # return 21 and it'll work out |
|
229 | 229 | m[b'foo'] = want + b'+' |
@@ -238,7 +238,7 b' class basemanifesttests(object):' | |||
|
238 | 238 | # suffix with iteration |
|
239 | 239 | self.assertEqual([(b'bar/baz/qux.py', BIN_HASH_2), |
|
240 | 240 | (b'foo', want)], |
|
241 |
list(m. |
|
|
241 | list(m.items())) | |
|
242 | 242 | |
|
243 | 243 | # shows up in diff |
|
244 | 244 | self.assertEqual({b'foo': ((want, f), (h, b''))}, m.diff(clean)) |
@@ -16,7 +16,7 b' class splitnewlinesTests(unittest.TestCa' | |||
|
16 | 16 | '': [], |
|
17 | 17 | 'abcabc': ['abcabc'], |
|
18 | 18 | } |
|
19 |
for inp, want in cases. |
|
|
19 | for inp, want in cases.items(): | |
|
20 | 20 | self.assertEqual(mdiff.splitnewlines(inp), want) |
|
21 | 21 | |
|
22 | 22 | if __name__ == '__main__': |
@@ -64,7 +64,7 b" def buildprobtable(fp, cmd='hg manifest " | |||
|
64 | 64 | counts.pop(c, None) |
|
65 | 65 | t = sum(counts.itervalues()) / 100.0 |
|
66 | 66 | fp.write('probtable = (') |
|
67 |
for i, (k, v) in enumerate(sorted(counts. |
|
|
67 | for i, (k, v) in enumerate(sorted(counts.items(), key=lambda x: x[1], | |
|
68 | 68 | reverse=True)): |
|
69 | 69 | if (i % 5) == 0: |
|
70 | 70 | fp.write('\n ') |
@@ -13,7 +13,7 b'' | |||
|
13 | 13 | > tmpl = self.loader(t) |
|
14 | 14 | > props = self._defaults.copy() |
|
15 | 15 | > props.update(map) |
|
16 |
> for k, v in props. |
|
|
16 | > for k, v in props.items(): | |
|
17 | 17 | > if k in ('templ', 'ctx', 'repo', 'revcache', 'cache', 'troubles'): |
|
18 | 18 | > continue |
|
19 | 19 | > if hasattr(v, '__call__'): |
General Comments 0
You need to be logged in to leave comments.
Login now