~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Display what revisions are missing in 'other' from 'this' and vice versa."""
18
18
 
19
 
import bzrlib.ui as ui
20
 
 
21
 
 
 
19
from bzrlib import ui
 
20
from bzrlib.log import (
 
21
    LogRevision,
 
22
    )
 
23
from bzrlib.symbol_versioning import (
 
24
    deprecated_function,
 
25
    zero_seventeen,
 
26
    )
 
27
 
 
28
 
 
29
@deprecated_function(zero_seventeen)
22
30
def iter_log_data(revisions, revision_source, verbose):
 
31
    for revision in iter_log_revisions(revisions, revision_source, verbose):
 
32
        yield revision.revno, revision.rev, revision.delta
 
33
 
 
34
 
 
35
def iter_log_revisions(revisions, revision_source, verbose):
23
36
    last_tree = revision_source.revision_tree(None)
24
37
    last_rev_id = None
25
38
    for revno, rev_id in revisions:
37
50
            delta = revision_tree.changes_from(parent_tree)
38
51
        else:
39
52
            delta = None
40
 
        yield revno, rev, delta
 
53
        yield LogRevision(rev, revno, delta=delta)
41
54
 
42
55
 
43
56
def find_unmerged(local_branch, remote_branch):
46
59
    try:
47
60
        remote_branch.lock_read()
48
61
        try:
 
62
            # check for special case: both branches are equivalent
 
63
            if (local_branch.last_revision_info() ==
 
64
                remote_branch.last_revision_info()):
 
65
                return [], []
49
66
            local_rev_history, local_rev_history_map = \
50
67
                _get_history(local_branch, progress, "local", 0)
51
68
            remote_rev_history, remote_rev_history_map = \
106
123
def _get_ancestry(repository, progress, label, step, rev_history):
107
124
    progress.update('%s ancestry' % label, step, 5)
108
125
    if len(rev_history) > 0:
109
 
        ancestry = set(repository.get_ancestry(rev_history[-1]))
 
126
        ancestry = set(repository.get_ancestry(rev_history[-1],
 
127
                       topo_sorted=False))
110
128
    else:
111
129
        ancestry = set()
112
130
    return ancestry