~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-10-03 02:10:02 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003021002-4bf750e1d2bf7149
move checks for versionability of file kinds into InventoryEntry

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
 
25
25
import bzrlib
 
26
from bzrlib.inventory import InventoryEntry
26
27
from bzrlib.trace import mutter, note
27
28
from bzrlib.osutils import (isdir, quotefn, compact_date, rand_bytes, 
28
29
                            rename, splitpath, sha_file, appendpath, 
578
579
                    # maybe something better?
579
580
                    raise BzrError('cannot add: not a regular file, symlink or directory: %s' % quotefn(f))
580
581
 
581
 
                if kind not in ('file', 'directory', 'symlink'):
582
 
                    raise BzrError('cannot add: not a regular file, symlink or directory: %s' % quotefn(f))
 
582
                if not InventoryEntry.versionable_kind(kind):
 
583
                    raise BzrError('cannot add: not a versionable file ('
 
584
                                   'i.e. regular file, symlink or directory): %s' % quotefn(f))
583
585
 
584
586
                if file_id is None:
585
587
                    file_id = gen_file_id(f)