~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

Abbreviate pack_stat struct format to '>6L'

Show diffs side-by-side

added added

removed removed

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