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

  • Committer: Andrew Bennetts
  • Date: 2008-11-12 02:29:03 UTC
  • mto: This revision was merged to the branch mainline in revision 3833.
  • Revision ID: andrew.bennetts@canonical.com-20081112022903-jrpp1r2g6h12zlkf
Add suppress_errors to abort_write_group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        one_two,
56
56
        one_six,
57
57
        )
58
 
from bzrlib.trace import mutter, mutter_callsite, warning
 
58
from bzrlib.trace import (
 
59
    log_exception_quietly, note, mutter, mutter_callsite, warning)
59
60
 
60
61
 
61
62
# Old formats display a warning, but only once
513
514
        r'.* revision="(?P<revision_id>[^"]+)"'
514
515
        )
515
516
 
516
 
    def abort_write_group(self):
 
517
    def abort_write_group(self, suppress_errors=False):
517
518
        """Commit the contents accrued within the current write group.
518
519
 
519
520
        :seealso: start_write_group.
521
522
        if self._write_group is not self.get_transaction():
522
523
            # has an unlock or relock occured ?
523
524
            raise errors.BzrError('mismatched lock context and write group.')
524
 
        self._abort_write_group()
 
525
        try:
 
526
            self._abort_write_group()
 
527
        except Exception, exc:
 
528
            self._write_group = None
 
529
            if not suppress_errors:
 
530
                raise
 
531
            mutter('abort_write_group failed')
 
532
            log_exception_quietly()
 
533
            note('bzr: ERROR (ignored): %s', exc)
525
534
        self._write_group = None
526
535
 
527
536
    def _abort_write_group(self):