~lifeless/ubuntu/lucid/bzr/2.1.2-sru

« back to all changes in this revision

Viewing changes to bzrlib/dirstate.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-03-19 18:16:35 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090319181635-omac7l5epn7x755c
* New upstream release.
* Move to section vcs.
* Bump standards version to 3.8.1.

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':
3405
3418
                while (current_entry is not None or
3406
3419
                    current_path_info is not None):
3407
3420
                    if current_entry is None:
3408
 
                        # the check for path_handled when the path is adnvaced
 
3421
                        # the check for path_handled when the path is advanced
3409
3422
                        # will yield this path if needed.
3410
3423
                        pass
3411
3424
                    elif current_path_info is None: