/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 breezy/missing.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-15 10:20:16 UTC
  • mfrom: (6967 work)
  • mto: (6973.5.1 python3-c)
  • mto: This revision was merged to the branch mainline in revision 6984.
  • Revision ID: jelmer@jelmer.uk-20180515102016-tnlhsl574pfpplin
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from __future__ import absolute_import
20
20
 
21
21
from . import (
 
22
    errors,
22
23
    log,
23
24
    )
24
25
from . import revision as _mod_revision
110
111
        parents = parent_map.get(cur)
111
112
        if not parents:
112
113
            break # Ghost, we are done
113
 
        mainline.append((str(cur_revno), cur, 0))
 
114
        mainline.append((str(cur_revno) if cur_revno is not None else None, cur, 0))
114
115
        cur = parents[0]
115
 
        cur_revno -= 1
 
116
        if cur_revno is not None:
 
117
            cur_revno -= 1
116
118
    if not backward:
117
119
        mainline.reverse()
118
120
    return mainline
167
169
 
168
170
    The branches should already be locked before entering.
169
171
    """
170
 
    local_revno, local_revision_id = local_branch.last_revision_info()
171
 
    remote_revno, remote_revision_id = remote_branch.last_revision_info()
172
 
    if local_revno == remote_revno and local_revision_id == remote_revision_id:
 
172
    try:
 
173
        local_revno, local_revision_id = local_branch.last_revision_info()
 
174
    except (errors.UnsupportedOperation, errors.GhostRevisionsHaveNoRevno):
 
175
        local_revno = None
 
176
        local_revision_id = local_branch.last_revision()
 
177
    try:
 
178
        remote_revno, remote_revision_id = remote_branch.last_revision_info()
 
179
    except (errors.UnsupportedOperation, errors.GhostRevisionsHaveNoRevno):
 
180
        remote_revision_id = remote_branch.last_revision()
 
181
        remote_revno = None
 
182
 
 
183
    if local_revision_id == remote_revision_id:
173
184
        # A simple shortcut when the tips are at the same point
174
185
        return [], []
175
186
    graph = local_branch.repository.get_graph(remote_branch.repository)