~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-08 10:50:51 UTC
  • mfrom: (5050.17.31 2.2.2-dev)
  • mto: This revision was merged to the branch mainline in revision 5474.
  • Revision ID: v.ladeuil+lp@free.fr-20101008105051-xd4knkrohzclffic
Merge 2.2 into trunk including fixes for bug #651706 and bug #646133

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2011 Canonical Ltd
 
1
# Copyright (C) 2007-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1293
1293
            self._inventory = inv
1294
1294
        self.flush()
1295
1295
 
1296
 
    @needs_tree_write_lock
1297
 
    def reset_state(self, revision_ids=None):
1298
 
        """Reset the state of the working tree.
1299
 
 
1300
 
        This does a hard-reset to a last-known-good state. This is a way to
1301
 
        fix if something got corrupted (like the .bzr/checkout/dirstate file)
1302
 
        """
1303
 
        if revision_ids is None:
1304
 
            revision_ids = self.get_parent_ids()
1305
 
        if not revision_ids:
1306
 
            base_tree = self.branch.repository.revision_tree(
1307
 
                _mod_revision.NULL_REVISION)
1308
 
            trees = []
1309
 
        else:
1310
 
            trees = zip(revision_ids,
1311
 
                        self.branch.repository.revision_trees(revision_ids))
1312
 
            base_tree = trees[0][1]
1313
 
        state = self.current_dirstate()
1314
 
        # We don't support ghosts yet
1315
 
        state.set_state_from_scratch(base_tree.inventory, trees, [])
1316
 
 
1317
1296
 
1318
1297
class ContentFilterAwareSHA1Provider(dirstate.SHA1Provider):
1319
1298
 
1406
1385
 
1407
1386
class DirStateWorkingTreeFormat(WorkingTreeFormat3):
1408
1387
 
1409
 
    missing_parent_conflicts = True
1410
 
 
1411
1388
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
1412
1389
                   accelerator_tree=None, hardlink=False):
1413
1390
        """See WorkingTreeFormat.initialize().
1890
1867
    def is_executable(self, file_id, path=None):
1891
1868
        ie = self.inventory[file_id]
1892
1869
        if ie.kind != "file":
1893
 
            return False
 
1870
            return None
1894
1871
        return ie.executable
1895
1872
 
1896
1873
    def is_locked(self):