~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

  • Committer: Martin Pool
  • Date: 2011-04-19 07:52:11 UTC
  • mto: This revision was merged to the branch mainline in revision 5833.
  • Revision ID: mbp@sourcefrog.net-20110419075211-3m94qorhr0rg3gzg
Add and test _RulesSearcher.get_single_value

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,
24
21
    )
25
22
import bzrlib.revision as _mod_revision
26
23
 
45
42
 
46
43
 
47
44
def find_unmerged(local_branch, remote_branch, restrict='all',
48
 
                  include_merged=None, backward=False,
49
 
                  local_revid_range=None, remote_revid_range=None,
50
 
                  include_merges=symbol_versioning.DEPRECATED_PARAMETER):
 
45
                  include_merges=False, backward=False,
 
46
                  local_revid_range=None, remote_revid_range=None):
51
47
    """Find revisions from each side that have not been merged.
52
48
 
53
49
    :param local_branch: Compare the history of local_branch
57
53
        unique revisions from both sides. If 'local', we will return None
58
54
        for the remote revisions, similarly if 'remote' we will return None for
59
55
        the local revisions.
60
 
    :param include_merged: Show mainline revisions only if False,
 
56
    :param include_merges: Show mainline revisions only if False,
61
57
        all revisions otherwise.
62
58
    :param backward: Show oldest versions first when True, newest versions
63
59
        first when False.
65
61
        revisions (lower bound, upper bound)
66
62
    :param remote_revid_range: Revision-id range for filtering remote_branch
67
63
        revisions (lower bound, upper bound)
68
 
    :param include_merges: Deprecated historical alias for include_merged
69
64
 
70
65
    :return: A list of [(revno, revision_id)] for the mainline revisions on
71
66
        each side.
72
67
    """
73
 
    if symbol_versioning.deprecated_passed(include_merges):
74
 
        symbol_versioning.warn(
75
 
            'include_merges was deprecated in 2.5.'
76
 
            ' Use include_merged instead.',
77
 
            DeprecationWarning, stacklevel=2)
78
 
        if include_merged is None:
79
 
            include_merged = include_merges
80
 
    if include_merged is None:
81
 
        include_merged = False
82
68
    local_branch.lock_read()
83
69
    try:
84
70
        remote_branch.lock_read()
85
71
        try:
86
72
            return _find_unmerged(
87
73
                local_branch, remote_branch, restrict=restrict,
88
 
                include_merged=include_merged, backward=backward,
 
74
                include_merges=include_merges, backward=backward,
89
75
                local_revid_range=local_revid_range,
90
76
                remote_revid_range=remote_revid_range)
91
77
        finally:
174
160
 
175
161
 
176
162
def _find_unmerged(local_branch, remote_branch, restrict,
177
 
                   include_merged, backward,
 
163
                   include_merges, backward,
178
164
                   local_revid_range=None, remote_revid_range=None):
179
165
    """See find_unmerged.
180
166
 
200
186
                             ' "remote": %r' % (restrict,))
201
187
        local_extra, remote_extra = graph.find_difference(local_revision_id,
202
188
                                                          remote_revision_id)
203
 
    if include_merged:
 
189
    if include_merges:
204
190
        locals = _enumerate_with_merges(local_branch, local_extra,
205
191
                                        graph, local_revno,
206
192
                                        local_revision_id, backward)