/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/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-01 06:48:38 UTC
  • mfrom: (2389.1.1 0.15-to-trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20070401064838-34903c7b0d0c8007
merge 0.15 back to dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
    def is_locked(self):
232
232
        return self.control_files.is_locked()
233
233
 
234
 
    def lock_write(self, token=None):
235
 
        """Lock this repository for writing.
236
 
        
237
 
        :param token: if this is already locked, then lock_write will fail
238
 
            unless the token matches the existing lock.
239
 
        :returns: a token if this instance supports tokens, otherwise None.
240
 
        :raises TokenLockingNotSupported: when a token is given but this
241
 
            instance doesn't support using token locks.
242
 
        :raises MismatchedToken: if the specified token doesn't match the token
243
 
            of the existing lock.
244
 
 
245
 
        A token should be passed in if you know that you have locked the object
246
 
        some other way, and need to synchronise this object's state with that
247
 
        fact.
248
 
 
249
 
        XXX: this docstring is duplicated in many places, e.g. lockable_files.py
250
 
        """
251
 
        return self.control_files.lock_write(token=token)
 
234
    def lock_write(self):
 
235
        self.control_files.lock_write()
252
236
 
253
237
    def lock_read(self):
254
238
        self.control_files.lock_read()
256
240
    def get_physical_lock_status(self):
257
241
        return self.control_files.get_physical_lock_status()
258
242
 
259
 
    def leave_lock_in_place(self):
260
 
        """Tell this repository not to release the physical lock when this
261
 
        object is unlocked.
262
 
        
263
 
        If lock_write doesn't return a token, then this method is not supported.
264
 
        """
265
 
        self.control_files.leave_in_place()
266
 
 
267
 
    def dont_leave_lock_in_place(self):
268
 
        """Tell this repository to release the physical lock when this
269
 
        object is unlocked, even if it didn't originally acquire it.
270
 
 
271
 
        If lock_write doesn't return a token, then this method is not supported.
272
 
        """
273
 
        self.control_files.dont_leave_in_place()
274
 
 
275
243
    @needs_read_lock
276
244
    def gather_stats(self, revid=None, committers=None):
277
245
        """Gather statistics from a revision id.
1373
1341
 
1374
1342
    @staticmethod
1375
1343
    def is_compatible(source, target):
1376
 
        if source.supports_rich_root() != target.supports_rich_root():
 
1344
        if not isinstance(source, Repository):
 
1345
            return False
 
1346
        if not isinstance(target, Repository):
 
1347
            return False
 
1348
        if source._format.rich_root_data != target._format.rich_root_data:
1377
1349
            return False
1378
1350
        if source._serializer != target._serializer:
1379
1351
            return False
1380
 
        return True
 
1352
        else:
 
1353
            return True 
1381
1354
 
1382
1355
    @needs_write_lock
1383
1356
    def copy_content(self, revision_id=None):
1613
1586
 
1614
1587
    @staticmethod
1615
1588
    def is_compatible(source, target):
1616
 
        if not source.supports_rich_root() and target.supports_rich_root():
 
1589
        if not isinstance(source, Repository):
 
1590
            return False
 
1591
        if not isinstance(target, Repository):
 
1592
            return False
 
1593
        if not source._format.rich_root_data and target._format.rich_root_data:
1617
1594
            return True
1618
1595
        else:
1619
1596
            return False