~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

 * bzr add now lists how many files were ignored per glob.  add --verbose
   lists the specific files.  (Aaron Bentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
222
222
    add them.
223
223
    """
224
224
    takes_args = ['file*']
225
 
    takes_options = ['no-recurse', 'dry-run']
 
225
    takes_options = ['no-recurse', 'dry-run', 'verbose']
226
226
 
227
 
    def run(self, file_list, no_recurse=False, dry_run=False):
 
227
    def run(self, file_list, no_recurse=False, dry_run=False, verbose=False):
228
228
        import bzrlib.add
229
229
 
230
230
        if dry_run:
238
238
        else:
239
239
            action = bzrlib.add.add_action_add_and_print
240
240
 
241
 
        bzrlib.add.smart_add(file_list, not no_recurse, action)
 
241
        added, ignored = bzrlib.add.smart_add(file_list, not no_recurse, 
 
242
                                              action)
 
243
        if len(ignored) > 0:
 
244
            for glob in sorted(ignored.keys()):
 
245
                match_len = len(ignored[glob])
 
246
                if verbose:
 
247
                    for path in ignored[glob]:
 
248
                        print "ignored %s matching \"%s\"" % (path, glob)
 
249
                else:
 
250
                    print "ignored %d file(s) matching \"%s\"" % (match_len,
 
251
                                                              glob)
 
252
            print "If you wish to add some of these files, please add them"\
 
253
                " by name."
242
254
 
243
255
 
244
256
class cmd_mkdir(Command):
1772
1784
            show_ids=False, verbose=False):
1773
1785
        from bzrlib.missing import find_unmerged, iter_log_data
1774
1786
        from bzrlib.log import log_formatter
1775
 
        local_branch = bzrlib.branch.Branch.open_containing(".")[0]
 
1787
        local_branch = bzrlib.branch.Branch.open_containing(u".")[0]
1776
1788
        parent = local_branch.get_parent()
1777
1789
        if other_branch is None:
1778
1790
            other_branch = parent