summaryrefslogtreecommitdiff
path: root/lib/git/async/graph.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-10 23:55:50 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-10 23:55:50 +0200
commitfbe062bf6dacd3ad63dd827d898337fa542931ac (patch)
treee3cac995265e0472f5ff9a2cc42f3c9e2eafaf95 /lib/git/async/graph.py
parentc34343d0b714d2c4657972020afea034a167a682 (diff)
downloadgitpython-fbe062bf6dacd3ad63dd827d898337fa542931ac.tar.gz
Added dependency-task tests, and fixed plenty of ref-count related bugs, as well as concurrency issues. Now it works okay, but the thread-shutdown is still an issue, as it causes incorrect behaviour making the tests fail. Its good, as it hints at additional issues that need to be solved. There is just a little more left on the feature side, but its nearly there
Diffstat (limited to 'lib/git/async/graph.py')
-rw-r--r--lib/git/async/graph.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/git/async/graph.py b/lib/git/async/graph.py
index e3999cdc..9ee0e891 100644
--- a/lib/git/async/graph.py
+++ b/lib/git/async/graph.py
@@ -25,14 +25,24 @@ class Graph(object):
def __init__(self):
self.nodes = list()
+
+ def __del__(self):
+ """Deletes bidericational dependencies"""
+ for node in self.nodes:
+ node.in_nodes = None
+ node.out_nodes = None
+ # END cleanup nodes
+
+ # otherwise the nodes would keep floating around
+
def add_node(self, node):
"""Add a new node to the graph
:return: the newly added node"""
self.nodes.append(node)
return node
- def del_node(self, node):
+ def remove_node(self, node):
"""Delete a node from the graph
:return: self"""
try:
@@ -46,6 +56,8 @@ class Graph(object):
del(outn.in_nodes[outn.in_nodes.index(node)])
for inn in node.in_nodes:
del(inn.out_nodes[inn.out_nodes.index(node)])
+ node.out_nodes = list()
+ node.in_nodes = list()
return self
def add_edge(self, u, v):