~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-27 01:32:30 UTC
  • mfrom: (3446.2.2 nfs-failure)
  • Revision ID: pqm@pqm.ubuntu.com-20080527013230-8qjaju10duxpy3e2
(mbp) Just warn about errors deleting obsolete packs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1589
1589
                mode=self.repo.bzrdir._get_file_mode())
1590
1590
            # move the baseline forward
1591
1591
            self._packs_at_load = disk_nodes
1592
 
            # now clear out the obsolete packs directory
1593
1592
            if clear_obsolete_packs:
1594
 
                self.transport.clone('obsolete_packs').delete_multi(
1595
 
                    self.transport.list_dir('obsolete_packs'))
 
1593
                self._clear_obsolete_packs()
1596
1594
        finally:
1597
1595
            self._unlock_names()
1598
1596
        # synchronise the memory packs list with what we just wrote:
1624
1622
                self._names[name] = sizes
1625
1623
                self.get_pack_by_name(name)
1626
1624
 
 
1625
    def _clear_obsolete_packs(self):
 
1626
        """Delete everything from the obsolete-packs directory.
 
1627
        """
 
1628
        obsolete_pack_transport = self.transport.clone('obsolete_packs')
 
1629
        for filename in obsolete_pack_transport.list_dir('.'):
 
1630
            try:
 
1631
                obsolete_pack_transport.delete(filename)
 
1632
            except (errors.PathError, errors.TransportError), e:
 
1633
                warning("couldn't delete obsolete pack, skipping it:\n%s" % (e,))
 
1634
 
1627
1635
    def _start_write_group(self):
1628
1636
        # Do not permit preparation for writing if we're not in a 'write lock'.
1629
1637
        if not self.repo.is_write_locked():