Get all commands that operate on files to honour --verbose and --quiet.
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 14 Sep 2005 22:32:12 -0700
changeset 1255 e825dfea3823
parent 1254 e6560042b7b8
child 1256 8054fdb0b145
child 1257 fe7fbfdb066d
Get all commands that operate on files to honour --verbose and --quiet. Fix minor bug in remove command; the when-to-unlink logic was wonky.
mercurial/commands.py
--- a/mercurial/commands.py	Wed Sep 14 21:57:41 2005 -0700
+++ b/mercurial/commands.py	Wed Sep 14 22:32:12 2005 -0700
@@ -485,6 +485,7 @@
     names = []
     for src, abs, rel, exact in walk(repo, pats, opts):
         if exact:
+            if ui.verbose: ui.status('adding %s\n' % rel)
             names.append(abs)
         elif repo.dirstate.state(abs) == '?':
             ui.status('adding %s\n' % rel)
@@ -497,11 +498,11 @@
     for src, abs, rel, exact in walk(repo, pats, opts):
         if src == 'f' and repo.dirstate.state(abs) == '?':
             add.append(abs)
-            if not exact:
+            if ui.verbose or not exact:
                 ui.status('adding ', rel, '\n')
         if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
             remove.append(abs)
-            if not exact:
+            if ui.verbose or not exact:
                 ui.status('removing ', rel, '\n')
     repo.add(add)
     repo.remove(remove)
@@ -966,7 +967,7 @@
     for src, abs, rel, exact in walk(repo, pats, opts):
         if repo.dirstate.state(abs) == 'a':
             forget.append(abs)
-            if not exact:
+            if ui.verbose or not exact:
                 ui.status('forgetting ', rel, '\n')
     repo.forget(forget)
 
@@ -1404,8 +1405,8 @@
         if c: reason = 'is modified'
         elif a: reason = 'has been marked for add'
         elif u: reason = 'is not managed'
-        if reason and exact:
-            ui.warn('not removing %s: file %s\n' % (rel, reason))
+        if reason:
+            if exact: ui.warn('not removing %s: file %s\n' % (rel, reason))
         else:
             return True
     for src, abs, rel, exact in walk(repo, (pat,) + pats, opts):