~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/rename_map.py

(jelmer) Fix bug #1010339,
 use encoding_type='exact' for bzr testament (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
17
 
19
18
from cStringIO import StringIO
20
19
 
24
23
    trace,
25
24
)
26
25
from bzrlib.ui import ui_factory
27
 
from bzrlib.i18n import gettext
 
26
 
28
27
 
29
28
class RenameMap(object):
30
29
    """Determine a mapping of renames."""
66
65
        try:
67
66
            for num, (file_id, contents) in enumerate(
68
67
                tree.iter_files_bytes(desired_files)):
69
 
                task.update(gettext('Calculating hashes'), num, len(file_ids))
 
68
                task.update('Calculating hashes', num, len(file_ids))
70
69
                s = StringIO()
71
70
                s.writelines(contents)
72
71
                s.seek(0)
104
103
        task = ui_factory.nested_progress_bar()
105
104
        try:
106
105
            for num, path in enumerate(paths):
107
 
                task.update(gettext('Determining hash hits'), num, len(paths))
 
106
                task.update('Determining hash hits', num, len(paths))
108
107
                hits = self.hitcounts(self.tree.get_file_lines(None,
109
108
                                                               path=path))
110
109
                all_hits.extend((v, path, k) for k, v in hits.items())
239
238
            pp.next_phase()
240
239
            delta = rn._make_inventory_delta(matches)
241
240
            for old, new, file_id, entry in delta:
242
 
                trace.note( gettext("{0} => {1}").format(old, new) )
 
241
                trace.note("%s => %s", old, new)
243
242
            if not dry_run:
244
243
                tree.add(required_parents)
245
244
                tree.apply_inventory_delta(delta)