~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-03-11 12:05:34 UTC
  • mfrom: (5713.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110311120534-mzt6xi5s7onrlrio
(vila) Merge 2.3 into trunk including fix for bug #437003 (Vincent
        Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
421
421
        inventory_keys = source_vf.keys()
422
422
        missing_inventories = set(self.revision_keys).difference(inventory_keys)
423
423
        if missing_inventories:
424
 
            missing_inventories = sorted(missing_inventories)
425
 
            raise ValueError('We are missing inventories for revisions: %s'
426
 
                % (missing_inventories,))
 
424
            # Go back to the original repo, to see if these are really missing
 
425
            # https://bugs.launchpad.net/bzr/+bug/437003
 
426
            # If we are packing a subset of the repo, it is fine to just have
 
427
            # the data in another Pack file, which is not included in this pack
 
428
            # operation.
 
429
            inv_index = self._pack_collection.repo.inventories._index
 
430
            pmap = inv_index.get_parent_map(missing_inventories)
 
431
            really_missing = missing_inventories.difference(pmap)
 
432
            if really_missing:
 
433
                missing_inventories = sorted(really_missing)
 
434
                raise ValueError('We are missing inventories for revisions: %s'
 
435
                    % (missing_inventories,))
427
436
        self._copy_stream(source_vf, target_vf, inventory_keys,
428
437
                          'inventories', self._get_filtered_inv_stream, 2)
429
438