~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-04 14:28:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5390.
  • Revision ID: john@arbash-meinel.com-20100804142810-9ef2ytu2dh0pwk34
We should be exposing StaticTuple_FromSequence in its api definition

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().
1761
1738
                elif kind == 'directory':
1762
1739
                    parent_ies[(dirname + '/' + name).strip('/')] = inv_entry
1763
1740
                elif kind == 'symlink':
 
1741
                    inv_entry.executable = False
 
1742
                    inv_entry.text_size = None
1764
1743
                    inv_entry.symlink_target = utf8_decode(fingerprint)[0]
1765
1744
                elif kind == 'tree-reference':
1766
1745
                    inv_entry.reference_revision = fingerprint or None
1890
1869
    def is_executable(self, file_id, path=None):
1891
1870
        ie = self.inventory[file_id]
1892
1871
        if ie.kind != "file":
1893
 
            return False
 
1872
            return None
1894
1873
        return ie.executable
1895
1874
 
1896
1875
    def is_locked(self):