/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/merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-12 09:49:37 UTC
  • mfrom: (2598.5.9 nullrevision)
  • Revision ID: pqm@pqm.ubuntu.com-20070712094937-rw5qbi81enh0pvhw
Make most functions prefer NULL_REVISION

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import (
23
23
    osutils,
24
24
    registry,
 
25
    revision as _mod_revision,
25
26
    )
26
27
from bzrlib.branch import Branch
27
28
from bzrlib.conflicts import ConflictList, Conflict
103
104
        object.__init__(self)
104
105
        assert this_tree is not None, "this_tree is required"
105
106
        self.this_branch = this_branch
106
 
        self.this_basis = this_branch.last_revision()
 
107
        self.this_basis = _mod_revision.ensure_null(
 
108
            this_branch.last_revision())
107
109
        self.this_rev_id = None
108
110
        self.this_tree = this_tree
109
111
        self.this_revision_tree = None
214
216
        self.other_branch, self.other_tree = _get_tree(other_revision,
215
217
                                                  self.this_branch)
216
218
        if other_revision[1] == -1:
217
 
            self.other_rev_id = self.other_branch.last_revision()
218
 
            if self.other_rev_id is None:
 
219
            self.other_rev_id = _mod_revision.ensure_null(
 
220
                self.other_branch.last_revision())
 
221
            if _mod_revision.is_null(self.other_rev_id):
219
222
                raise NoCommits(self.other_branch)
220
223
            self.other_basis = self.other_rev_id
221
224
        elif other_revision[1] is not None:
278
281
            if base_revision[1] == -1:
279
282
                self.base_rev_id = base_branch.last_revision()
280
283
            elif base_revision[1] is None:
281
 
                self.base_rev_id = None
 
284
                self.base_rev_id = _mod_revision.NULL_REVISION
282
285
            else:
283
 
                self.base_rev_id = base_branch.get_rev_id(base_revision[1])
 
286
                self.base_rev_id = _mod_revision.ensure_null(
 
287
                    base_branch.get_rev_id(base_revision[1]))
284
288
            if self.this_branch.base != base_branch.base:
285
289
                self.this_branch.fetch(base_branch)
286
290
            self.base_is_ancestor = is_ancestor(self.this_basis,