~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-02-21 15:09:19 UTC
  • mto: This revision was merged to the branch mainline in revision 5675.
  • Revision ID: jelmer@samba.org-20110221150919-v7nnbontcuhi1dmu
Move Repository._find_text_key_references_from_xml_inventory_lines onto the serializer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
        # used on media which doesn't differentiate the case of names.
81
81
        self.case_sensitive = True
82
82
 
83
 
    def is_control_filename(self, filename):
84
 
        """True if filename is the name of a control file in this tree.
85
 
 
86
 
        :param filename: A filename within the tree. This is a relative path
87
 
        from the root of this tree.
88
 
 
89
 
        This is true IF and ONLY IF the filename is part of the meta data
90
 
        that bzr controls in this tree. I.E. a random .bzr directory placed
91
 
        on disk will not be a control file for this tree.
92
 
        """
93
 
        raise NotImplementedError(self.is_control_filename)
94
 
 
95
83
    @needs_tree_write_lock
96
84
    def add(self, files, ids=None, kinds=None):
97
85
        """Add paths to the set of versioned paths.
652
640
        """Create the default hooks.
653
641
 
654
642
        """
655
 
        hooks.Hooks.__init__(self, "bzrlib.mutabletree", "MutableTree.hooks")
656
 
        self.add_hook('start_commit',
 
643
        hooks.Hooks.__init__(self)
 
644
        self.create_hook(hooks.HookPoint('start_commit',
657
645
            "Called before a commit is performed on a tree. The start commit "
658
646
            "hook is able to change the tree before the commit takes place. "
659
647
            "start_commit is called with the bzrlib.mutabletree.MutableTree "
660
 
            "that the commit is being performed on.", (1, 4))
661
 
        self.add_hook('post_commit',
 
648
            "that the commit is being performed on.", (1, 4), None))
 
649
        self.create_hook(hooks.HookPoint('post_commit',
662
650
            "Called after a commit is performed on a tree. The hook is "
663
651
            "called with a bzrlib.mutabletree.PostCommitHookParams object. "
664
652
            "The mutable tree the commit was performed on is available via "
665
 
            "the mutable_tree attribute of that object.", (2, 0))
 
653
            "the mutable_tree attribute of that object.", (2, 0), None))
666
654
 
667
655
 
668
656
# install the default hooks into the MutableTree class.