/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

Alter set_pending_merges to shove the left most merge into the trees last-revision if that is not set. Related bugfixes include basis_tree handling ghosts, de-duping the merges with the last-revision and update changing where and how it adds its pending merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
            # check for out of date working trees
261
261
            # if we are bound, then self.branch is the master branch and this
262
262
            # test is thus all we need.
263
 
            if self.work_tree.last_revision() != self.master_branch.last_revision():
 
263
            master_last = self.master_branch.last_revision()
 
264
            if (master_last is not None and 
 
265
                master_last != self.work_tree.last_revision()):
264
266
                raise errors.OutOfDateTree(self.work_tree)
265
267
    
266
268
            if strict:
292
294
            if len(self.parents) > 1 and self.specific_files:
293
295
                raise NotImplementedError('selected-file commit of merges is not supported yet: files %r',
294
296
                        self.specific_files)
295
 
            self._check_parents_present()
 
297
            
296
298
            self.builder = self.branch.get_commit_builder(self.parents, 
297
299
                self.config, timestamp, timezone, committer, revprops, rev_id)
298
300
            
451
453
        self.parent_invs = []
452
454
        for revision in self.parents:
453
455
            if self.branch.repository.has_revision(revision):
 
456
                mutter('commit parent revision {%s}', revision)
454
457
                inventory = self.branch.repository.get_inventory(revision)
455
458
                self.parent_invs.append(inventory)
 
459
            else:
 
460
                mutter('commit parent ghost revision {%s}', revision)
456
461
 
457
 
    def _check_parents_present(self):
458
 
        for parent_id in self.parents:
459
 
            mutter('commit parent revision {%s}', parent_id)
460
 
            if not self.branch.repository.has_revision(parent_id):
461
 
                if parent_id == self.branch.last_revision():
462
 
                    warning("parent is missing %r", parent_id)
463
 
                    raise BzrCheckError("branch %s is missing revision {%s}"
464
 
                            % (self.branch, parent_id))
465
 
            
466
462
    def _remove_deleted(self):
467
463
        """Remove deleted files from the working inventories.
468
464