~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Patch Queue Manager
  • Date: 2012-01-18 20:08:49 UTC
  • mfrom: (6240.5.9 pre_post_command_hooks)
  • Revision ID: pqm@pqm.ubuntu.com-20120118200849-i93mg9cvcwxpvth3
(jelmer) Add pre_command and post_command hooks. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                           ExistingLimbo, ImmortalLimbo, NoFinalPath,
51
51
                           UnableCreateSymlink)
52
52
from bzrlib.filters import filtered_output_bytes, ContentFilterContext
 
53
from bzrlib.mutabletree import MutableTree
53
54
from bzrlib.osutils import (
54
55
    delete_any,
55
56
    file_kind,
57
58
    pathjoin,
58
59
    sha_file,
59
60
    splitpath,
60
 
    supports_executable,
61
61
    )
62
62
from bzrlib.progress import ProgressPhase
63
63
from bzrlib.symbol_versioning import (
156
156
        """
157
157
        if self._tree is None:
158
158
            return
 
159
        for hook in MutableTree.hooks['post_transform']:
 
160
            hook(self._tree, self)
159
161
        self._tree.unlock()
160
162
        self._tree = None
161
163
 
230
232
        irrelevant.
231
233
 
232
234
        """
233
 
        new_roots = [k for k, v in self._new_parent.iteritems() if v is
 
235
        new_roots = [k for k, v in self._new_parent.iteritems() if v ==
234
236
                     ROOT_PARENT]
235
237
        if len(new_roots) < 1:
236
238
            return
626
628
        for trans_id in self._new_parent:
627
629
            seen = set()
628
630
            parent_id = trans_id
629
 
            while parent_id is not ROOT_PARENT:
 
631
            while parent_id != ROOT_PARENT:
630
632
                seen.add(parent_id)
631
633
                try:
632
634
                    parent_id = self.final_parent(parent_id)
642
644
        """If parent directories are versioned, children must be versioned."""
643
645
        conflicts = []
644
646
        for parent_id, children in by_parent.iteritems():
645
 
            if parent_id is ROOT_PARENT:
 
647
            if parent_id == ROOT_PARENT:
646
648
                continue
647
649
            if self.final_file_id(parent_id) is not None:
648
650
                continue
741
743
        """Children must have a directory parent"""
742
744
        conflicts = []
743
745
        for parent_id, children in by_parent.iteritems():
744
 
            if parent_id is ROOT_PARENT:
 
746
            if parent_id == ROOT_PARENT:
745
747
                continue
746
748
            no_children = True
747
749
            for child_id in children:
1722
1724
            calculating one.
1723
1725
        :param _mover: Supply an alternate FileMover, for testing
1724
1726
        """
 
1727
        for hook in MutableTree.hooks['pre_transform']:
 
1728
            hook(self._tree, self)
1725
1729
        if not no_conflicts:
1726
1730
            self._check_malformed()
1727
1731
        child_pb = ui.ui_factory.nested_progress_bar()