~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

Remove unnecessary calls into 'is_control_filename' from smart_add.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.inventory import InventoryEntry
21
21
from bzrlib.trace import mutter, note, warning
22
22
from bzrlib.errors import NotBranchError
23
 
from bzrlib.workingtree import is_control_file
24
23
import bzrlib.osutils
25
24
from bzrlib.workingtree import WorkingTree
26
25
 
104
103
    inv = tree.read_working_inventory()
105
104
    added = []
106
105
    ignored = {}
 
106
    user_files = set(file_list)
107
107
 
108
108
    for f in file_list:
109
109
        rf = tree.relpath(f)
124
124
                continue
125
125
 
126
126
        mutter("smart add of %r, abs=%r", f, af)
127
 
        
128
 
        if tree.is_control_filename(af):
 
127
            
 
128
        # validate user parameters. Our recursive code avoids adding new files
 
129
        # that need such validation 
 
130
        if f in user_files and tree.is_control_filename(af):
129
131
            raise ForbiddenFileError('cannot add control file %s' % f)
130
 
            
 
132
 
131
133
        versioned = (inv.path2id(rf) != None)
132
134
 
133
135
        if kind == 'directory':