~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-11 19:06:16 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050711190616-e4745a2b6e10f68a
Some more work, including ScratchBranch changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
 
179
179
 
180
180
    def __str__(self):
181
 
        return '%s(%r)' % (self.__class__.__name__, self.base)
 
181
        return '%s(%r)' % (self.__class__.__name__, self._transport.base)
182
182
 
183
183
 
184
184
    __repr__ = __str__
239
239
 
240
240
    def abspath(self, name):
241
241
        """Return absolute filename for something in the branch"""
242
 
        return os.path.join(self.base, name)
 
242
        return self._transport.abspath(name)
243
243
 
244
244
 
245
245
    def relpath(self, path):
246
246
        """Return path relative to this branch of something inside it.
247
247
 
248
248
        Raises an error if path is not in this branch."""
249
 
        return _relpath(self.base, path)
 
249
        return _relpath(self._transport.base, path)
250
250
 
251
251
 
252
252
    def _rel_controlfilename(self, file_or_path):
307
307
                  'branch-lock',
308
308
                  'pending-merges'):
309
309
            self.transport.put(self._rel_controlfilename(f), '')
310
 
        mutter('created control directory in ' + self.base)
 
310
        mutter('created control directory in ' + self._transport.base)
311
311
 
312
312
        # TODO: Try and do this with self.transport.put() instead
313
313
        pack_xml(Inventory(), self.controlfile('inventory','w'))
1023
1023
    def working_tree(self):
1024
1024
        """Return a `Tree` for the working copy."""
1025
1025
        from workingtree import WorkingTree
1026
 
        return WorkingTree(self.base, self.read_working_inventory())
 
1026
        # TODO: In the future, WorkingTree should utilize Transport
 
1027
        return WorkingTree(self._transport.base, self.read_working_inventory())
1027
1028
 
1028
1029
 
1029
1030
    def basis_tree(self):
1264
1265
            base = mkdtemp()
1265
1266
            init = True
1266
1267
        Branch.__init__(self, base, init=init)
 
1268
        # I'm giving ScratchBranch a base object, since most of the
 
1269
        # tests use it. Perhaps in the future the test functions
 
1270
        # should be updated to be aware of _transport
 
1271
        # Especially since it would be nice to use the same tests
 
1272
        # to test remote branches.
 
1273
        self.base = base
1267
1274
        for d in dirs:
1268
 
            os.mkdir(self.abspath(d))
 
1275
            self.transport.mkdir(d)
1269
1276
            
1270
1277
        for f in files:
1271
 
            file(os.path.join(self.base, f), 'w').write('content of %s' % f)
 
1278
            self.transport.put(f, 'content of %s' % f)
1272
1279
 
1273
1280
 
1274
1281
    def clone(self):