~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2010-07-16 13:53:26 UTC
  • mto: (5346.4.3 cleanup)
  • mto: This revision was merged to the branch mainline in revision 5350.
  • Revision ID: mbp@canonical.com-20100716135326-a3d5bh29w64ylh5p
* `PathNotChild` should not give a traceback.
  (Martin Pool, bug 98735)

* `FileInWrongBranch` is deprecated in favour of `PathNotChild` and no
  longer raised.
  (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
def tree_files(file_list, default_branch=u'.', canonicalize=True,
79
79
    apply_view=True):
80
 
    try:
81
 
        return internal_tree_files(file_list, default_branch, canonicalize,
82
 
            apply_view)
83
 
    except errors.FileInWrongBranch, e:
84
 
        raise errors.BzrCommandError("%s is not in the same branch as %s" %
85
 
                                     (e.path, file_list[0]))
 
80
    return internal_tree_files(file_list, default_branch, canonicalize,
 
81
        apply_view)
86
82
 
87
83
 
88
84
def tree_files_for_add(file_list):
210
206
    else:
211
207
        fixer = tree.relpath
212
208
    for filename in file_list:
213
 
        try:
214
 
            relpath = fixer(osutils.dereference_path(filename))
215
 
            if  view_files and not osutils.is_inside_any(view_files, relpath):
216
 
                raise errors.FileOutsideView(filename, view_files)
217
 
            new_list.append(relpath)
218
 
        except errors.PathNotChild:
219
 
            raise errors.FileInWrongBranch(tree.branch, filename)
 
209
        relpath = fixer(osutils.dereference_path(filename))
 
210
        if  view_files and not osutils.is_inside_any(view_files, relpath):
 
211
            raise errors.FileOutsideView(filename, view_files)
 
212
        new_list.append(relpath)
220
213
    return new_list
221
214
 
222
215