~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-22 07:28:45 UTC
  • Revision ID: mbp@sourcefrog.net-20050322072845-5859efd4dab29169
use abspath() for the function that makes an absolute
path to something in a branch or tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
    __repr__ = __str__
126
126
 
127
127
 
128
 
    def _rel(self, name):
129
 
        """Return filename relative to branch top"""
 
128
    def abspath(self, name):
 
129
        """Return absolute filename for something in the branch"""
130
130
        return os.path.join(self.base, name)
131
 
        
 
131
 
132
132
 
133
133
    def controlfilename(self, file_or_path):
134
134
        """Return location relative to branch."""
257
257
            if len(fp) == 0:
258
258
                bailout("cannot add top-level %r" % f)
259
259
                
260
 
            fullpath = os.path.normpath(self._rel(f))
 
260
            fullpath = os.path.normpath(self.abspath(f))
261
261
 
262
262
            if isfile(fullpath):
263
263
                kind = 'file'
417
417
 
418
418
            entry = entry.copy()
419
419
 
420
 
            p = self._rel(path)
 
420
            p = self.abspath(path)
421
421
            file_id = entry.file_id
422
422
            mutter('commit prep file %s, id %r ' % (p, file_id))
423
423
 
698
698
        A       foo
699
699
        >>> b.commit("add foo")
700
700
        >>> b.show_status()
701
 
        >>> os.unlink(b._rel('foo'))
 
701
        >>> os.unlink(b.abspath('foo'))
702
702
        >>> b.show_status()
703
703
        D       foo
704
704