~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

(jr) Add gettext() to progress bar text
 (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    ui,
43
43
    urlutils,
44
44
    )
 
45
from bzrlib.i18n import gettext
45
46
""")
46
47
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
47
48
                           ReusingTransform, CantMoveRoot,
1726
1727
        child_pb = ui.ui_factory.nested_progress_bar()
1727
1728
        try:
1728
1729
            if precomputed_delta is None:
1729
 
                child_pb.update('Apply phase', 0, 2)
 
1730
                child_pb.update(gettext('Apply phase'), 0, 2)
1730
1731
                inventory_delta = self._generate_inventory_delta()
1731
1732
                offset = 1
1732
1733
            else:
1737
1738
            else:
1738
1739
                mover = _mover
1739
1740
            try:
1740
 
                child_pb.update('Apply phase', 0 + offset, 2 + offset)
 
1741
                child_pb.update(gettext('Apply phase'), 0 + offset, 2 + offset)
1741
1742
                self._apply_removals(mover)
1742
 
                child_pb.update('Apply phase', 1 + offset, 2 + offset)
 
1743
                child_pb.update(gettext('Apply phase'), 1 + offset, 2 + offset)
1743
1744
                modified_paths = self._apply_insertions(mover)
1744
1745
            except:
1745
1746
                mover.rollback()
1765
1766
        try:
1766
1767
            for num, trans_id in enumerate(self._removed_id):
1767
1768
                if (num % 10) == 0:
1768
 
                    child_pb.update('removing file', num, total_entries)
 
1769
                    child_pb.update(gettext('removing file'), num, total_entries)
1769
1770
                if trans_id == self._new_root:
1770
1771
                    file_id = self._tree.get_root_id()
1771
1772
                else:
1783
1784
            final_kinds = {}
1784
1785
            for num, (path, trans_id) in enumerate(new_paths):
1785
1786
                if (num % 10) == 0:
1786
 
                    child_pb.update('adding file',
 
1787
                    child_pb.update(gettext('adding file'),
1787
1788
                                    num + len(self._removed_id), total_entries)
1788
1789
                file_id = new_path_file_ids[trans_id]
1789
1790
                if file_id is None:
1833
1834
                # do not attempt to move root into a subdirectory of itself.
1834
1835
                if path == '':
1835
1836
                    continue
1836
 
                child_pb.update('removing file', num, len(tree_paths))
 
1837
                child_pb.update(gettext('removing file'), num, len(tree_paths))
1837
1838
                full_path = self._tree.abspath(path)
1838
1839
                if trans_id in self._removed_contents:
1839
1840
                    delete_path = os.path.join(self._deletiondir, trans_id)
1868
1869
        try:
1869
1870
            for num, (path, trans_id) in enumerate(new_paths):
1870
1871
                if (num % 10) == 0:
1871
 
                    child_pb.update('adding file', num, len(new_paths))
 
1872
                    child_pb.update(gettext('adding file'), num, len(new_paths))
1872
1873
                full_path = self._tree.abspath(path)
1873
1874
                if trans_id in self._needs_rename:
1874
1875
                    try:
2583
2584
                    existing_files.update(f[0] for f in files)
2584
2585
            for num, (tree_path, entry) in \
2585
2586
                enumerate(tree.inventory.iter_entries_by_dir()):
2586
 
                pb.update("Building tree", num - len(deferred_contents), total)
 
2587
                pb.update(gettext("Building tree"), num - len(deferred_contents), total)
2587
2588
                if entry.parent_id is None:
2588
2589
                    continue
2589
2590
                reparent = False
2673
2674
                new_desired_files.append((file_id,
2674
2675
                    (trans_id, tree_path, text_sha1)))
2675
2676
                continue
2676
 
            pb.update('Adding file contents', count + offset, total)
 
2677
            pb.update(gettext('Adding file contents'), count + offset, total)
2677
2678
            if hardlink:
2678
2679
                tt.create_hardlink(accelerator_tree.abspath(accelerator_path),
2679
2680
                                   trans_id)
2700
2701
            contents = filtered_output_bytes(contents, filters,
2701
2702
                ContentFilterContext(tree_path, tree))
2702
2703
        tt.create_file(contents, trans_id, sha1=text_sha1)
2703
 
        pb.update('Adding file contents', count + offset, total)
 
2704
        pb.update(gettext('Adding file contents'), count + offset, total)
2704
2705
 
2705
2706
 
2706
2707
def _reparent_children(tt, old_parent, new_parent):
3047
3048
    pb = ui.ui_factory.nested_progress_bar()
3048
3049
    try:
3049
3050
        for n in range(10):
3050
 
            pb.update('Resolution pass', n+1, 10)
 
3051
            pb.update(gettext('Resolution pass'), n+1, 10)
3051
3052
            conflicts = tt.find_conflicts()
3052
3053
            if len(conflicts) == 0:
3053
3054
                return new_conflicts