~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: John Arbash Meinel
  • Date: 2009-09-02 13:32:52 UTC
  • mfrom: (4634.6.14 2.0)
  • mto: (4634.6.15 2.0)
  • mto: This revision was merged to the branch mainline in revision 4667.
  • Revision ID: john@arbash-meinel.com-20090902133252-t2t94xtckoliv2th
Merge lp:bzr/2.0 to resolve NEWS issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1300
1300
        return statvalue, sha1
1301
1301
 
1302
1302
 
 
1303
class ContentFilteringDirStateWorkingTree(DirStateWorkingTree):
 
1304
    """Dirstate working tree that supports content filtering.
 
1305
 
 
1306
    The dirstate holds the hash and size of the canonical form of the file, 
 
1307
    and most methods must return that.
 
1308
    """
 
1309
 
 
1310
    def _file_content_summary(self, path, stat_result):
 
1311
        # This is to support the somewhat obsolete path_content_summary method
 
1312
        # with content filtering: see
 
1313
        # <https://bugs.edge.launchpad.net/bzr/+bug/415508>.
 
1314
        #
 
1315
        # If the dirstate cache is up to date and knows the hash and size,
 
1316
        # return that.
 
1317
        # Otherwise if there are no content filters, return the on-disk size
 
1318
        # and leave the hash blank.
 
1319
        # Otherwise, read and filter the on-disk file and use its size and
 
1320
        # hash.
 
1321
        #
 
1322
        # The dirstate doesn't store the size of the canonical form so we
 
1323
        # can't trust it for content-filtered trees.  We just return None.
 
1324
        dirstate_sha1 = self._dirstate.sha1_from_stat(path, stat_result)
 
1325
        executable = self._is_executable_from_path_and_stat(path, stat_result)
 
1326
        return ('file', None, executable, dirstate_sha1)
 
1327
 
 
1328
 
1303
1329
class WorkingTree4(DirStateWorkingTree):
1304
1330
    """This is the Format 4 working tree.
1305
1331
 
1313
1339
    """
1314
1340
 
1315
1341
 
1316
 
class WorkingTree5(DirStateWorkingTree):
 
1342
class WorkingTree5(ContentFilteringDirStateWorkingTree):
1317
1343
    """This is the Format 5 working tree.
1318
1344
 
1319
1345
    This differs from WorkingTree4 by:
1323
1349
    """
1324
1350
 
1325
1351
 
1326
 
class WorkingTree6(DirStateWorkingTree):
 
1352
class WorkingTree6(ContentFilteringDirStateWorkingTree):
1327
1353
    """This is the Format 6 working tree.
1328
1354
 
1329
1355
    This differs from WorkingTree5 by:
1550
1576
 
1551
1577
 
1552
1578
class DirStateRevisionTree(Tree):
1553
 
    """A revision tree pulling the inventory from a dirstate."""
 
1579
    """A revision tree pulling the inventory from a dirstate.
 
1580
    
 
1581
    Note that this is one of the historical (ie revision) trees cached in the
 
1582
    dirstate for easy access, not the workingtree.
 
1583
    """
1554
1584
 
1555
1585
    def __init__(self, dirstate, revision_id, repository):
1556
1586
        self._dirstate = dirstate