~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Vincent Ladeuil
  • Date: 2011-09-29 15:50:58 UTC
  • mfrom: (6177 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6178.
  • Revision ID: v.ladeuil+lp@free.fr-20110929155058-zgbecmx1huzktegm
Merge trunk and resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
 
219
219
"""
220
220
 
221
 
from __future__ import absolute_import
222
 
 
223
221
import bisect
224
222
import errno
225
223
import operator
1292
1290
                    parent_trees.append((parent_id, parent_tree))
1293
1291
                    parent_tree.lock_read()
1294
1292
                result.set_parent_trees(parent_trees, [])
1295
 
                result.set_state_from_inventory(tree.root_inventory)
 
1293
                result.set_state_from_inventory(tree.inventory)
1296
1294
            finally:
1297
1295
                for revid, parent_tree in parent_trees:
1298
1296
                    parent_tree.unlock()
1561
1559
                    else:
1562
1560
                        source_path = child_basename
1563
1561
                    if new_path_utf8:
1564
 
                        target_path = \
1565
 
                            new_path_utf8 + source_path[len(old_path_utf8):]
 
1562
                        target_path = new_path_utf8 + source_path[len(old_path):]
1566
1563
                    else:
1567
 
                        if old_path_utf8 == '':
 
1564
                        if old_path == '':
1568
1565
                            raise AssertionError("cannot rename directory to"
1569
1566
                                                 " itself")
1570
 
                        target_path = source_path[len(old_path_utf8) + 1:]
 
1567
                        target_path = source_path[len(old_path) + 1:]
1571
1568
                    adds.append((None, target_path, entry[0][2], entry[1][1], False))
1572
1569
                    deletes.append(
1573
1570
                        (source_path, target_path, entry[0][2], None, False))
1574
 
                deletes.append(
1575
 
                    (old_path_utf8, new_path_utf8, file_id, None, False))
1576
 
 
 
1571
                deletes.append((old_path_utf8, new_path, file_id, None, False))
1577
1572
        self._check_delta_ids_absent(new_ids, delta, 1)
1578
1573
        try:
1579
1574
            # Finish expunging deletes/first half of renames.
1924
1919
            # paths are produced by UnicodeDirReader on purpose.
1925
1920
            abspath = abspath.encode(fs_encoding)
1926
1921
        target = os.readlink(abspath)
1927
 
        if fs_encoding not in ('utf-8', 'ascii'):
 
1922
        if fs_encoding not in ('UTF-8', 'US-ASCII', 'ANSI_X3.4-1968'):
1928
1923
            # Change encoding if needed
1929
1924
            target = target.decode(fs_encoding).encode('UTF-8')
1930
1925
        return target