165
165
print Branch('.').revno()
168
169
def cmd_add(file_list, verbose=False):
169
"""Add specified files.
170
"""Add specified files or directories.
172
In non-recursive mode, all the named items are added, regardless
173
of whether they were previously ignored. A warning is given if
174
any of the named files are already versioned.
176
In recursive mode (the default), files are treated the same way
177
but the behaviour for directories is different. Directories that
178
are already versioned do not give a warning. All directories,
179
whether already versioned or not, are searched for files or
180
subdirectories that are neither versioned or ignored, and these
181
are added. This search proceeds recursively into versioned
184
Therefore simply saying 'bzr add .' will version all files that
185
are currently unknown.
188
bzrlib.add.smart_add(file_list, verbose)
192
b = Branch(file_list[0], find_root=True)
193
b.add([b.relpath(f) for f in file_list], verbose=verbose)
171
Fails if the files are already added.
174
b = Branch(file_list[0], find_root=True)
175
b.add([b.relpath(f) for f in file_list], verbose=verbose)
178
197
def cmd_relpath(filename):
179
198
print Branch(filename).relpath(filename)
508
527
bzrlib.trace.verbose = False
510
529
for m in bzrlib.store, bzrlib.inventory, bzrlib.branch, bzrlib.osutils, \
511
bzrlib.tree, bzrlib.tests, bzrlib.commands:
530
bzrlib.tree, bzrlib.tests, bzrlib.commands, bzrlib.add:
512
531
mf, mt = doctest.testmod(m)