/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: Frank Aspell
  • Date: 2009-02-22 16:54:02 UTC
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: frankaspell@googlemail.com-20090222165402-2myrucnu7er5w4ha
Fixing various typos

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""View management.
18
18
 
27
27
 
28
28
from bzrlib import (
29
29
    errors,
30
 
    osutils,
31
30
    )
32
31
 
33
32
 
105
104
 
106
105
    def lookup_view(self, view_name=None):
107
106
        """Return the contents of a view.
108
 
 
 
107
 
109
108
        :param view_Name: name of the view or None to lookup the current view
110
109
        :return: the list of files/directories in the requested view
111
110
        """
122
121
 
123
122
    def set_view(self, view_name, view_files, make_current=True):
124
123
        """Add or update a view definition.
125
 
 
 
124
 
126
125
        :param view_name: the name of the view
127
126
        :param view_files: the list of files/directories in the view
128
127
        :param make_current: make this view the current one or not
274
273
        return ", ".join(view_files)
275
274
    else:
276
275
        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)