[MERGE] Deprecated Repository.revision_parents.

John Arbash Meinel john at arbash-meinel.com
Fri May 2 18:36:06 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jelmer Vernooij wrote:
| The Repository.revision_parents() implementation currently calls the
| deprecated weave parents functions but is not deprecated itself. This
| deprecates Repository.revision_parents() itself as well.
|
| Cheers,
|
| Jelmer
|

BB:resubmit

There is no "Repository.get_revision_id()" function.

I personally would recommend switching to
Repository.get_parent_map([revision_id])[revision_id]

It handles ghosts, and we have a Remote api for the call which knows about
buffering and expecting to be called with more requests.

I would explicitly *not* recommend
Repository.get_revision(revision_id).parent_ids because that has to actually
fetch the XML for the Revision information, when we already have the ancestry
graph cached in the Indexes.

I would also mention that you didn't deprecate all implementations of it.

$ grep -rnI "\<revision_parents\>" bzrlib/
bzrlib/fetch.py:360:        for revision_parents in parent_map.itervalues():
bzrlib/fetch.py:361:            parents.update(revision_parents)
bzrlib/repofmt/knitrepo.py:291:    def revision_parents(self, revision_id):
bzrlib/repository.py:1743:    def revision_parents(self, revision_id):
bzrlib/revision.py:333:    def revision_parents(self, revision_id):
bzrlib/revision.py:336:                return source.revision_parents(revision_id)

'fetch.py' is spurious, but knitrepo.py overrides the function, and
'MultipleRevisionSources' also implements it (as multiple calls to other
functions). I suppose MRS is already deprecated as a whole class, so it isn't as
important.

I would recommend deprecating all of them so that if anyone is using them, they
are told right away.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgbUQYACgkQJdeBCYSNAAN9tgCgnza+8hYzb0GxFoRnKq0I1ujz
abIAn3ObR8aJbgN4/ax0oLvZcDNA4u6G
=uJoJ
-----END PGP SIGNATURE-----



More information about the bazaar mailing list