~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-12 05:21:02 UTC
  • mfrom: (4108.1.3 jamesw-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090312052102-ksjfiyd5ctzibuo1
Merge 1.13 back to trunk,
        and move new things in bzr.dev to top of NEWS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1588
1588
        #       already in memory. However, this really needs to be done at a
1589
1589
        #       higher level, because there either won't be anything on disk,
1590
1590
        #       or the thing on disk will be a file.
1591
 
        return os.readlink(abspath.encode(osutils._fs_enc))
 
1591
        fs_encoding = osutils._fs_enc
 
1592
        if isinstance(abspath, unicode):
 
1593
            # abspath is defined as the path to pass to lstat. readlink is
 
1594
            # buggy in python < 2.6 (it doesn't encode unicode path into FS
 
1595
            # encoding), so we need to encode ourselves knowing that unicode
 
1596
            # paths are produced by UnicodeDirReader on purpose.
 
1597
            abspath = abspath.encode(fs_encoding)
 
1598
        target = os.readlink(abspath)
 
1599
        if fs_encoding not in ('UTF-8', 'US-ASCII', 'ANSI_X3.4-1968'):
 
1600
            # Change encoding if needed
 
1601
            target = target.decode(fs_encoding).encode('UTF-8')
 
1602
        return target
1592
1603
 
1593
1604
    def get_ghosts(self):
1594
1605
        """Return a list of the parent tree revision ids that are ghosts."""
1866
1877
            size = 0
1867
1878
            executable = False
1868
1879
        elif kind == 'symlink':
1869
 
            # We don't support non-ascii targets for symlinks yet.
1870
 
            fingerprint = str(inv_entry.symlink_target or '')
 
1880
            if inv_entry.symlink_target is None:
 
1881
                fingerprint = ''
 
1882
            else:
 
1883
                fingerprint = inv_entry.symlink_target.encode('utf8')
1871
1884
            size = 0
1872
1885
            executable = False
1873
1886
        elif kind == 'file':
3407
3420
                while (current_entry is not None or
3408
3421
                    current_path_info is not None):
3409
3422
                    if current_entry is None:
3410
 
                        # the check for path_handled when the path is adnvaced
 
3423
                        # the check for path_handled when the path is advanced
3411
3424
                        # will yield this path if needed.
3412
3425
                        pass
3413
3426
                    elif current_path_info is None: