~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
297
297
            self._populate_new_inv()
298
298
            self._report_deletes()
299
299
 
300
 
            if not (self.allow_pointless
301
 
                    or len(self.parents) > 1
302
 
                    or self.builder.new_inventory != self.basis_inv):
303
 
                raise PointlessCommit()
 
300
            self._check_pointless()
304
301
 
305
302
            self._emit_progress_update()
306
303
            # TODO: Now the new inventory is known, check for conflicts and
348
345
            self._cleanup()
349
346
        return self.rev_id
350
347
 
 
348
    def _check_pointless(self):
 
349
        if self.allow_pointless:
 
350
            return
 
351
        # A merge with no effect on files
 
352
        if len(self.parents) > 1:
 
353
            return
 
354
        # work around the fact that a newly-initted tree does differ from its
 
355
        # basis
 
356
        if len(self.builder.new_inventory) != len(self.basis_inv):
 
357
            return
 
358
        if (len(self.builder.new_inventory) != 1 and
 
359
            self.builder.new_inventory != self.basis_inv):
 
360
            return
 
361
        raise PointlessCommit()
 
362
 
351
363
    def _check_bound_branch(self):
352
364
        """Check to see if the local branch is bound.
353
365