~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Martin Pool
  • Date: 2006-03-06 11:20:10 UTC
  • mfrom: (1593 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060306112010-17c0170dde5d1eea
[merge] large merge to sync with bzr.dev

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.branch import is_control_file
 
23
from bzrlib.workingtree import is_control_file
24
24
import bzrlib.osutils
25
25
from bzrlib.workingtree import WorkingTree
26
26
 
123
123
 
124
124
        mutter("smart add of %r, abs=%r", f, af)
125
125
        
126
 
        if is_control_file(af):
 
126
        if tree.is_control_filename(af):
127
127
            raise ForbiddenFileError('cannot add control file %s' % f)
128
128
            
129
129
        versioned = (inv.path2id(rf) != None)
130
130
 
131
131
        if kind == 'directory':
132
132
            try:
133
 
                sub_branch = WorkingTree(af)
 
133
                sub_branch = WorkingTree.open(af)
134
134
                sub_tree = True
135
135
            except NotBranchError:
136
136
                sub_tree = False
152
152
        if kind == 'directory' and recurse and not sub_tree:
153
153
            for subf in os.listdir(af):
154
154
                subp = bzrlib.osutils.pathjoin(rf, subf)
155
 
                if subf == bzrlib.BZRDIR:
 
155
                if tree.is_control_filename(subp):
156
156
                    mutter("skip control directory %r", subp)
157
157
                else:
158
158
                    ignore_glob = tree.is_ignored(subp)