/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-02 17:50:30 UTC
  • mto: This revision was merged to the branch mainline in revision 4854.
  • Revision ID: john@arbash-meinel.com-20091202175030-3rwmzdhf9xeoasjb
Change some Branch operations from using .get().read() to .get_bytes()

There is no reason to use the former, and it means we leave file-handles around
waiting for the garbage collector (or an sftp handle, etc.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1440
1440
        """Return the format for the branch object in a_bzrdir."""
1441
1441
        try:
1442
1442
            transport = a_bzrdir.get_branch_transport(None)
1443
 
            format_string = transport.get("format").read()
 
1443
            format_string = transport.get_bytes("format")
1444
1444
            return klass._formats[format_string]
1445
1445
        except errors.NoSuchFile:
1446
1446
            raise errors.NotBranchError(path=transport.base)
1979
1979
    def get_reference(self, a_bzrdir):
1980
1980
        """See BranchFormat.get_reference()."""
1981
1981
        transport = a_bzrdir.get_branch_transport(None)
1982
 
        return transport.get('location').read()
 
1982
        return transport.get_bytes('location')
1983
1983
 
1984
1984
    def set_reference(self, a_bzrdir, to_branch):
1985
1985
        """See BranchFormat.set_reference()."""