/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

  • Committer: Aaron Bentley
  • Date: 2006-08-24 18:37:24 UTC
  • mto: (1910.2.43 format-bumps)
  • mto: This revision was merged to the branch mainline in revision 1997.
  • Revision ID: abentley@panoramicfeedback.com-20060824183724-7a648a260a5b587d
Handle empty commits, fix test

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
            self._populate_new_inv()
288
288
            self._report_deletes()
289
289
 
290
 
            if not (self.allow_pointless
291
 
                    or len(self.parents) > 1
292
 
                    or self.builder.new_inventory != self.basis_inv):
293
 
                raise PointlessCommit()
 
290
            self._check_pointless()
294
291
 
295
292
            self._emit_progress_update()
296
293
            # TODO: Now the new inventory is known, check for conflicts and
335
332
            self._cleanup()
336
333
        return self.rev_id
337
334
 
 
335
    def _check_pointless(self):
 
336
        if self.allow_pointless:
 
337
            return
 
338
        # A merge with no effect on files
 
339
        if len(self.parents) > 1:
 
340
            return
 
341
        # work around the fact that a newly-initted tree does differ from its
 
342
        # basis
 
343
        if len(self.builder.new_inventory) != len(self.basis_inv):
 
344
            return
 
345
        if (len(self.builder.new_inventory) != 1 and
 
346
            self.builder.new_inventory != self.basis_inv):
 
347
            return
 
348
        raise PointlessCommit()
 
349
 
338
350
    def _check_bound_branch(self):
339
351
        """Check to see if the local branch is bound.
340
352