~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""RevisionTree - a Tree implementation backed by repository data for a revision."""
18
18
 
34
34
    """
35
35
 
36
36
    def __init__(self, branch, inv, revision_id):
37
 
        # for compatability the 'branch' parameter has not been renamed to 
 
37
        # for compatability the 'branch' parameter has not been renamed to
38
38
        # repository at this point. However, we should change RevisionTree's
39
 
        # construction to always be via Repository and not via direct 
 
39
        # construction to always be via Repository and not via direct
40
40
        # construction - this will mean that we can change the constructor
41
41
        # with much less chance of breaking client code.
42
42
        self._repository = branch
58
58
            parent_ids = self._repository.get_revision(
59
59
                self._revision_id).parent_ids
60
60
        return parent_ids
61
 
        
 
61
 
62
62
    def get_revision_id(self):
63
63
        """Return the revision id associated with this tree."""
64
64
        return self._revision_id
65
65
 
66
66
    def get_file_text(self, file_id, path=None):
67
 
        return list(self.iter_files_bytes([(file_id, None)]))[0][1]
 
67
        _, content = list(self.iter_files_bytes([(file_id, None)]))[0]
 
68
        return ''.join(content)
68
69
 
69
70
    def get_file(self, file_id, path=None):
70
71
        return StringIO(self.get_file_text(file_id))