~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-25 23:12:24 UTC
  • mfrom: (4048.1.2 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090225231224-r2fv2iqcgezje0zt
Make ls aware of views (Eduardo O. Padoan)

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
        bzrdir.BzrDir.open_containing_tree_or_branch(old_url)
335
335
    if consider_relpath and relpath != '':
336
336
        if working_tree is not None and apply_view:
337
 
            _check_path_in_view(working_tree, relpath)
 
337
            views.check_path_in_view(working_tree, relpath)
338
338
        specific_files.append(relpath)
339
339
    old_tree = _get_tree_to_diff(old_revision_spec, working_tree, branch)
340
340
 
346
346
            bzrdir.BzrDir.open_containing_tree_or_branch(new_url)
347
347
        if consider_relpath and relpath != '':
348
348
            if working_tree is not None and apply_view:
349
 
                _check_path_in_view(working_tree, relpath)
 
349
                views.check_path_in_view(working_tree, relpath)
350
350
            specific_files.append(relpath)
351
351
    new_tree = _get_tree_to_diff(new_revision_spec, working_tree, branch,
352
352
        basis_is_default=working_tree is None)
376
376
        extra_trees = (working_tree,)
377
377
    return old_tree, new_tree, specific_files, extra_trees
378
378
 
379
 
 
380
 
def _check_path_in_view(tree, relpath):
381
 
    """If a working tree has a view enabled, check the path is within it."""
382
 
    if tree.supports_views():
383
 
        view_files = tree.views.lookup_view()
384
 
        if  view_files and not osutils.is_inside_any(view_files, relpath):
385
 
            raise errors.FileOutsideView(relpath, view_files)
386
 
 
387
 
 
388
379
def _get_tree_to_diff(spec, tree=None, branch=None, basis_is_default=True):
389
380
    if branch is None and tree is not None:
390
381
        branch = tree.branch