~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-08-25 01:13:32 UTC
  • mto: (974.1.50) (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: robertc@robertcollins.net-20050825011331-6d549d5de7edcec1
two bugfixes to smart_add - do not add paths from nested trees to the parent tree, and do not mutate the user supplied file list

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
            self._lock.unlock()
219
219
 
220
220
 
221
 
 
222
221
    def lock_write(self):
223
222
        if self._lock_mode:
224
223
            if self._lock_mode != 'w':
234
233
            self._lock_count = 1
235
234
 
236
235
 
237
 
 
238
236
    def lock_read(self):
239
237
        if self._lock_mode:
240
238
            assert self._lock_mode in ('r', 'w'), \
247
245
            self._lock_mode = 'r'
248
246
            self._lock_count = 1
249
247
                        
250
 
 
251
 
            
252
248
    def unlock(self):
253
249
        if not self._lock_mode:
254
250
            from errors import LockError
261
257
            self._lock = None
262
258
            self._lock_mode = self._lock_count = None
263
259
 
264
 
 
265
260
    def abspath(self, name):
266
261
        """Return absolute filename for something in the branch"""
267
262
        return os.path.join(self.base, name)
268
263
 
269
 
 
270
264
    def relpath(self, path):
271
265
        """Return path relative to this branch of something inside it.
272
266
 
273
267
        Raises an error if path is not in this branch."""
274
268
        return _relpath(self.base, path)
275
269
 
276
 
 
277
270
    def controlfilename(self, file_or_path):
278
271
        """Return location relative to branch."""
279
272
        if isinstance(file_or_path, basestring):
306
299
        else:
307
300
            raise BzrError("invalid controlfile mode %r" % mode)
308
301
 
309
 
 
310
 
 
311
302
    def _make_control(self):
312
303
        from bzrlib.inventory import Inventory
313
304
        from bzrlib.xml import pack_xml
331
322
        # simplicity.
332
323
        pack_xml(Inventory(), self.controlfile('inventory','w'))
333
324
 
334
 
 
335
325
    def _check_format(self):
336
326
        """Check this branch format is supported.
337
327