/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-10 07:58:01 UTC
  • mfrom: (3352 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3357.
  • Revision ID: andrew.bennetts@canonical.com-20080410075801-n24st9wfiizkvszp
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:
380
382
                    if [p for p in parents if p not in self._parents] != []:
381
383
                        continue
382
384
                    lines = [a + ' ' + l for a, l in
383
 
                             vf.annotate_iter(revision)]
 
385
                             vf.annotate(revision)]
384
386
                    if snapshots is None:
385
387
                        force_snapshot = None
386
388
                    else:
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 = {}