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

  • Committer: John Arbash Meinel
  • Date: 2006-05-10 19:59:55 UTC
  • mfrom: (1704 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: john@arbash-meinel.com-20060510195955-df080afb1daa3a96
[merge] bzr.dev 1704

Show diffs side-by-side

added added

removed removed

Lines of Context:
308
308
            the working tree has been constructed from.
309
309
            """)
310
310
 
 
311
    def break_lock(self):
 
312
        """Break a lock if one is present from another instance.
 
313
 
 
314
        Uses the ui factory to ask for confirmation if the lock may be from
 
315
        an active process.
 
316
 
 
317
        This will probe the repository for its lock as well.
 
318
        """
 
319
        self._control_files.break_lock()
 
320
        self.branch.break_lock()
 
321
 
311
322
    def _set_inventory(self, inv):
312
323
        self._inventory = inv
313
324
        self.path2id = self._inventory.path2id
1060
1071
        """
1061
1072
        return self.branch.last_revision()
1062
1073
 
 
1074
    def is_locked(self):
 
1075
        return self._control_files.is_locked()
 
1076
 
1063
1077
    def lock_read(self):
1064
1078
        """See Branch.lock_read, and WorkingTree.unlock."""
1065
1079
        self.branch.lock_read()
1078
1092
            self.branch.unlock()
1079
1093
            raise
1080
1094
 
 
1095
    def get_physical_lock_status(self):
 
1096
        return self._control_files.get_physical_lock_status()
 
1097
 
1081
1098
    def _basis_inventory_name(self):
1082
1099
        return 'basis-inventory'
1083
1100
 
1258
1275
             self._control_files._lock_count==3)):
1259
1276
            self._hashcache.write()
1260
1277
        # reverse order of locking.
1261
 
        result = self._control_files.unlock()
1262
1278
        try:
 
1279
            return self._control_files.unlock()
 
1280
        finally:
1263
1281
            self.branch.unlock()
1264
 
        finally:
1265
 
            return result
1266
1282
 
1267
1283
    @needs_write_lock
1268
1284
    def update(self):
1523
1539
        """See WorkingTreeFormat.get_format_description()."""
1524
1540
        return "Working tree format 2"
1525
1541
 
 
1542
    def stub_initialize_remote(self, control_files):
 
1543
        """As a special workaround create critical control files for a remote working tree
 
1544
        
 
1545
        This ensures that it can later be updated and dealt with locally,
 
1546
        since BzrDirFormat6 and BzrDirFormat5 cannot represent dirs with 
 
1547
        no working tree.  (See bug #43064).
 
1548
        """
 
1549
        sio = StringIO()
 
1550
        inv = Inventory()
 
1551
        bzrlib.xml5.serializer_v5.write_inventory(inv, sio)
 
1552
        sio.seek(0)
 
1553
        control_files.put('inventory', sio)
 
1554
 
 
1555
        control_files.put_utf8('pending-merges', '')
 
1556
        
 
1557
 
1526
1558
    def initialize(self, a_bzrdir, revision_id=None):
1527
1559
        """See WorkingTreeFormat.initialize()."""
1528
1560
        if not isinstance(a_bzrdir.transport, LocalTransport):