Patchwork D1934: convert: use a collections.deque

login
register
mail settings
Submitter phabricator
Date Jan. 22, 2018, 1 p.m.
Message ID <5bda4ae4f684bce20c004473328dbe27@localhost.localdomain>
Download mbox | patch
Permalink /patch/27029/
State Not Applicable
Headers show

Comments

phabricator - Jan. 22, 2018, 1 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGeefabd9ed3e1: convert: use a collections.deque (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1934?vs=4975&id=4976

REVISION DETAIL
  https://phab.mercurial-scm.org/D1934

AFFECTED FILES
  hgext/convert/convcmd.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, phillco, yuja
Cc: yuja, phillco, mercurial-devel

Patch

diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -6,6 +6,7 @@ 
 # GNU General Public License version 2 or any later version.
 from __future__ import absolute_import
 
+import collections
 import os
 import shlex
 import shutil
@@ -290,13 +291,13 @@ 
             revisions without parents. 'parents' must be a mapping of revision
             identifier to its parents ones.
             """
-            visit = sorted(parents)
+            visit = collections.deque(sorted(parents))
             seen = set()
             children = {}
             roots = []
 
             while visit:
-                n = visit.pop(0)
+                n = visit.popleft()
                 if n in seen:
                     continue
                 seen.add(n)