Rev 3173: ``Graph`` no longer requires the ``parents_provider`` to have a in http://people.ubuntu.com/~robertc/baz2.0/remote.graph

Robert Collins robertc at robertcollins.net
Thu Jan 10 22:09:13 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/remote.graph

------------------------------------------------------------
revno: 3173
revision-id:robertc at robertcollins.net-20080110220839-ze9uhnjp04h7y9mp
parent: pqm at pqm.ubuntu.com-20080110025628-6tl4b9cmdn335suw
committer: Robert Collins <robertc at robertcollins.net>
branch nick: remote.graph
timestamp: Fri 2008-01-11 09:08:39 +1100
message:
  ``Graph`` no longer requires the ``parents_provider`` to have a
  ``get_parents`` attribute. (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
=== modified file 'NEWS'
--- a/NEWS	2008-01-10 01:45:17 +0000
+++ b/NEWS	2008-01-10 22:08:39 +0000
@@ -152,6 +152,9 @@
 
    * get_parent_map now always provides tuples as its output.  (Aaron Bentley)
 
+   * ``Graph`` no longer requires the ``parents_provider`` to have a
+     ``get_parents`` attribute. (Robert Collins)
+
    * New method ``iter_inventories`` on Repository for access to many
      inventories. This is primarily used by the ``revision_trees`` method, as
      direct access to inventories is discouraged. (Robert Collins)

=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py	2007-12-18 19:42:10 +0000
+++ b/bzrlib/graph.py	2008-01-10 22:08:39 +0000
@@ -173,7 +173,9 @@
         :param parents_provider: An object providing a get_parents call
             conforming to the behavior of StackedParentsProvider.get_parents
         """
-        self.get_parents = parents_provider.get_parents
+        # get_parents is deprecated and we don't use it, so don't require it on
+        # providers.
+        self.get_parents = getattr(parents_provider, 'get_parents', None)
         self.get_parent_map = parents_provider.get_parent_map
         self._parents_provider = parents_provider
 



More information about the bazaar-commits mailing list