~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Jelmer Vernooij
  • Date: 2012-08-02 10:38:21 UTC
  • mto: This revision was merged to the branch mainline in revision 6555.
  • Revision ID: jelmer@samba.org-20120802103821-pto2dgacjtmpzl1n
Move color feature into bzrlib.tests.features.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2012 Canonical Ltd
 
1
# Copyright (C) 2007-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1693
1693
    def supports_views(self):
1694
1694
        return True
1695
1695
 
1696
 
    def _get_matchingbzrdir(self):
1697
 
        """Overrideable method to get a bzrdir for testing."""
1698
 
        # We use 'development-subtree' instead of '2a', because we have a
1699
 
        # few tests that want to test tree references
1700
 
        return bzrdir.format_registry.make_bzrdir('development-subtree')
1701
 
 
1702
1696
 
1703
1697
class DirStateRevisionTree(InventoryTree):
1704
1698
    """A revision tree pulling the inventory from a dirstate.
1907
1901
        return inv[inv_file_id].text_size
1908
1902
 
1909
1903
    def get_file_text(self, file_id, path=None):
1910
 
        content = None
1911
 
        for _, content_iter in self.iter_files_bytes([(file_id, None)]):
1912
 
            if content is not None:
1913
 
                raise AssertionError('iter_files_bytes returned'
1914
 
                    ' too many entries')
1915
 
            # For each entry returned by iter_files_bytes, we must consume the
1916
 
            # content_iter before we step the files iterator.
1917
 
            content = ''.join(content_iter)
1918
 
        if content is None:
1919
 
            raise AssertionError('iter_files_bytes did not return'
1920
 
                ' the requested data')
1921
 
        return content
 
1904
        _, content = list(self.iter_files_bytes([(file_id, None)]))[0]
 
1905
        return ''.join(content)
1922
1906
 
1923
1907
    def get_reference_revision(self, file_id, path=None):
1924
1908
        inv, inv_file_id = self._unpack_file_id(file_id)