/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/missing.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
from . import (
 
21
from bzrlib import (
22
22
    log,
 
23
    symbol_versioning,
23
24
    )
24
 
from . import revision as _mod_revision
 
25
import bzrlib.revision as _mod_revision
25
26
 
26
27
 
27
28
def iter_log_revisions(revisions, revision_source, verbose, rev_tag_dict=None):
30
31
 
31
32
    if rev_tag_dict is None:
32
33
        rev_tag_dict = {}
33
 
    for revno, rev_id, merge_depth in revisions:
 
34
    for rev in revisions:
 
35
        # We need the following for backward compatibilty (hopefully
 
36
        # this will be deprecated soon :-/) -- vila 080911
 
37
        if len(rev) == 2:
 
38
            revno, rev_id = rev
 
39
            merge_depth = 0
 
40
        else:
 
41
            revno, rev_id, merge_depth = rev
34
42
        rev = revision_source.get_revision(rev_id)
35
43
        if verbose:
36
44
            delta = revision_source.get_revision_delta(rev_id)
42
50
 
43
51
def find_unmerged(local_branch, remote_branch, restrict='all',
44
52
                  include_merged=None, backward=False,
45
 
                  local_revid_range=None, remote_revid_range=None):
 
53
                  local_revid_range=None, remote_revid_range=None,
 
54
                  include_merges=symbol_versioning.DEPRECATED_PARAMETER):
46
55
    """Find revisions from each side that have not been merged.
47
56
 
48
57
    :param local_branch: Compare the history of local_branch
60
69
        revisions (lower bound, upper bound)
61
70
    :param remote_revid_range: Revision-id range for filtering remote_branch
62
71
        revisions (lower bound, upper bound)
 
72
    :param include_merges: Deprecated historical alias for include_merged
63
73
 
64
74
    :return: A list of [(revno, revision_id)] for the mainline revisions on
65
75
        each side.
66
76
    """
 
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
67
84
    if include_merged is None:
68
85
        include_merged = False
69
86
    local_branch.lock_read()
90
107
    :param tip: The tip of mainline
91
108
    :param backward: Show oldest versions first when True, newest versions
92
109
        first when False.
93
 
    :return: [(revno, revision_id, 0)] for all revisions in ancestry that
 
110
    :return: [(revno, revision_id)] for all revisions in ancestry that
94
111
        are left-hand parents from tip, or None if ancestry is None.
95
112
    """
96
113
    if ancestry is None:
110
127
        parents = parent_map.get(cur)
111
128
        if not parents:
112
129
            break # Ghost, we are done
113
 
        mainline.append((str(cur_revno), cur, 0))
 
130
        mainline.append((str(cur_revno), cur))
114
131
        cur = parents[0]
115
132
        cur_revno -= 1
116
133
    if not backward:
206
223
 
207
224
 
208
225
def sorted_revisions(revisions, history_map):
209
 
    revisions = sorted([(history_map[r], r) for r in revisions])
 
226
    revisions = [(history_map[r],r) for r in revisions]
 
227
    revisions.sort()
210
228
    return revisions