~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Robert Collins
  • Date: 2007-09-04 10:08:58 UTC
  • mto: (2592.3.126 repository)
  • mto: This revision was merged to the branch mainline in revision 2862.
  • Revision ID: robertc@robertcollins.net-20070904100858-971b6sssddwfmwrw
* New method on ``bzrlib.tree.Tree`` ``path_content_summary`` provides a
 tuple containing the key information about a path for commit processing
 to complete. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
        self._dirstate = dirstate.DirState.on_file(local_path)
273
273
        return self._dirstate
274
274
 
275
 
    def _directory_is_tree_reference(self, relpath):
276
 
        # as a special case, if a directory contains control files then 
277
 
        # it's a tree reference, except that the root of the tree is not
278
 
        return relpath and osutils.isdir(self.abspath(relpath) + u"/.bzr")
279
 
        # TODO: We could ask all the control formats whether they
280
 
        # recognize this directory, but at the moment there's no cheap api
281
 
        # to do that.  Since we probably can only nest bzr checkouts and
282
 
        # they always use this name it's ok for now.  -- mbp 20060306
283
 
        #
284
 
        # FIXME: There is an unhandled case here of a subdirectory
285
 
        # containing .bzr but not a branch; that will probably blow up
286
 
        # when you try to commit it.  It might happen if there is a
287
 
        # checkout in a subdirectory.  This can be avoided by not adding
288
 
        # it.  mbp 20070306
289
 
 
290
275
    def filter_unversioned_files(self, paths):
291
276
        """Filter out paths that are versioned.
292
277
 
1575
1560
    def kind(self, file_id):
1576
1561
        return self.inventory[file_id].kind
1577
1562
 
 
1563
    def path_content_summary(self, path):
 
1564
        """See Tree.path_content_summary."""
 
1565
        id = self.inventory.path2id(path)
 
1566
        if id is None:
 
1567
            return ('missing', None, None, None)
 
1568
        entry = self._inventory[id]
 
1569
        kind = entry.kind
 
1570
        if kind == 'file':
 
1571
            return (kind, entry.text_size, entry.executable, entry.text_sha1)
 
1572
        elif kind == 'symlink':
 
1573
            return (kind, None, None, entry.symlink_target)
 
1574
        else:
 
1575
            return (kind, None, None, None)
 
1576
 
1578
1577
    def is_executable(self, file_id, path=None):
1579
1578
        ie = self.inventory[file_id]
1580
1579
        if ie.kind != "file":