Show More
@@ -6,6 +6,7 | |||||
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 | from __future__ import absolute_import |
|
7 | from __future__ import absolute_import | |
8 |
|
8 | |||
|
9 | import collections | |||
9 | import os |
|
10 | import os | |
10 | import shlex |
|
11 | import shlex | |
11 | import shutil |
|
12 | import shutil | |
@@ -290,13 +291,13 class converter(object): | |||||
290 | revisions without parents. 'parents' must be a mapping of revision |
|
291 | revisions without parents. 'parents' must be a mapping of revision | |
291 | identifier to its parents ones. |
|
292 | identifier to its parents ones. | |
292 | """ |
|
293 | """ | |
293 | visit = sorted(parents) |
|
294 | visit = collections.deque(sorted(parents)) | |
294 | seen = set() |
|
295 | seen = set() | |
295 | children = {} |
|
296 | children = {} | |
296 | roots = [] |
|
297 | roots = [] | |
297 |
|
298 | |||
298 | while visit: |
|
299 | while visit: | |
299 |
n = visit.pop( |
|
300 | n = visit.popleft() | |
300 | if n in seen: |
|
301 | if n in seen: | |
301 | continue |
|
302 | continue | |
302 | seen.add(n) |
|
303 | seen.add(n) |
General Comments 0
You need to be logged in to leave comments.
Login now