Expose get_known_graph_ancestry() on Repository API

Bug #495502 reported by Jelmer Vernooij on 2009-12-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Low
Jelmer Vernooij

Bug Description

  affects bzr
  status confirmed
  importance low

Not all repository implementations provide VersionedFiles. It would be
nice if get_known_graph_ancestry() was exposed as part of the Repository
API so that it can be used for these repository formats.

Related branches

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

Jelmer Vernooij wrote:
> Public bug reported:
>
> affects bzr
> status confirmed
> importance low
>
> Not all repository implementations provide VersionedFiles. It would be
> nice if get_known_graph_ancestry() was exposed as part of the Repository
> API so that it can be used for these repository formats.
>
> ** Affects: bzr
> Importance: Low
> Status: Confirmed
>

You *can* always do:

from bzrlib import graph as _mod_graph

kg = _mod_graph.KnownGraph(dict(repo.get_graph().iter_ancestry([??])))

(You may need to filter out ghosts, which will be repopulated in kg, I'm
not positive.)

It is, essentially, how I would implement Repo.get_known_graph_ancestry().

John
=:->

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

iEYEARECAAYFAksiXl4ACgkQJdeBCYSNAAPLvgCfULz8im/TBEc/PyiPLKFWYoEi
bnYAoK7nv/RNC6xU3W7sd7OFbyUHVl+j
=jBpX
-----END PGP SIGNATURE-----

Jelmer Vernooij (jelmer) wrote :

On Fri, 2009-12-11 at 14:59 +0000, John A Meinel wrote:
> Jelmer Vernooij wrote:
> > Public bug reported:
> >
> > affects bzr
> > status confirmed
> > importance low
> >
> > Not all repository implementations provide VersionedFiles. It would be
> > nice if get_known_graph_ancestry() was exposed as part of the Repository
> > API so that it can be used for these repository formats.

> You *can* always do:
>
> from bzrlib import graph as _mod_graph
>
> kg = _mod_graph.KnownGraph(dict(repo.get_graph().iter_ancestry([??])))
>
> (You may need to filter out ghosts, which will be repopulated in kg, I'm
> not positive.)
>
> It is, essentially, how I would implement
> Repo.get_known_graph_ancestry().
Thanks - it'd be nice if callers don't have to worry about this, and
implementations may be able to do this faster (bzr-svn in particular
should be able to do this).

Cheers,

Jelmer

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

Jelmer Vernooij wrote:
> On Fri, 2009-12-11 at 14:59 +0000, John A Meinel wrote:
>> Jelmer Vernooij wrote:
>>> Public bug reported:
>>>
>>> affects bzr
>>> status confirmed
>>> importance low
>>>
>>> Not all repository implementations provide VersionedFiles. It would be
>>> nice if get_known_graph_ancestry() was exposed as part of the Repository
>>> API so that it can be used for these repository formats.
>
>> You *can* always do:
>>
>> from bzrlib import graph as _mod_graph
>>
>> kg = _mod_graph.KnownGraph(dict(repo.get_graph().iter_ancestry([??])))
>>
>> (You may need to filter out ghosts, which will be repopulated in kg, I'm
>> not positive.)
>>
>> It is, essentially, how I would implement
>> Repo.get_known_graph_ancestry().
> Thanks - it'd be nice if callers don't have to worry about this, and
> implementations may be able to do this faster (bzr-svn in particular
> should be able to do this).
>
> Cheers,
>
> Jelmer
>

Sure, I can see it as an abstract top-level thing. It also would be
faster in bzr repositories to go down to the index.find_ancestry()
functions, and use that to grab a parent map (with keys) and then
translate that back into plain revision_ids, and put that it a KnownGraph.

It sort of depends on how you envision using this functionality.
John
=:->

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

iEYEARECAAYFAksibGUACgkQJdeBCYSNAAMk9QCeO62SHKqpvGqJaTfOQdEMWBld
NT4AoMo0gXbLPgBWRfA+qulUWQ/Xp/Pp
=omZP
-----END PGP SIGNATURE-----

Jelmer Vernooij (jelmer) on 2009-12-25
Changed in bzr:
assignee: nobody → Jelmer Vernooij (jelmer)
John A Meinel (jameinel) on 2010-08-06
Changed in bzr:
milestone: none → 2.2.0
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers