~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Robert Collins
  • Date: 2007-03-07 08:02:58 UTC
  • mfrom: (2255.2.239 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: robertc@robertcollins.net-20070307080258-fi172acyjga89fz5
(robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
 
170
170
 
171
171
def smart_add_tree(tree, file_list, recurse=True, action=None, save=True):
 
172
    tree.lock_tree_write()
 
173
    try:
 
174
        return _smart_add_tree(tree=tree, file_list=file_list, recurse=recurse,
 
175
                               action=action, save=save)
 
176
    finally:
 
177
        tree.unlock()
 
178
 
 
179
def _smart_add_tree(tree, file_list, recurse=True, action=None, save=True):
172
180
    """Add files to version, optionally recursing into directories.
173
181
 
174
182
    This is designed more towards DWIM for humans than API simplicity.
279
287
            pass
280
288
            # mutter("%r is already versioned", abspath)
281
289
        elif sub_tree:
 
290
            # XXX: This is wrong; people *might* reasonably be trying to add
 
291
            # subtrees as subtrees.  This should probably only be done in formats 
 
292
            # which can represent subtrees, and even then perhaps only when
 
293
            # the user asked to add subtrees.  At the moment you can add them
 
294
            # specially through 'join --reference', which is perhaps
 
295
            # reasonable: adding a new reference is a special operation and
 
296
            # can have a special behaviour.  mbp 20070306
282
297
            mutter("%r is a nested bzr tree", abspath)
283
298
        else:
284
299
            __add_one(tree, inv, parent_ie, directory, kind, action)