~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Jelmer Vernooij
  • Date: 2011-01-13 00:14:31 UTC
  • mto: (5582.10.11 weave-fmt-plugin)
  • mto: This revision was merged to the branch mainline in revision 5607.
  • Revision ID: jelmer@samba.org-20110113001431-gql5gc1orrmjjbyv
More lazy loading (of urlutils and ui).

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    revision as _mod_revision,
39
39
    trace,
40
40
    ui,
 
41
    urlutils,
41
42
    )
42
43
""")
43
44
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
50
51
    delete_any,
51
52
    file_kind,
52
53
    has_symlinks,
53
 
    lexists,
54
54
    pathjoin,
55
55
    sha_file,
56
56
    splitpath,
62
62
        deprecated_in,
63
63
        deprecated_method,
64
64
        )
65
 
from bzrlib.trace import mutter, warning
 
65
from bzrlib.trace import warning
66
66
from bzrlib import tree
67
 
import bzrlib.ui
68
 
import bzrlib.urlutils as urlutils
69
67
 
70
68
 
71
69
ROOT_PARENT = "root-parent"
1675
1673
        """
1676
1674
        if not no_conflicts:
1677
1675
            self._check_malformed()
1678
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1676
        child_pb = ui.ui_factory.nested_progress_bar()
1679
1677
        try:
1680
1678
            if precomputed_delta is None:
1681
1679
                child_pb.update('Apply phase', 0, 2)
1708
1706
    def _generate_inventory_delta(self):
1709
1707
        """Generate an inventory delta for the current transform."""
1710
1708
        inventory_delta = []
1711
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1709
        child_pb = ui.ui_factory.nested_progress_bar()
1712
1710
        new_paths = self._inventory_altered()
1713
1711
        total_entries = len(new_paths) + len(self._removed_id)
1714
1712
        try:
1776
1774
        """
1777
1775
        tree_paths = list(self._tree_path_ids.iteritems())
1778
1776
        tree_paths.sort(reverse=True)
1779
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1777
        child_pb = ui.ui_factory.nested_progress_bar()
1780
1778
        try:
1781
1779
            for num, data in enumerate(tree_paths):
1782
1780
                path, trans_id = data
1811
1809
        modified_paths = []
1812
1810
        new_path_file_ids = dict((t, self.final_file_id(t)) for p, t in
1813
1811
                                 new_paths)
1814
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1812
        child_pb = ui.ui_factory.nested_progress_bar()
1815
1813
        try:
1816
1814
            for num, (path, trans_id) in enumerate(new_paths):
1817
1815
                if (num % 10) == 0:
2429
2427
        if num > 0:  # more than just a root
2430
2428
            raise errors.WorkingTreeAlreadyPopulated(base=wt.basedir)
2431
2429
    file_trans_id = {}
2432
 
    top_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2430
    top_pb = ui.ui_factory.nested_progress_bar()
2433
2431
    pp = ProgressPhase("Build phase", 2, top_pb)
2434
2432
    if tree.inventory.root is not None:
2435
2433
        # This is kind of a hack: we should be altering the root
2448
2446
        pp.next_phase()
2449
2447
        file_trans_id[wt.get_root_id()] = \
2450
2448
            tt.trans_id_tree_file_id(wt.get_root_id())
2451
 
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2449
        pb = ui.ui_factory.nested_progress_bar()
2452
2450
        try:
2453
2451
            deferred_contents = []
2454
2452
            num = 0
2778
2776
def _prepare_revert_transform(working_tree, target_tree, tt, filenames,
2779
2777
                              backups, pp, basis_tree=None,
2780
2778
                              merge_modified=None):
2781
 
    child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2779
    child_pb = ui.ui_factory.nested_progress_bar()
2782
2780
    try:
2783
2781
        if merge_modified is None:
2784
2782
            merge_modified = working_tree.merge_modified()
2787
2785
                                      merge_modified, basis_tree)
2788
2786
    finally:
2789
2787
        child_pb.finished()
2790
 
    child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2788
    child_pb = ui.ui_factory.nested_progress_bar()
2791
2789
    try:
2792
2790
        raw_conflicts = resolve_conflicts(tt, child_pb,
2793
2791
            lambda t, c: conflict_pass(t, c, target_tree))