~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Paired performance tuning of bzr add. (Robert Collins, Martin Pool).

Show diffs side-by-side

added added

removed removed

Lines of Context:
320
320
    def is_control_filename(self, filename):
321
321
        """True if filename is the name of a control file in this tree.
322
322
        
 
323
        :param filename: A filename within the tree. This is a relative path
 
324
        from the root of this tree.
 
325
 
323
326
        This is true IF and ONLY IF the filename is part of the meta data
324
327
        that bzr controls in this tree. I.E. a random .bzr directory placed
325
328
        on disk will not be a control file for this tree.
326
329
        """
327
 
        try:
328
 
            self.bzrdir.transport.relpath(self.abspath(filename))
329
 
            return True
330
 
        except errors.PathNotChild:
331
 
            return False
 
330
        return self.bzrdir.is_control_filename(filename)
332
331
 
333
332
    @staticmethod
334
333
    def open(path=None, _unsupported=False):
435
434
        """
436
435
        return bzrdir.BzrDir.create_standalone_workingtree(directory)
437
436
 
438
 
    def relpath(self, abs):
439
 
        """Return the local path portion from a given absolute path."""
440
 
        return relpath(self.basedir, abs)
 
437
    def relpath(self, path):
 
438
        """Return the local path portion from a given path.
 
439
        
 
440
        The path may be absolute or relative. If its a relative path it is 
 
441
        interpreted relative to the python current working directory.
 
442
        """
 
443
        return relpath(self.basedir, path)
441
444
 
442
445
    def has_filename(self, filename):
443
446
        return bzrlib.osutils.lexists(self.abspath(filename))