/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/views.py

merge bzr.dev rev 4098

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)