~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Martin Pool
  • Date: 2006-05-19 06:04:00 UTC
  • mfrom: (1714 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1717.
  • Revision ID: mbp@sourcefrog.net-20060519060400-df4657a818d9008a
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    entry = inv.add_path(path, kind=kind)
66
66
    mutter("added %r kind %r file_id={%s}" % (path, kind, entry.file_id))
67
67
 
 
68
 
68
69
def add_action_add_and_print(inv, path, kind):
69
70
    """Add each file to the given inventory, and print a line to stdout."""
70
71
    add_action_add(inv, path, kind)
83
84
    tree = WorkingTree.open_containing(file_list[0])[0]
84
85
    return smart_add_tree(tree, file_list, recurse, action)
85
86
 
 
87
 
86
88
def smart_add_tree(tree, file_list, recurse=True, action=add_action_add):
87
89
    """Add files to version, optionally recursing into directories.
88
90
 
165
167
                        mutter("queue to add sub-file %r", subp)
166
168
                        file_list.append(tree.abspath(subp))
167
169
 
168
 
 
169
170
    mutter('added %d entries', len(added))
170
171
    
171
172
    if len(added) > 0:
173
174
 
174
175
    return added, ignored
175
176
 
 
177
 
176
178
def __add_one(tree, inv, path, kind, action):
177
179
    """Add a file or directory, automatically add unversioned parents."""
178
180