~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2005-10-30 17:20:31 UTC
  • mto: (1185.33.1)
  • mto: This revision was merged to the branch mainline in revision 1509.
  • Revision ID: jelmer@samba.org-20051030172031-22843b518b4eae57
Rename _Branch to NativeBranch to better indicate the difference with
foreign branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
        """Open a branch which may be of an old format.
110
110
        
111
111
        Only local branches are supported."""
112
 
        return _Branch(get_transport(base), relax_version_check=True)
 
112
        return NativeBranch(get_transport(base), relax_version_check=True)
113
113
        
114
114
    @staticmethod
115
115
    def open(base):
116
116
        """Open an existing branch, rooted at 'base' (url)"""
117
117
        t = get_transport(base)
118
118
        mutter("trying to open %r with transport %r", base, t)
119
 
        return _Branch(t)
 
119
        return NativeBranch(t)
120
120
 
121
121
    @staticmethod
122
122
    def open_containing(url):
131
131
        t = get_transport(url)
132
132
        while True:
133
133
            try:
134
 
                return _Branch(t), t.relpath(url)
 
134
                return NativeBranch(t), t.relpath(url)
135
135
            except NotBranchError:
136
136
                pass
137
137
            new_t = t.clone('..')
144
144
    def initialize(base):
145
145
        """Create a new branch, rooted at 'base' (url)"""
146
146
        t = get_transport(base)
147
 
        return _Branch(t, init=True)
 
147
        return NativeBranch(t, init=True)
148
148
 
149
149
    def setup_caching(self, cache_root):
150
150
        """Subclasses that care about caching should override this, and set
153
153
        self.cache_root = cache_root
154
154
 
155
155
 
156
 
class _Branch(Branch):
 
156
class NativeBranch(Branch):
157
157
    """A branch stored in the actual filesystem.
158
158
 
159
159
    Note that it's "local" in the context of the filesystem; it doesn't
1225
1225
                                revision_id, "sig")
1226
1226
 
1227
1227
 
1228
 
class ScratchBranch(_Branch):
 
1228
class ScratchBranch(NativeBranch):
1229
1229
    """Special test class: a branch that cleans up after itself.
1230
1230
 
1231
1231
    >>> b = ScratchBranch()