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

(robertc) Alter the pending-merges api so that when the last-revision of a tree is None, the left most pending merge becomes the last-revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
            # check for out of date working trees
248
248
            # if we are bound, then self.branch is the master branch and this
249
249
            # test is thus all we need.
250
 
            if self.work_tree.last_revision() != self.master_branch.last_revision():
 
250
            master_last = self.master_branch.last_revision()
 
251
            if (master_last is not None and 
 
252
                master_last != self.work_tree.last_revision()):
251
253
                raise errors.OutOfDateTree(self.work_tree)
252
254
    
253
255
            if strict:
279
281
            if len(self.parents) > 1 and self.specific_files:
280
282
                raise NotImplementedError('selected-file commit of merges is not supported yet: files %r',
281
283
                        self.specific_files)
282
 
            self._check_parents_present()
 
284
            
283
285
            self.builder = self.branch.get_commit_builder(self.parents, 
284
286
                self.config, timestamp, timezone, committer, revprops, rev_id)
285
287
            
438
440
        self.parent_invs = []
439
441
        for revision in self.parents:
440
442
            if self.branch.repository.has_revision(revision):
 
443
                mutter('commit parent revision {%s}', revision)
441
444
                inventory = self.branch.repository.get_inventory(revision)
442
445
                self.parent_invs.append(inventory)
 
446
            else:
 
447
                mutter('commit parent ghost revision {%s}', revision)
443
448
 
444
 
    def _check_parents_present(self):
445
 
        for parent_id in self.parents:
446
 
            mutter('commit parent revision {%s}', parent_id)
447
 
            if not self.branch.repository.has_revision(parent_id):
448
 
                if parent_id == self.branch.last_revision():
449
 
                    warning("parent is missing %r", parent_id)
450
 
                    raise BzrCheckError("branch %s is missing revision {%s}"
451
 
                            % (self.branch, parent_id))
452
 
            
453
449
    def _remove_deleted(self):
454
450
        """Remove deleted files from the working inventories.
455
451