~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-16 10:08:09 UTC
  • mto: This revision was merged to the branch mainline in revision 6145.
  • Revision ID: jriddell@canonical.com-20110916100809-uii7a1h5tp8qguhy
add gettext to progress bar strings

Show diffs side-by-side

added added

removed removed

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