/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/multiparent.py

  • Committer: Andrew Bennetts
  • Date: 2008-04-07 10:34:57 UTC
  • mfrom: (3344 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3349.
  • Revision ID: andrew.bennetts@canonical.com-20080407103457-ro4t95pd3imwt0zw
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from StringIO import StringIO
24
24
 
25
25
from bzrlib import (
 
26
    errors,
26
27
    patiencediff,
27
28
    trace,
28
29
    ui,
37
38
    descendants = {}
38
39
    if versions is None:
39
40
        versions = vf.versions()
 
41
    parents = vf.get_parent_map(versions)
40
42
    def pending_parents(version):
41
 
        return [v for v in vf.get_parents(version) if v in versions and
 
43
        return [v for v in parents[version] if v in versions and
42
44
                v not in seen]
43
45
    for version_id in versions:
44
 
        for parent_id in vf.get_parents(version_id):
 
46
        for parent_id in parents[version_id]:
45
47
            descendants.setdefault(parent_id, []).append(version_id)
46
48
    cur = [v for v in versions if len(pending_parents(v)) == 0]
47
49
    while len(cur) > 0:
508
510
        self._parents[version_id] = parent_ids
509
511
 
510
512
    def get_diff(self, version_id):
511
 
        return self._diffs[version_id]
 
513
        try:
 
514
            return self._diffs[version_id]
 
515
        except KeyError:
 
516
            raise errors.RevisionNotPresent(version_id, self)
512
517
 
513
518
    def destroy(self):
514
519
        self._diffs = {}