~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Vincent Ladeuil
  • Date: 2011-10-27 15:38:14 UTC
  • mfrom: (6015.44.4 2.4)
  • mto: This revision was merged to the branch mainline in revision 6236.
  • Revision ID: v.ladeuil+lp@free.fr-20111027153814-0r4nd2io1jv6t47f
Merge 2.4 into trunk including fix for bug #880701

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from bzrlib import (
35
35
    bzrdir,
36
36
    cache_utf8,
 
37
    config,
37
38
    conflicts as _mod_conflicts,
38
39
    debug,
39
40
    dirstate,
76
77
 
77
78
class DirStateWorkingTree(InventoryWorkingTree):
78
79
 
79
 
    _DEFAULT_WORTH_SAVING_LIMIT = 10
80
 
 
81
80
    def __init__(self, basedir,
82
81
                 branch,
83
82
                 _control_files=None,
251
250
 
252
251
        :return: an integer. -1 means never save.
253
252
        """
254
 
        config = self.branch.get_config()
255
 
        val = config.get_user_option('bzr.workingtree.worth_saving_limit')
256
 
        if val is None:
257
 
            val = self._DEFAULT_WORTH_SAVING_LIMIT
258
 
        else:
259
 
            try:
260
 
                val = int(val)
261
 
            except ValueError, e:
262
 
                trace.warning('Invalid config value for'
263
 
                              ' "bzr.workingtree.worth_saving_limit"'
264
 
                              ' value %r is not an integer.'
265
 
                              % (val,))
266
 
                val = self._DEFAULT_WORTH_SAVING_LIMIT
267
 
        return val
 
253
        # FIXME: We want a WorkingTreeStack here -- vila 20110812
 
254
        conf = config.BranchStack(self.branch)
 
255
        return conf.get('bzr.workingtree.worth_saving_limit')
268
256
 
269
257
    def filter_unversioned_files(self, paths):
270
258
        """Filter out paths that are versioned.
1620
1608
    This format:
1621
1609
        - exists within a metadir controlling .bzr
1622
1610
        - includes an explicit version marker for the workingtree control
1623
 
          files, separate from the BzrDir format
 
1611
          files, separate from the ControlDir format
1624
1612
        - modifies the hash cache format
1625
1613
        - is new in bzr 0.15
1626
1614
        - uses a LockDir to guard access to it.
1861
1849
        # Make sure the file exists
1862
1850
        entry = self._get_entry(file_id, path=path)
1863
1851
        if entry == (None, None): # do we raise?
1864
 
            return None
 
1852
            raise errors.NoSuchId(self, file_id)
1865
1853
        parent_index = self._get_parent_index()
1866
1854
        last_changed_revision = entry[1][parent_index][4]
1867
1855
        try: