~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-11 04:06:55 UTC
  • mto: This revision was merged to the branch mainline in revision 6362.
  • Revision ID: jelmer@samba.org-20111211040655-89lapqvfadi25j2m
Fix creation of obsolete_packs if it is missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1221
1221
        """
1222
1222
        for pack in packs:
1223
1223
            try:
1224
 
                pack.pack_transport.move(pack.file_name(),
1225
 
                    '../obsolete_packs/' + pack.file_name())
 
1224
                try:
 
1225
                    pack.pack_transport.move(pack.file_name(),
 
1226
                        '../obsolete_packs/' + pack.file_name())
 
1227
                except errors.NoSuchFile:
 
1228
                    # perhaps obsolete_packs was removed? Let's create it and
 
1229
                    # try again
 
1230
                    pack.pack_transport.mkdir('../obsolete_packs/')
 
1231
                    pack.pack_transport.move(pack.file_name(),
 
1232
                        '../obsolete_packs/' + pack.file_name())
1226
1233
            except (errors.PathError, errors.TransportError), e:
1227
1234
                # TODO: Should these be warnings or mutters?
1228
1235
                mutter("couldn't rename obsolete pack, skipping it:\n%s"