~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-27 20:24:43 UTC
  • mfrom: (3960.2.1 1.12-progress-warnings)
  • Revision ID: pqm@pqm.ubuntu.com-20090127202443-ty2bu1hh91dumasz
(jam) Avoid getting a UserWarning by not creating an unused progress
        bar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
 
55
55
def find_unmerged(local_branch, remote_branch, restrict='all',
56
 
                  include_merges=False, backward=False,
57
 
                  local_revid_range=None, remote_revid_range=None):
 
56
                  include_merges=False, backward=False):
58
57
    """Find revisions from each side that have not been merged.
59
58
 
60
59
    :param local_branch: Compare the history of local_branch
67
66
    :param include_merges: Show mainline revisions only if False,
68
67
        all revisions otherwise.
69
68
    :param backward: Show oldest versions first when True, newest versions
70
 
        first when False.
71
 
    :param local_revid_range: Revision-id range for filtering local_branch
72
 
        revisions (lower bound, upper bound)
73
 
    :param remote_revid_range: Revision-id range for filtering remote_branch
74
 
        revisions (lower bound, upper bound)
 
69
        first when False. 
75
70
 
76
71
    :return: A list of [(revno, revision_id)] for the mainline revisions on
77
72
        each side.
82
77
        try:
83
78
            return _find_unmerged(
84
79
                local_branch, remote_branch, restrict=restrict,
85
 
                include_merges=include_merges, backward=backward,
86
 
                local_revid_range=local_revid_range,
87
 
                remote_revid_range=remote_revid_range)
 
80
                include_merges=include_merges, backward=backward)
88
81
        finally:
89
82
            remote_branch.unlock()
90
83
    finally:
181
174
    return revline
182
175
 
183
176
 
184
 
def _filter_revs(graph, revs, revid_range):
185
 
    if revid_range is None or revs is None:
186
 
        return revs
187
 
    return [rev for rev in revs
188
 
        if graph.is_between(rev[1], revid_range[0], revid_range[1])]
189
 
 
190
 
 
191
177
def _find_unmerged(local_branch, remote_branch, restrict,
192
 
                   include_merges, backward,
193
 
                   local_revid_range=None, remote_revid_range=None):
 
178
                   include_merges, backward):
194
179
    """See find_unmerged.
195
180
 
196
181
    The branches should already be locked before entering.
229
214
                                     local_revision_id, backward)
230
215
        remotes = _enumerate_mainline(remote_extra, graph, remote_revno,
231
216
                                      remote_revision_id, backward)
232
 
    return _filter_revs(graph, locals, local_revid_range), _filter_revs(graph,
233
 
        remotes, remote_revid_range)
 
217
    return locals, remotes
234
218
 
235
219
 
236
220
def sorted_revisions(revisions, history_map):