/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

  • Committer: Ian Clatworthy
  • Date: 2009-02-25 13:25:14 UTC
  • mfrom: (4032.4.6 lsview)
  • mto: This revision was merged to the branch mainline in revision 4052.
  • Revision ID: ian.clatworthy@canonical.com-20090225132514-ltdzwbeswxjixt84
Make ls aware of views (Eduardo O. Padoan)

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)