/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-20 14:51:03 UTC
  • mfrom: (0.8.23 version_info)
  • mto: This revision was merged to the branch mainline in revision 2028.
  • Revision ID: john@arbash-meinel.com-20060920145103-02725c6d6c886040
[merge] version-info plugin, and cleanup for layout in bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from os.path import dirname
20
20
import sys
21
21
 
22
 
import bzrlib.bzrdir
23
22
import bzrlib.errors as errors
24
23
from bzrlib.inventory import InventoryEntry
25
24
from bzrlib.trace import mutter, note, warning
169
168
 
170
169
 
171
170
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):
180
171
    """Add files to version, optionally recursing into directories.
181
172
 
182
173
    This is designed more towards DWIM for humans than API simplicity.
212
203
        # validate user parameters. Our recursive code avoids adding new files
213
204
        # that need such validation 
214
205
        if tree.is_control_filename(rf.raw_path):
215
 
            raise errors.ForbiddenControlFileError(filename=rf.raw_path)
 
206
            raise errors.ForbiddenControlFileError(filename=rf)
216
207
        
217
208
        abspath = tree.abspath(rf.raw_path)
218
209
        kind = bzrlib.osutils.file_kind(abspath)
287
278
            pass
288
279
            # mutter("%r is already versioned", abspath)
289
280
        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
297
281
            mutter("%r is a nested bzr tree", abspath)
298
282
        else:
299
283
            __add_one(tree, inv, parent_ie, directory, kind, action)