~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Andrew Bennetts
  • Date: 2009-12-03 05:57:41 UTC
  • mfrom: (4857 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4869.
  • Revision ID: andrew.bennetts@canonical.com-20091203055741-vmmg0fmjgjw2pwvu
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1285
1285
        # clone call. Or something. 20090224 RBC/spiv.
1286
1286
        if revision_id is None:
1287
1287
            revision_id = self.last_revision()
1288
 
        try:
1289
 
            dir_to = self.bzrdir.clone_on_transport(to_transport,
1290
 
                revision_id=revision_id, stacked_on=stacked_on,
1291
 
                create_prefix=create_prefix, use_existing_dir=use_existing_dir)
1292
 
        except errors.FileExists:
1293
 
            if not use_existing_dir:
1294
 
                raise
1295
 
        except errors.NoSuchFile:
1296
 
            if not create_prefix:
1297
 
                raise
 
1288
        dir_to = self.bzrdir.clone_on_transport(to_transport,
 
1289
            revision_id=revision_id, stacked_on=stacked_on,
 
1290
            create_prefix=create_prefix, use_existing_dir=use_existing_dir)
1298
1291
        return dir_to.open_branch()
1299
1292
 
1300
1293
    def create_checkout(self, to_location, revision_id=None,
1440
1433
        """Return the format for the branch object in a_bzrdir."""
1441
1434
        try:
1442
1435
            transport = a_bzrdir.get_branch_transport(None)
1443
 
            format_string = transport.get("format").read()
 
1436
            format_string = transport.get_bytes("format")
1444
1437
            return klass._formats[format_string]
1445
1438
        except errors.NoSuchFile:
1446
1439
            raise errors.NotBranchError(path=transport.base)
1979
1972
    def get_reference(self, a_bzrdir):
1980
1973
        """See BranchFormat.get_reference()."""
1981
1974
        transport = a_bzrdir.get_branch_transport(None)
1982
 
        return transport.get('location').read()
 
1975
        return transport.get_bytes('location')
1983
1976
 
1984
1977
    def set_reference(self, a_bzrdir, to_branch):
1985
1978
        """See BranchFormat.set_reference()."""