~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Martin
  • Date: 2010-06-22 00:32:37 UTC
  • mto: This revision was merged to the branch mainline in revision 5315.
  • Revision ID: gzlist@googlemail.com-20100622003237-zntnpyx8hjb5jnpw
Change interface of _command_line_to_argv so old tests can still be used with new stripping logic

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    hooks,
33
33
    osutils,
34
34
    revisiontree,
35
 
    inventory,
36
35
    symbol_versioning,
37
36
    trace,
38
37
    tree,
376
375
        This is designed more towards DWIM for humans than API clarity.
377
376
        For the specific behaviour see the help for cmd_add().
378
377
 
379
 
        :param file_list: List of zero or more paths.  *NB: these are 
380
 
            interpreted relative to the process cwd, not relative to the 
381
 
            tree.*  (Add and most other tree methods use tree-relative
382
 
            paths.)
383
378
        :param action: A reporter to be called with the inventory, parent_ie,
384
379
            path and kind of the path being added. It may return a file_id if
385
380
            a specific one should be used.
416
411
            for c in self.conflicts():
417
412
                conflicts_related.update(c.associated_filenames())
418
413
 
419
 
        # expand any symlinks in the directory part, while leaving the
420
 
        # filename alone
421
 
        file_list = map(osutils.normalizepath, file_list)
422
 
 
423
414
        # validate user file paths and convert all paths to tree
424
415
        # relative : it's cheaper to make a tree relative path an abspath
425
416
        # than to convert an abspath to tree relative, and it's cheaper to
724
715
        file_id or None to generate a new file id
725
716
    :returns: None
726
717
    """
727
 
    # if the parent exists, but isn't a directory, we have to do the
728
 
    # kind change now -- really the inventory shouldn't pretend to know
729
 
    # the kind of wt files, but it does.
730
 
    if parent_ie.kind != 'directory':
731
 
        # nb: this relies on someone else checking that the path we're using
732
 
        # doesn't contain symlinks.
733
 
        new_parent_ie = inventory.make_entry('directory', parent_ie.name,
734
 
            parent_ie.parent_id, parent_ie.file_id)
735
 
        del inv[parent_ie.file_id]
736
 
        inv.add(new_parent_ie)
737
 
        parent_ie = new_parent_ie
738
718
    file_id = file_id_callback(inv, parent_ie, path, kind)
739
719
    entry = inv.make_entry(kind, path.base_path, parent_ie.file_id,
740
720
        file_id=file_id)