~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-06 22:44:57 UTC
  • mfrom: (6436 +trunk)
  • mto: (6437.3.11 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: jelmer@samba.org-20120106224457-re0pcy0fz31xob77
Merge bzr.dev.

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
 
221
223
import bisect
222
224
import errno
223
225
import operator
1559
1561
                    else:
1560
1562
                        source_path = child_basename
1561
1563
                    if new_path_utf8:
1562
 
                        target_path = new_path_utf8 + source_path[len(old_path):]
 
1564
                        target_path = \
 
1565
                            new_path_utf8 + source_path[len(old_path_utf8):]
1563
1566
                    else:
1564
 
                        if old_path == '':
 
1567
                        if old_path_utf8 == '':
1565
1568
                            raise AssertionError("cannot rename directory to"
1566
1569
                                                 " itself")
1567
 
                        target_path = source_path[len(old_path) + 1:]
 
1570
                        target_path = source_path[len(old_path_utf8) + 1:]
1568
1571
                    adds.append((None, target_path, entry[0][2], entry[1][1], False))
1569
1572
                    deletes.append(
1570
1573
                        (source_path, target_path, entry[0][2], None, False))
1571
 
                deletes.append((old_path_utf8, new_path, file_id, None, False))
 
1574
                deletes.append(
 
1575
                    (old_path_utf8, new_path_utf8, file_id, None, False))
 
1576
 
1572
1577
        self._check_delta_ids_absent(new_ids, delta, 1)
1573
1578
        try:
1574
1579
            # Finish expunging deletes/first half of renames.
1919
1924
            # paths are produced by UnicodeDirReader on purpose.
1920
1925
            abspath = abspath.encode(fs_encoding)
1921
1926
        target = os.readlink(abspath)
1922
 
        if fs_encoding not in ('UTF-8', 'US-ASCII', 'ANSI_X3.4-1968'):
 
1927
        if fs_encoding not in ('utf-8', 'ascii'):
1923
1928
            # Change encoding if needed
1924
1929
            target = target.decode(fs_encoding).encode('UTF-8')
1925
1930
        return target