~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

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,
38
37
    conflicts as _mod_conflicts,
39
38
    debug,
40
39
    dirstate,
77
76
 
78
77
class DirStateWorkingTree(InventoryWorkingTree):
79
78
 
 
79
    _DEFAULT_WORTH_SAVING_LIMIT = 10
 
80
 
80
81
    def __init__(self, basedir,
81
82
                 branch,
82
83
                 _control_files=None,
250
251
 
251
252
        :return: an integer. -1 means never save.
252
253
        """
253
 
        # FIXME: We want a WorkingTreeStack here -- vila 20110812
254
 
        conf = config.BranchStack(self.branch)
255
 
        return conf.get('bzr.workingtree.worth_saving_limit')
 
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
256
268
 
257
269
    def filter_unversioned_files(self, paths):
258
270
        """Filter out paths that are versioned.
1450
1462
 
1451
1463
    missing_parent_conflicts = True
1452
1464
 
1453
 
    supports_versioned_directories = True
1454
 
 
1455
1465
    _lock_class = LockDir
1456
1466
    _lock_file_name = 'lock'
1457
1467
 
1703
1713
        annotations = self._repository.texts.annotate(text_key)
1704
1714
        return [(key[-1], line) for (key, line) in annotations]
1705
1715
 
 
1716
    def _get_ancestors(self, default_revision):
 
1717
        return set(self._repository.get_ancestry(self._revision_id,
 
1718
                                                 topo_sorted=False))
1706
1719
    def _comparison_data(self, entry, path):
1707
1720
        """See Tree._comparison_data."""
1708
1721
        if entry is None:
1849
1862
        # Make sure the file exists
1850
1863
        entry = self._get_entry(file_id, path=path)
1851
1864
        if entry == (None, None): # do we raise?
1852
 
            raise errors.NoSuchId(self, file_id)
 
1865
            return None
1853
1866
        parent_index = self._get_parent_index()
1854
1867
        last_changed_revision = entry[1][parent_index][4]
1855
1868
        try: