changeset 78:71b07e16004f

fix, but im not sure its fixed yet
author Scott Chacon <schacon@gmail.com>
date Tue, 05 May 2009 09:43:24 -0700
parents d7b8768d005a
children 7b4cf18c896b 6893f2a2cc66
files git_handler.py toposort.py unit-tests/topo-test.py
diffstat 3 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/git_handler.py
+++ b/git_handler.py
@@ -445,7 +445,7 @@
                 self.ui.warn("Cannot import tags yet\n") # TODO
 
         # sort the commits
-        commits = TopoSort(convert_list).items()
+        commits = toposort.TopoSort(convert_list).items()
 
         # import each of the commits, oldest first
         for csha in commits:
--- a/toposort.py
+++ b/toposort.py
@@ -37,7 +37,7 @@
             stack_pos = len(stack)
             stack.append(node)
 
-            for successor in graph[node].parents():
+            for successor in graph[node].parents:
                 visit(successor)
                 low[node] = min(low[node], low[successor])
 
@@ -94,7 +94,7 @@
 
         for node in graph:
             node_c = node_component[node]
-            for successor in graph[node].parents():
+            for successor in graph[node].parents:
                 successor_c = node_component[successor]
                 if node_c != successor_c:
                     component_graph[node_c].append(successor_c)
--- a/unit-tests/topo-test.py
+++ b/unit-tests/topo-test.py
@@ -8,14 +8,11 @@
 class Ob:
     def __init__(self, eyedee, parents):
         self._id = eyedee
-        self._parents = parents
+        self.parents = parents
         
     def id(self):
         return self._id
 
-    def parents(self):
-        return self._parents
-
 
 class TestTopoSorting(unittest.TestCase):