~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: v.ladeuil+lp at free
  • Date: 2006-11-08 07:44:30 UTC
  • mfrom: (2123 +trunk)
  • mto: (2145.1.1 keepalive)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: v.ladeuil+lp@free.fr-20061108074430-a9c08d4a475bd97f
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Bazaar -- distributed version control
2
 
#
3
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
4
2
#
5
3
# This program is free software; you can redistribute it and/or modify
6
4
# it under the terms of the GNU General Public License as published by
1110
1108
        b += new
1111
1109
    return b
1112
1110
 
 
1111
def dereference_path(path):
 
1112
    """Determine the real path to a file.
 
1113
 
 
1114
    All parent elements are dereferenced.  But the file itself is not
 
1115
    dereferenced.
 
1116
    :param path: The original path.  May be absolute or relative.
 
1117
    :return: the real path *to* the file
 
1118
    """
 
1119
    parent, base = os.path.split(path)
 
1120
    # The pathjoin for '.' is a workaround for Python bug #1213894.
 
1121
    # (initial path components aren't dereferenced)
 
1122
    return pathjoin(realpath(pathjoin('.', parent)), base)