~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-02 15:47:40 UTC
  • mfrom: (4237.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20090402154740-0h1xz7luyp8mb2lz
(vila) Stop-gap fix for Repository.get_revision_xml

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from bzrlib.lazy_import import lazy_import
18
18
lazy_import(globals(), """
 
19
import cStringIO
19
20
import re
20
21
import time
21
22
 
1635
1636
 
1636
1637
    @needs_read_lock
1637
1638
    def get_revision_xml(self, revision_id):
1638
 
        """Return the XML representation of a revision.
1639
 
 
1640
 
        :param revision_id: Revision for which to return the XML.
1641
 
        :return: XML string
1642
 
        """
1643
 
        return self._serializer.write_revision_to_string(
1644
 
            self.get_revision(revision_id))
 
1639
        # TODO: jam 20070210 This shouldn't be necessary since get_revision
 
1640
        #       would have already do it.
 
1641
        # TODO: jam 20070210 Just use _serializer.write_revision_to_string()
 
1642
        # TODO: this can't just be replaced by:
 
1643
        # return self._serializer.write_revision_to_string(
 
1644
        #     self.get_revision(revision_id))
 
1645
        # as cStringIO preservers the encoding unlike write_revision_to_string
 
1646
        # or some other call down the path.
 
1647
        rev = self.get_revision(revision_id)
 
1648
        rev_tmp = cStringIO.StringIO()
 
1649
        # the current serializer..
 
1650
        self._serializer.write_revision(rev, rev_tmp)
 
1651
        rev_tmp.seek(0)
 
1652
        return rev_tmp.getvalue()
1645
1653
 
1646
1654
    def get_deltas_for_revisions(self, revisions, specific_fileids=None):
1647
1655
        """Produce a generator of revision deltas.