~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remotebranch.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-09-05 07:10:59 UTC
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050905071059-63693b49338a914c
Added merge test

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from cStringIO import StringIO
29
29
import urllib2
30
30
 
31
 
from bzrlib.errors import BzrError, BzrCheckError
32
 
from bzrlib.branch import Branch, BZR_BRANCH_FORMAT_5
33
 
from bzrlib.trace import mutter
34
 
from bzrlib.xml5 import serializer_v5
 
31
from errors import BzrError, BzrCheckError
 
32
from branch import Branch, BZR_BRANCH_FORMAT
 
33
from trace import mutter
35
34
 
36
35
# velocitynet.com.au transparently proxies connections and thereby
37
36
# breaks keep-alive -- sucks!
90
89
            fmt = ff.read()
91
90
            ff.close()
92
91
 
93
 
            if fmt != BZR_BRANCH_FORMAT_5:
 
92
            fmt = fmt.rstrip('\r\n')
 
93
            if fmt != BZR_BRANCH_FORMAT.rstrip('\r\n'):
94
94
                raise BzrError("sorry, branch format %r not supported at url %s"
95
95
                               % (fmt, url))
96
96
            
155
155
 
156
156
    def get_revision(self, revision_id):
157
157
        from bzrlib.revision import Revision
 
158
        from bzrlib.xml import unpack_xml
158
159
        try:
159
160
            revf = self.revision_store[revision_id]
160
161
        except KeyError:
161
162
            raise NoSuchRevision(self, revision_id)
162
 
        r = serializer_v5.read_revision(revf)
 
163
        r = unpack_xml(Revision, revf)
163
164
        if r.revision_id != revision_id:
164
165
            raise BzrCheckError('revision stored as {%s} actually contains {%s}'
165
166
                                % (revision_id, r.revision_id))