~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Andrew Bennetts
  • Date: 2007-04-13 07:18:57 UTC
  • mto: (2018.17.1 hpss)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20070413071857-s1rpgdaqrrlvcdsw
Some miscellaneous new APIs, tests and other changes from the hpss branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
813
813
        """Return the current default format."""
814
814
        return klass._default_format
815
815
 
 
816
    def get_reference(self, a_bzrdir):
 
817
        """Get the target reference of the branch in a_bzrdir.
 
818
 
 
819
        format probing must have been completed before calling
 
820
        this method - it is assumed that the format of the branch
 
821
        in a_bzrdir is correct.
 
822
 
 
823
        :param a_bzrdir: The bzrdir to get the branch data from.
 
824
        :return: None if the branch is not a reference branch.
 
825
        """
 
826
        return None
 
827
 
816
828
    def get_format_string(self):
817
829
        """Return the ASCII format string that identifies this format."""
818
830
        raise NotImplementedError(self.get_format_string)
1125
1137
        """See BranchFormat.get_format_description()."""
1126
1138
        return "Checkout reference format 1"
1127
1139
        
 
1140
    def get_reference(self, a_bzrdir):
 
1141
        """See BranchFormat.get_reference()."""
 
1142
        transport = a_bzrdir.get_branch_transport(None)
 
1143
        return transport.get('location').read()
 
1144
 
1128
1145
    def initialize(self, a_bzrdir, target_branch=None):
1129
1146
        """Create a branch of this format in a_bzrdir."""
1130
1147
        if target_branch is None:
1745
1762
        return "Experimental branch format"
1746
1763
 
1747
1764
    @classmethod
 
1765
    def get_reference(cls, a_bzrdir):
 
1766
        """Get the target reference of the branch in a_bzrdir.
 
1767
 
 
1768
        format probing must have been completed before calling
 
1769
        this method - it is assumed that the format of the branch
 
1770
        in a_bzrdir is correct.
 
1771
 
 
1772
        :param a_bzrdir: The bzrdir to get the branch data from.
 
1773
        :return: None if the branch is not a reference branch.
 
1774
        """
 
1775
        return None
 
1776
 
 
1777
    @classmethod
1748
1778
    def _initialize_control_files(cls, a_bzrdir, utf8_files, lock_filename,
1749
1779
            lock_class):
1750
1780
        branch_transport = a_bzrdir.get_branch_transport(cls)