~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

  • Committer: Vincent Ladeuil
  • Date: 2010-03-10 09:33:04 UTC
  • mto: (5082.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5083.
  • Revision ID: v.ladeuil+lp@free.fr-20100310093304-4245t4tazd4sxoav
Cleanup test from overly cautious checks.

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
 
from __future__ import absolute_import
20
 
 
21
19
from bzrlib import (
22
20
    log,
23
 
    symbol_versioning,
 
21
    repository as _mod_repository,
 
22
    tsort,
24
23
    )
25
24
import bzrlib.revision as _mod_revision
26
25
 
27
26
 
28
 
def iter_log_revisions(revisions, revision_source, verbose, rev_tag_dict=None):
 
27
def iter_log_revisions(revisions, revision_source, verbose):
29
28
    last_tree = revision_source.revision_tree(_mod_revision.NULL_REVISION)
30
29
    last_rev_id = None
31
 
 
32
 
    if rev_tag_dict is None:
33
 
        rev_tag_dict = {}
34
30
    for rev in revisions:
35
31
        # We need the following for backward compatibilty (hopefully
36
32
        # this will be deprecated soon :-/) -- vila 080911
44
40
            delta = revision_source.get_revision_delta(rev_id)
45
41
        else:
46
42
            delta = None
47
 
        yield log.LogRevision(rev, revno, merge_depth, delta=delta,
48
 
                              tags=rev_tag_dict.get(rev_id))
 
43
        yield log.LogRevision(rev, revno, merge_depth, delta=delta)
49
44
 
50
45
 
51
46
def find_unmerged(local_branch, remote_branch, restrict='all',
52
 
                  include_merged=None, backward=False,
53
 
                  local_revid_range=None, remote_revid_range=None,
54
 
                  include_merges=symbol_versioning.DEPRECATED_PARAMETER):
 
47
                  include_merges=False, backward=False,
 
48
                  local_revid_range=None, remote_revid_range=None):
55
49
    """Find revisions from each side that have not been merged.
56
50
 
57
51
    :param local_branch: Compare the history of local_branch
61
55
        unique revisions from both sides. If 'local', we will return None
62
56
        for the remote revisions, similarly if 'remote' we will return None for
63
57
        the local revisions.
64
 
    :param include_merged: Show mainline revisions only if False,
 
58
    :param include_merges: Show mainline revisions only if False,
65
59
        all revisions otherwise.
66
60
    :param backward: Show oldest versions first when True, newest versions
67
61
        first when False.
69
63
        revisions (lower bound, upper bound)
70
64
    :param remote_revid_range: Revision-id range for filtering remote_branch
71
65
        revisions (lower bound, upper bound)
72
 
    :param include_merges: Deprecated historical alias for include_merged
73
66
 
74
67
    :return: A list of [(revno, revision_id)] for the mainline revisions on
75
68
        each side.
76
69
    """
77
 
    if symbol_versioning.deprecated_passed(include_merges):
78
 
        symbol_versioning.warn(
79
 
            'include_merges was deprecated in 2.5.'
80
 
            ' Use include_merged instead.',
81
 
            DeprecationWarning, stacklevel=2)
82
 
        if include_merged is None:
83
 
            include_merged = include_merges
84
 
    if include_merged is None:
85
 
        include_merged = False
86
70
    local_branch.lock_read()
87
71
    try:
88
72
        remote_branch.lock_read()
89
73
        try:
90
74
            return _find_unmerged(
91
75
                local_branch, remote_branch, restrict=restrict,
92
 
                include_merged=include_merged, backward=backward,
 
76
                include_merges=include_merges, backward=backward,
93
77
                local_revid_range=local_revid_range,
94
78
                remote_revid_range=remote_revid_range)
95
79
        finally:
178
162
 
179
163
 
180
164
def _find_unmerged(local_branch, remote_branch, restrict,
181
 
                   include_merged, backward,
 
165
                   include_merges, backward,
182
166
                   local_revid_range=None, remote_revid_range=None):
183
167
    """See find_unmerged.
184
168
 
204
188
                             ' "remote": %r' % (restrict,))
205
189
        local_extra, remote_extra = graph.find_difference(local_revision_id,
206
190
                                                          remote_revision_id)
207
 
    if include_merged:
 
191
    if include_merges:
208
192
        locals = _enumerate_with_merges(local_branch, local_extra,
209
193
                                        graph, local_revno,
210
194
                                        local_revision_id, backward)