~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2005-09-07 10:47:36 UTC
  • mto: (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050907104736-8e592b72108c577d
symlink support updated to work

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        working inventory.
217
217
    """
218
218
    from bzrlib.inventory import Inventory
219
 
    from bzrlib.osutils import isdir, isfile, sha_string, quotefn, \
 
219
    from bzrlib.osutils import isdir, isfile, islink, sha_string, quotefn, \
220
220
         local_time_offset, username, kind_marker, is_inside_any
221
221
    
222
222
    from bzrlib.branch import gen_file_id
264
264
        if old_ie:
265
265
            old_kind = old_ie.kind
266
266
            if old_kind != entry.kind:
267
 
                raise BzrError("entry %r changed kind from %r to %r"
268
 
                        % (file_id, old_kind, entry.kind))
 
267
                raise BzrError("entry %r changed kind from %r to %r - not "
 
268
                               "supported yet."
 
269
                                % (file_id, old_kind, entry.kind))
269
270
 
270
271
        if entry.kind == 'directory':
271
272
            if not isdir(p):
296
297
                entry.text_id = gen_file_id(entry.name)
297
298
                branch.text_store.add(content, entry.text_id)
298
299
                mutter('    stored with text_id {%s}' % entry.text_id)
 
300
        elif entry.kind == 'symlink':
 
301
            if not islink(p):
 
302
                raise BzrError("%s is entered as link but is not a link" 
 
303
                                % quotefn(p))
 
304
 
 
305
            entry.read_symlink_target(path)
 
306
 
 
307
            if (old_ie
 
308
                and old_ie.symlink_target == entry.symlink_target):
 
309
                mutter('    unchanged from previous symlink {%s}' %
 
310
                       entry.symlink_target)
 
311
            else:
 
312
                mutter('    changed to value {%s}' % entry.symlink_target)
299
313
 
300
314
        if verbose:
301
315
            marked = path + kind_marker(entry.kind)