~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/views.py

  • Committer: Eduardo Padoan
  • Date: 2009-02-23 05:57:15 UTC
  • mto: (4048.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4052.
  • Revision ID: eduardo.padoan@gmail.com-20090223055715-6cqqzjt7bo00v0zf
Moved diff._check_path_in_view() to views.check_path_in_view()

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from bzrlib import (
29
29
    errors,
 
30
    osutils,
30
31
    )
31
32
 
32
33
 
273
274
        return ", ".join(view_files)
274
275
    else:
275
276
        return ", ".join([v.encode(encoding, 'replace') for v in view_files])
 
277
 
 
278
 
 
279
def check_path_in_view(tree, relpath):
 
280
    """If a working tree has a view enabled, check the path is within it."""
 
281
    if tree.supports_views():
 
282
        view_files = tree.views.lookup_view()
 
283
        if  view_files and not osutils.is_inside_any(view_files, relpath):
 
284
            raise errors.FileOutsideView(relpath, view_files)