Show More
@@ -21,6 +21,7 b' shelved change has a distinct name. For ' | |||
|
21 | 21 | shelve". |
|
22 | 22 | """ |
|
23 | 23 | |
|
24 | import collections | |
|
24 | 25 | from mercurial.i18n import _ |
|
25 | 26 | from mercurial.node import nullid, nullrev, bin, hex |
|
26 | 27 | from mercurial import changegroup, cmdutil, scmutil, phases, commands |
@@ -143,7 +144,7 b' def createcmd(ui, repo, pats, opts):' | |||
|
143 | 144 | |
|
144 | 145 | Much faster than the revset ancestors(ctx) & draft()""" |
|
145 | 146 | seen = set([nullrev]) |
|
146 |
visit = |
|
|
147 | visit = collections.deque() | |
|
147 | 148 | visit.append(ctx) |
|
148 | 149 | while visit: |
|
149 | 150 | ctx = visit.popleft() |
@@ -5,8 +5,8 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | import collections | |
|
8 | 9 | import heapq |
|
9 | import util | |
|
10 | 10 | from node import nullrev |
|
11 | 11 | |
|
12 | 12 | def commonancestorsheads(pfunc, *nodes): |
@@ -314,7 +314,7 b' class lazyancestors(object):' | |||
|
314 | 314 | |
|
315 | 315 | parentrevs = self._parentrevs |
|
316 | 316 | stoprev = self._stoprev |
|
317 |
visit = |
|
|
317 | visit = collections.deque(revs) | |
|
318 | 318 | |
|
319 | 319 | while visit: |
|
320 | 320 | for parent in parentrevs(visit.popleft()): |
@@ -8,6 +8,7 b'' | |||
|
8 | 8 | # This software may be used and distributed according to the terms of the |
|
9 | 9 | # GNU General Public License version 2 or any later version. |
|
10 | 10 | |
|
11 | import collections | |
|
11 | 12 | import os |
|
12 | 13 | import error |
|
13 | 14 | from i18n import _ |
@@ -71,7 +72,7 b' def bisect(changelog, state):' | |||
|
71 | 72 | |
|
72 | 73 | # build children dict |
|
73 | 74 | children = {} |
|
74 |
visit = |
|
|
75 | visit = collections.deque([badrev]) | |
|
75 | 76 | candidates = [] |
|
76 | 77 | while visit: |
|
77 | 78 | rev = visit.popleft() |
@@ -6,6 +6,7 b'' | |||
|
6 | 6 | # This software may be used and distributed according to the terms of the |
|
7 | 7 | # GNU General Public License version 2 or any later version. |
|
8 | 8 | |
|
9 | import collections | |
|
9 | 10 | import cStringIO, email, os, errno, re, posixpath, copy |
|
10 | 11 | import tempfile, zlib, shutil |
|
11 | 12 | # On python2.4 you have to import these by name or they fail to |
@@ -2102,7 +2103,7 b' def diff(repo, node1=None, node2=None, m' | |||
|
2102 | 2103 | |
|
2103 | 2104 | def lrugetfilectx(): |
|
2104 | 2105 | cache = {} |
|
2105 |
order = |
|
|
2106 | order = collections.deque() | |
|
2106 | 2107 | def getfilectx(f, ctx): |
|
2107 | 2108 | fctx = ctx.filectx(f, filelog=cache.get(f)) |
|
2108 | 2109 | if f not in cache: |
@@ -12,6 +12,7 b' and O(changes) merge between branches.' | |||
|
12 | 12 | """ |
|
13 | 13 | |
|
14 | 14 | # import stuff from node for others to import from revlog |
|
15 | import collections | |
|
15 | 16 | from node import bin, hex, nullid, nullrev |
|
16 | 17 | from i18n import _ |
|
17 | 18 | import ancestor, mdiff, parsers, error, util, templatefilters |
@@ -485,7 +486,7 b' class revlog(object):' | |||
|
485 | 486 | |
|
486 | 487 | # take all ancestors from heads that aren't in has |
|
487 | 488 | missing = set() |
|
488 |
visit = |
|
|
489 | visit = collections.deque(r for r in heads if r not in has) | |
|
489 | 490 | while visit: |
|
490 | 491 | r = visit.popleft() |
|
491 | 492 | if r in missing: |
@@ -40,6 +40,7 b' nodes that will maximize the number of n' | |||
|
40 | 40 | classified with it (since all ancestors or descendants will be marked as well). |
|
41 | 41 | """ |
|
42 | 42 | |
|
43 | import collections | |
|
43 | 44 | from node import nullid, nullrev |
|
44 | 45 | from i18n import _ |
|
45 | 46 | import random |
@@ -65,7 +66,7 b' def _updatesample(dag, nodes, sample, qu' | |||
|
65 | 66 | else: |
|
66 | 67 | heads = dag.heads() |
|
67 | 68 | dist = {} |
|
68 |
visit = |
|
|
69 | visit = collections.deque(heads) | |
|
69 | 70 | seen = set() |
|
70 | 71 | factor = 1 |
|
71 | 72 | while visit: |
@@ -5,6 +5,7 b'' | |||
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | import collections | |
|
8 | 9 | from node import nullid, short |
|
9 | 10 | from i18n import _ |
|
10 | 11 | import util, error |
@@ -56,7 +57,7 b' def findcommonincoming(repo, remote, hea' | |||
|
56 | 57 | # a 'branch' here is a linear segment of history, with four parts: |
|
57 | 58 | # head, root, first parent, second parent |
|
58 | 59 | # (a branch always has two parents (or none) by definition) |
|
59 |
unknown = |
|
|
60 | unknown = collections.deque(remote.branches(unknown)) | |
|
60 | 61 | while unknown: |
|
61 | 62 | r = [] |
|
62 | 63 | while unknown: |
@@ -334,8 +334,6 b' def cachefunc(func):' | |||
|
334 | 334 | |
|
335 | 335 | return f |
|
336 | 336 | |
|
337 | deque = collections.deque | |
|
338 | ||
|
339 | 337 | class sortdict(dict): |
|
340 | 338 | '''a simple sorted dictionary''' |
|
341 | 339 | def __init__(self, data=None): |
@@ -386,7 +384,7 b' class lrucachedict(object):' | |||
|
386 | 384 | def __init__(self, maxsize): |
|
387 | 385 | self._cache = {} |
|
388 | 386 | self._maxsize = maxsize |
|
389 | self._order = deque() | |
|
387 | self._order = collections.deque() | |
|
390 | 388 | |
|
391 | 389 | def __getitem__(self, key): |
|
392 | 390 | value = self._cache[key] |
@@ -408,12 +406,12 b' class lrucachedict(object):' | |||
|
408 | 406 | |
|
409 | 407 | def clear(self): |
|
410 | 408 | self._cache.clear() |
|
411 | self._order = deque() | |
|
409 | self._order = collections.deque() | |
|
412 | 410 | |
|
413 | 411 | def lrucachefunc(func): |
|
414 | 412 | '''cache most recent results of function calls''' |
|
415 | 413 | cache = {} |
|
416 | order = deque() | |
|
414 | order = collections.deque() | |
|
417 | 415 | if func.func_code.co_argcount == 1: |
|
418 | 416 | def f(arg): |
|
419 | 417 | if arg not in cache: |
@@ -1191,7 +1189,7 b' class chunkbuffer(object):' | |||
|
1191 | 1189 | else: |
|
1192 | 1190 | yield chunk |
|
1193 | 1191 | self.iter = splitbig(in_iter) |
|
1194 | self._queue = deque() | |
|
1192 | self._queue = collections.deque() | |
|
1195 | 1193 | |
|
1196 | 1194 | def read(self, l=None): |
|
1197 | 1195 | """Read L bytes of data from the iterator of chunks of data. |
General Comments 0
You need to be logged in to leave comments.
Login now