/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/rename_map.py

  • Committer: Jelmer Vernooij
  • Author(s): Richard Wilbur
  • Date: 2017-05-30 23:37:11 UTC
  • mto: This revision was merged to the branch mainline in revision 6645.
  • Revision ID: jelmer@jelmer.uk-20170530233711-r0m0qp8hpkqzpopw
Fix order in which files are processed.

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
 
 
18
 
from cStringIO import StringIO
19
 
 
20
 
from bzrlib import (
 
17
from __future__ import absolute_import
 
18
 
 
19
 
 
20
from . import (
21
21
    osutils,
22
22
    progress,
23
23
    trace,
24
 
)
25
 
from bzrlib.ui import ui_factory
26
 
 
 
24
    )
 
25
from .i18n import gettext
 
26
from .sixish import (
 
27
    BytesIO,
 
28
    )
 
29
from .ui import ui_factory
27
30
 
28
31
class RenameMap(object):
29
32
    """Determine a mapping of renames."""
65
68
        try:
66
69
            for num, (file_id, contents) in enumerate(
67
70
                tree.iter_files_bytes(desired_files)):
68
 
                task.update('Calculating hashes', num, len(file_ids))
69
 
                s = StringIO()
 
71
                task.update(gettext('Calculating hashes'), num, len(file_ids))
 
72
                s = BytesIO()
70
73
                s.writelines(contents)
71
74
                s.seek(0)
72
75
                self.add_edge_hashes(s.readlines(), file_id)
103
106
        task = ui_factory.nested_progress_bar()
104
107
        try:
105
108
            for num, path in enumerate(paths):
106
 
                task.update('Determining hash hits', num, len(paths))
 
109
                task.update(gettext('Determining hash hits'), num, len(paths))
107
110
                hits = self.hitcounts(self.tree.get_file_lines(None,
108
111
                                                               path=path))
109
112
                all_hits.extend((v, path, k) for k, v in hits.items())
238
241
            pp.next_phase()
239
242
            delta = rn._make_inventory_delta(matches)
240
243
            for old, new, file_id, entry in delta:
241
 
                trace.note("%s => %s", old, new)
 
244
                trace.note( gettext("{0} => {1}").format(old, new) )
242
245
            if not dry_run:
243
246
                tree.add(required_parents)
244
247
                tree.apply_inventory_delta(delta)