~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-27 16:14:18 UTC
  • mfrom: (2091.3.7 symlink-paths)
  • Revision ID: pqm@pqm.ubuntu.com-20061027161418-ed489293a9231843
Fix bzr mv across symlinks

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
    :param file_list: Filenames to convert.  
77
77
 
78
 
    :param default_branch: Fallback tree path to use if file_list is empty or None.
 
78
    :param default_branch: Fallback tree path to use if file_list is empty or
 
79
        None.
79
80
 
80
81
    :return: workingtree, [relative_paths]
81
82
    """
82
83
    if file_list is None or len(file_list) == 0:
83
84
        return WorkingTree.open_containing(default_branch)[0], file_list
84
 
    tree = WorkingTree.open_containing(file_list[0])[0]
 
85
    tree = WorkingTree.open_containing(osutils.realpath(file_list[0]))[0]
85
86
    new_list = []
86
87
    for filename in file_list:
87
88
        try:
88
 
            new_list.append(tree.relpath(filename))
 
89
            new_list.append(tree.relpath(osutils.dereference_path(filename)))
89
90
        except errors.PathNotChild:
90
91
            raise errors.FileInWrongBranch(tree.branch, filename)
91
92
    return tree, new_list