diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-11 11:52:24 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-11 14:20:25 +0200 |
commit | 583e6a25b0d891a2f531a81029f2bac0c237cbf9 (patch) | |
tree | 09025a39d44fa2a28a6533a0f969316652f974bc /lib/git/async/graph.py | |
parent | 01eac1a959c1fa5894a86bf11e6b92f96762bdd8 (diff) | |
parent | 6d1212e8c412b0b4802bc1080d38d54907db879d (diff) | |
download | gitpython-583e6a25b0d891a2f531a81029f2bac0c237cbf9.tar.gz |
Merge branch 'channel' into taskdep
Diffstat (limited to 'lib/git/async/graph.py')
-rw-r--r-- | lib/git/async/graph.py | 14 |
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): |