/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 breezy/bzr/pack_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2019-08-11 13:21:03 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7388.
  • Revision ID: jelmer@jelmer.uk-20190811132103-u3ne03yf37c1h57n
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1550
1550
        # FIXME: just drop the transient index.
1551
1551
        # forget what names there are
1552
1552
        if self._new_pack is not None:
1553
 
            operation = cleanup.OperationWithCleanups(self._new_pack.abort)
1554
 
            operation.add_cleanup(setattr, self, '_new_pack', None)
1555
 
            # If we aborted while in the middle of finishing the write
1556
 
            # group, _remove_pack_indices could fail because the indexes are
1557
 
            # already gone.  But they're not there we shouldn't fail in this
1558
 
            # case, so we pass ignore_missing=True.
1559
 
            operation.add_cleanup(self._remove_pack_indices, self._new_pack,
1560
 
                                  ignore_missing=True)
1561
 
            operation.run_simple()
 
1553
            with cleanup.ExitStack() as stack:
 
1554
                stack.callback(setattr, self, '_new_pack', None)
 
1555
                # If we aborted while in the middle of finishing the write
 
1556
                # group, _remove_pack_indices could fail because the indexes are
 
1557
                # already gone.  But they're not there we shouldn't fail in this
 
1558
                # case, so we pass ignore_missing=True.
 
1559
                stack.callback(self._remove_pack_indices, self._new_pack,
 
1560
                               ignore_missing=True)
 
1561
                self._new_pack.abort()
1562
1562
        for resumed_pack in self._resumed_packs:
1563
 
            operation = cleanup.OperationWithCleanups(resumed_pack.abort)
1564
 
            # See comment in previous finally block.
1565
 
            operation.add_cleanup(self._remove_pack_indices, resumed_pack,
1566
 
                                  ignore_missing=True)
1567
 
            operation.run_simple()
 
1563
            with cleanup.ExitStack() as stack:
 
1564
                # See comment in previous finally block.
 
1565
                stack.callback(self._remove_pack_indices, resumed_pack,
 
1566
                               ignore_missing=True)
 
1567
                resumed_pack.abort()
1568
1568
        del self._resumed_packs[:]
1569
1569
 
1570
1570
    def _remove_resumed_pack_indices(self):