~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-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008, 2009 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
1447
1447
                if basis_root_id is not None:
1448
1448
                    wt._set_root_id(basis_root_id)
1449
1449
                    wt.flush()
1450
 
                # If content filtering is supported, do not use the accelerator
1451
 
                # tree - the cost of transforming the content both ways and
1452
 
                # checking for changed content can outweight the gains it gives.
1453
 
                # Note: do NOT move this logic up higher - using the basis from
1454
 
                # the accelerator tree is still desirable because that can save
1455
 
                # a minute or more of processing on large trees!
1456
 
                # The original tree may not have the same content filters
1457
 
                # applied so we can't safely build the inventory delta from
1458
 
                # the source tree.
1459
1450
                if wt.supports_content_filtering():
1460
 
                    if hardlink:
1461
 
                        # see https://bugs.edge.launchpad.net/bzr/+bug/408193
1462
 
                        trace.warning("hardlinking working copy files is not currently "
1463
 
                            "supported in %r" % (wt,))
1464
 
                    accelerator_tree = None
 
1451
                    # The original tree may not have the same content filters
 
1452
                    # applied so we can't safely build the inventory delta from
 
1453
                    # the source tree.
1465
1454
                    delta_from_tree = False
1466
1455
                else:
1467
1456
                    delta_from_tree = True
1766
1755
            return None
1767
1756
        parent_index = self._get_parent_index()
1768
1757
        last_changed_revision = entry[1][parent_index][4]
1769
 
        return self._repository.get_revision(last_changed_revision).timestamp
 
1758
        try:
 
1759
            rev = self._repository.get_revision(last_changed_revision)
 
1760
        except errors.NoSuchRevision:
 
1761
            raise errors.FileTimestampUnavailable(self.id2path(file_id))
 
1762
        return rev.timestamp
1770
1763
 
1771
1764
    def get_file_sha1(self, file_id, path=None, stat_value=None):
1772
1765
        entry = self._get_entry(file_id=file_id, path=path)
1985
1978
        return result
1986
1979
 
1987
1980
    @classmethod
1988
 
    def make_source_parent_tree_compiled_dirstate(klass, test_case, source, target):
 
1981
    def make_source_parent_tree_compiled_dirstate(klass, test_case, source,
 
1982
                                                  target):
1989
1983
        from bzrlib.tests.test__dirstate_helpers import \
1990
 
            CompiledDirstateHelpersFeature
1991
 
        if not CompiledDirstateHelpersFeature.available():
1992
 
            from bzrlib.tests import UnavailableFeature
1993
 
            raise UnavailableFeature(CompiledDirstateHelpersFeature)
 
1984
            compiled_dirstate_helpers_feature
 
1985
        test_case.requireFeature(compiled_dirstate_helpers_feature)
1994
1986
        from bzrlib._dirstate_helpers_pyx import ProcessEntryC
1995
1987
        result = klass.make_source_parent_tree(source, target)
1996
1988
        result[1]._iter_changes = ProcessEntryC
2027
2019
            output. An unversioned file is defined as one with (False, False)
2028
2020
            for the versioned pair.
2029
2021
        """
2030
 
        # NB: show_status depends on being able to pass in non-versioned files
2031
 
        # and report them as unknown
2032
2022
        # TODO: handle extra trees in the dirstate.
2033
2023
        if (extra_trees or specific_files == []):
2034
2024
            # we can't fast-path these cases (yet)