~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Robert Collins
  • Date: 2005-10-03 02:54:29 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003025429-a9a2b4544b48cdd4
push kind character creation into InventoryEntry and TreeEntry

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        else:
161
161
            raise BzrError("unhandled entry kind %r" % kind)
162
162
 
 
163
    def kind_character(self):
 
164
        """Return a short kind indicator useful for appending to names."""
 
165
        if self.kind == 'directory':
 
166
            return '/'
 
167
        if self.kind == 'file':
 
168
            return ''
 
169
        if self.kind == 'symlink':
 
170
            return ''
 
171
        raise RuntimeError('unreachable code')
 
172
 
163
173
    def read_symlink_target(self, path):
164
174
        if self.kind == 'symlink':
165
175
            try: