/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/repofmt/groupcompress_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import time
22
22
 
23
 
from bzrlib import (
 
23
from .. import (
24
24
    controldir,
25
25
    chk_map,
26
26
    chk_serializer,
35
35
    ui,
36
36
    versionedfile,
37
37
    )
38
 
from bzrlib.btree_index import (
 
38
from ..btree_index import (
39
39
    BTreeGraphIndex,
40
40
    BTreeBuilder,
41
41
    )
42
 
from bzrlib.decorators import needs_write_lock
43
 
from bzrlib.groupcompress import (
 
42
from ..decorators import needs_write_lock
 
43
from ..groupcompress import (
44
44
    _GCGraphIndex,
45
45
    GroupCompressVersionedFiles,
46
46
    )
47
 
from bzrlib.repofmt.pack_repo import (
 
47
from .pack_repo import (
48
48
    _DirectPackAccess,
49
49
    Pack,
50
50
    NewPack,
55
55
    ResumedPack,
56
56
    Packer,
57
57
    )
58
 
from bzrlib.vf_repository import (
 
58
from ..vf_repository import (
59
59
    StreamSource,
60
60
    )
61
 
from bzrlib.static_tuple import StaticTuple
 
61
from ..static_tuple import StaticTuple
62
62
 
63
63
 
64
64
class GCPack(NewPack):
514
514
class GCCHKReconcilePacker(GCCHKPacker):
515
515
    """A packer which regenerates indices etc as it copies.
516
516
 
517
 
    This is used by ``bzr reconcile`` to cause parent text pointers to be
 
517
    This is used by ``brz reconcile`` to cause parent text pointers to be
518
518
    regenerated.
519
519
    """
520
520
 
760
760
        if missing_chk_roots:
761
761
            problems.append(
762
762
                "missing referenced chk root keys: %s."
763
 
                "Run 'bzr reconcile --canonicalize-chks' on the affected "
 
763
                "Run 'brz reconcile --canonicalize-chks' on the affected "
764
764
                "repository."
765
765
                % (sorted(missing_chk_roots),))
766
766
            # Don't bother checking any further.
778
778
            for record in _filter_text_keys(chk_diff, text_keys,
779
779
                                            chk_map._bytes_to_text_key):
780
780
                pass
781
 
        except errors.NoSuchRevision, e:
 
781
        except errors.NoSuchRevision as e:
782
782
            # XXX: It would be nice if we could give a more precise error here.
783
783
            problems.append("missing chk node(s) for id_to_entry maps")
784
784
        chk_diff = chk_map.iter_interesting_nodes(
787
787
        try:
788
788
            for interesting_rec, interesting_map in chk_diff:
789
789
                pass
790
 
        except errors.NoSuchRevision, e:
 
790
        except errors.NoSuchRevision as e:
791
791
            problems.append(
792
792
                "missing chk node(s) for parent_id_basename_to_file_id maps")
793
793
        present_text_keys = no_fallback_texts_index.get_parent_map(text_keys)
1030
1030
            #       inventories, not missing inventories for revision_ids
1031
1031
            present_parent_inv_keys = self._find_present_inventory_keys(
1032
1032
                                        parent_keys)
1033
 
            present_parent_inv_ids = set(
1034
 
                [k[-1] for k in present_parent_inv_keys])
 
1033
            present_parent_inv_ids = {k[-1] for k in present_parent_inv_keys}
1035
1034
            inventories_to_read = set(revision_ids)
1036
1035
            inventories_to_read.update(present_parent_inv_ids)
1037
1036
            root_key_info = _build_interesting_key_sets(
1053
1052
                    try:
1054
1053
                        file_id_revisions[file_id].add(revision_id)
1055
1054
                    except KeyError:
1056
 
                        file_id_revisions[file_id] = set([revision_id])
 
1055
                        file_id_revisions[file_id] = {revision_id}
1057
1056
        finally:
1058
1057
            pb.finished()
1059
1058
        return file_id_revisions
1095
1094
        """Reconcile this repository to make sure all CHKs are in canonical
1096
1095
        form.
1097
1096
        """
1098
 
        from bzrlib.reconcile import PackReconciler
 
1097
        from breezy.reconcile import PackReconciler
1099
1098
        reconciler = PackReconciler(self, thorough=True, canonicalize_chks=True)
1100
1099
        reconciler.reconcile()
1101
1100
        return reconciler