/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Jelmer Vernooij
  • Date: 2009-05-28 16:04:39 UTC
  • mfrom: (4387 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4405.
  • Revision ID: jelmer@samba.org-20090528160439-4z0xlrk5nejobm7q
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008, 2009 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
1301
1301
        self.tree = tree
1302
1302
 
1303
1303
    def sha1(self, abspath):
1304
 
        """Return the sha1 of a file given its absolute path."""
1305
 
        filters = self.tree._content_filter_stack(self.tree.relpath(abspath))
 
1304
        """See dirstate.SHA1Provider.sha1()."""
 
1305
        filters = self.tree._content_filter_stack(
 
1306
            self.tree.relpath(osutils.safe_unicode(abspath)))
1306
1307
        return internal_size_sha_file_byname(abspath, filters)[1]
1307
1308
 
1308
1309
    def stat_and_sha1(self, abspath):
1309
 
        """Return the stat and sha1 of a file given its absolute path."""
1310
 
        filters = self.tree._content_filter_stack(self.tree.relpath(abspath))
 
1310
        """See dirstate.SHA1Provider.stat_and_sha1()."""
 
1311
        filters = self.tree._content_filter_stack(
 
1312
            self.tree.relpath(osutils.safe_unicode(abspath)))
1311
1313
        file_obj = file(abspath, 'rb', 65000)
1312
1314
        try:
1313
1315
            statvalue = os.fstat(file_obj.fileno())
1432
1434
                if basis_root_id is not None:
1433
1435
                    wt._set_root_id(basis_root_id)
1434
1436
                    wt.flush()
 
1437
                # If content filtering is supported, do not use the accelerator
 
1438
                # tree - the cost of transforming the content both ways and
 
1439
                # checking for changed content can outweight the gains it gives.
 
1440
                # Note: do NOT move this logic up higher - using the basis from
 
1441
                # the accelerator tree is still desirable because that can save
 
1442
                # a minute or more of processing on large trees!
 
1443
                if wt.supports_content_filtering():
 
1444
                    accelerator_tree = None
1435
1445
                # delta_from_tree is safe even for DirStateRevisionTrees,
1436
1446
                # because wt4.apply_inventory_delta does not mutate the input
1437
1447
                # inventory entries.
2019
2029
        else:
2020
2030
            specific_files = set([''])
2021
2031
        # -- specific_files is now a utf8 path set --
2022
 
        search_specific_files = set()
 
2032
 
2023
2033
        # -- get the state object and prepare it.
2024
2034
        state = self.target.current_dirstate()
2025
2035
        state._read_dirblocks_if_needed()
2049
2059
            if not all_versioned:
2050
2060
                raise errors.PathsNotVersionedError(specific_files)
2051
2061
        # -- remove redundancy in supplied specific_files to prevent over-scanning --
2052
 
        for path in specific_files:
2053
 
            other_specific_files = specific_files.difference(set([path]))
2054
 
            if not osutils.is_inside_any(other_specific_files, path):
2055
 
                # this is a top level path, we must check it.
2056
 
                search_specific_files.add(path)
 
2062
        search_specific_files = osutils.minimum_path_selection(specific_files)
2057
2063
 
2058
2064
        use_filesystem_for_exec = (sys.platform != 'win32')
2059
2065
        iter_changes = self.target._iter_changes(include_unchanged,