~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

  • Committer: Aaron Bentley
  • Date: 2006-02-22 14:39:42 UTC
  • mto: (2027.1.2 revert-subpath-56549)
  • mto: This revision was merged to the branch mainline in revision 1570.
  • Revision ID: abentley@panoramicfeedback.com-20060222143942-ae72299f2de66767
Fixed build_tree with symlinks

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""\
2
 
A plugin for displaying what revisions are in 'other' but not in local.
3
 
"""
4
 
from bzrlib.ui import ui_factory
 
1
"""Display what revisions are missing in 'other' from 'this' and vice verca."""
 
2
 
 
3
import bzrlib.ui as ui
 
4
 
 
5
 
5
6
def iter_log_data(revisions, revision_source, verbose):
6
7
    from bzrlib.diff import compare_trees
7
8
    from bzrlib.tree import EmptyTree
10
11
    for revno, rev_id in revisions:
11
12
        rev = revision_source.get_revision(rev_id)
12
13
        if verbose:
 
14
            remote_tree = revision_source.revision_tree(rev_id)
13
15
            parent_rev_id = rev.parent_ids[0]
14
16
            if last_rev_id == parent_rev_id:
15
17
                parent_tree = last_tree
25
27
 
26
28
 
27
29
def find_unmerged(local_branch, remote_branch):
28
 
    progress = ui_factory.progress_bar()
 
30
    progress = ui.ui_factory.progress_bar()
29
31
    local_branch.lock_read()
30
32
    try:
31
33
        remote_branch.lock_read()
43
45
                                                remote_rev_history_map)
44
46
                return local_extra, remote_extra
45
47
 
46
 
            local_ancestry = _get_ancestry(local_branch, progress, "local",
47
 
                                           2, local_rev_history)
48
 
            remote_ancestry = _get_ancestry(remote_branch, progress, "remote",
49
 
                                            3, remote_rev_history)
 
48
            local_ancestry = _get_ancestry(local_branch.repository, progress, 
 
49
                                           "local", 2, local_rev_history)
 
50
            remote_ancestry = _get_ancestry(remote_branch.repository, progress,
 
51
                                            "remote", 3, remote_rev_history)
50
52
            progress.update('pondering', 4, 5)
51
53
            extras = local_ancestry.symmetric_difference(remote_ancestry) 
52
54
            local_extra = extras.intersection(set(local_rev_history))
87
89
         for rev in rev_history])
88
90
    return rev_history, rev_history_map
89
91
 
90
 
def _get_ancestry(branch, progress, label, step, rev_history):
 
92
def _get_ancestry(repository, progress, label, step, rev_history):
91
93
    progress.update('%s ancestry' % label, step, 5)
92
94
    if len(rev_history) > 0:
93
 
        ancestry = set(branch.get_ancestry(rev_history[-1]))
 
95
        ancestry = set(repository.get_ancestry(rev_history[-1]))
94
96
    else:
95
97
        ancestry = set()
96
98
    return ancestry