mercurial/treediscovery.py
changeset 16803 107a3270a24a
parent 14698 df902fe3d79e
child 16834 cafd8a8fb713
--- a/mercurial/treediscovery.py	Tue May 15 10:44:17 2012 -0700
+++ b/mercurial/treediscovery.py	Tue May 15 10:46:23 2012 -0700
@@ -7,7 +7,7 @@
 
 from node import nullid, short
 from i18n import _
-import util, error
+import util, error, collections
 
 def findcommonincoming(repo, remote, heads=None, force=False):
     """Return a tuple (common, fetch, heads) used to identify the common
@@ -56,11 +56,11 @@
     # a 'branch' here is a linear segment of history, with four parts:
     # head, root, first parent, second parent
     # (a branch always has two parents (or none) by definition)
-    unknown = remote.branches(unknown)
+    unknown = collections.deque(remote.branches(unknown))
     while unknown:
         r = []
         while unknown:
-            n = unknown.pop(0)
+            n = unknown.popleft()
             if n[0] in seen:
                 continue