~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-13 02:09:50 UTC
  • mfrom: (5582.4.5 lazy-ui.diff)
  • Revision ID: pqm@pqm.ubuntu.com-20110113020950-fj3kzj8wviwrkcrn
(jelmer) More lazy loading of bzrlib.ui and bzrlib.urlutils. (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from stat import S_ISREG, S_IEXEC
20
20
import time
21
21
 
22
 
import bzrlib
23
22
from bzrlib import (
24
23
    errors,
25
24
    lazy_import,
40
39
    revision as _mod_revision,
41
40
    trace,
42
41
    ui,
 
42
    urlutils,
43
43
    )
44
44
""")
45
45
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
64
64
    deprecated_method,
65
65
    )
66
66
from bzrlib.trace import warning
67
 
import bzrlib.ui
68
 
import bzrlib.urlutils as urlutils
69
67
 
70
68
 
71
69
ROOT_PARENT = "root-parent"
1677
1675
        """
1678
1676
        if not no_conflicts:
1679
1677
            self._check_malformed()
1680
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1678
        child_pb = ui.ui_factory.nested_progress_bar()
1681
1679
        try:
1682
1680
            if precomputed_delta is None:
1683
1681
                child_pb.update('Apply phase', 0, 2)
1710
1708
    def _generate_inventory_delta(self):
1711
1709
        """Generate an inventory delta for the current transform."""
1712
1710
        inventory_delta = []
1713
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1711
        child_pb = ui.ui_factory.nested_progress_bar()
1714
1712
        new_paths = self._inventory_altered()
1715
1713
        total_entries = len(new_paths) + len(self._removed_id)
1716
1714
        try:
1778
1776
        """
1779
1777
        tree_paths = list(self._tree_path_ids.iteritems())
1780
1778
        tree_paths.sort(reverse=True)
1781
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1779
        child_pb = ui.ui_factory.nested_progress_bar()
1782
1780
        try:
1783
1781
            for num, data in enumerate(tree_paths):
1784
1782
                path, trans_id = data
1813
1811
        modified_paths = []
1814
1812
        new_path_file_ids = dict((t, self.final_file_id(t)) for p, t in
1815
1813
                                 new_paths)
1816
 
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
1814
        child_pb = ui.ui_factory.nested_progress_bar()
1817
1815
        try:
1818
1816
            for num, (path, trans_id) in enumerate(new_paths):
1819
1817
                if (num % 10) == 0:
2431
2429
        if num > 0:  # more than just a root
2432
2430
            raise errors.WorkingTreeAlreadyPopulated(base=wt.basedir)
2433
2431
    file_trans_id = {}
2434
 
    top_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2432
    top_pb = ui.ui_factory.nested_progress_bar()
2435
2433
    pp = ProgressPhase("Build phase", 2, top_pb)
2436
2434
    if tree.inventory.root is not None:
2437
2435
        # This is kind of a hack: we should be altering the root
2450
2448
        pp.next_phase()
2451
2449
        file_trans_id[wt.get_root_id()] = \
2452
2450
            tt.trans_id_tree_file_id(wt.get_root_id())
2453
 
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2451
        pb = ui.ui_factory.nested_progress_bar()
2454
2452
        try:
2455
2453
            deferred_contents = []
2456
2454
            num = 0
2780
2778
def _prepare_revert_transform(working_tree, target_tree, tt, filenames,
2781
2779
                              backups, pp, basis_tree=None,
2782
2780
                              merge_modified=None):
2783
 
    child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2781
    child_pb = ui.ui_factory.nested_progress_bar()
2784
2782
    try:
2785
2783
        if merge_modified is None:
2786
2784
            merge_modified = working_tree.merge_modified()
2789
2787
                                      merge_modified, basis_tree)
2790
2788
    finally:
2791
2789
        child_pb.finished()
2792
 
    child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
2790
    child_pb = ui.ui_factory.nested_progress_bar()
2793
2791
    try:
2794
2792
        raw_conflicts = resolve_conflicts(tt, child_pb,
2795
2793
            lambda t, c: conflict_pass(t, c, target_tree))