changeset 4864:fc8b3e7cbf6b

improve warning for hg add foo; hg mv foo bar
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Wed, 11 Jul 2007 19:56:16 -0300
parents 0875082d5471
children 439e2f2fde42
files mercurial/commands.py tests/test-copy2.out
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -533,9 +533,10 @@ def docopy(ui, repo, pats, opts, wlock):
         targets[abstarget] = abssrc
         if abstarget != origsrc:
             if repo.dirstate.state(origsrc) == 'a':
-                ui.warn(_("%s was marked for addition. "
-                          "%s will not be committed as a copy.\n")
-                        % (repo.pathto(origsrc, cwd), reltarget))
+                if not ui.quiet:
+                    ui.warn(_("%s has not been committed yet, so no copy "
+                              "data will be stored for %s.\n")
+                            % (repo.pathto(origsrc, cwd), reltarget))
                 if abstarget not in repo.dirstate and not opts.get('dry_run'):
                     repo.add([abstarget], wlock)
             elif not opts.get('dry_run'):
--- a/tests/test-copy2.out
+++ b/tests/test-copy2.out
@@ -3,13 +3,13 @@ foo: not copying - file is not managed
 abort: no files to copy
 ? foo
 # dry-run; print a warning that this is not a real copy; foo is added
-foo was marked for addition. bar will not be committed as a copy.
+foo has not been committed yet, so no copy data will be stored for bar.
 A foo
 # should print a warning that this is not a real copy; bar is added
-foo was marked for addition. bar will not be committed as a copy.
+foo has not been committed yet, so no copy data will be stored for bar.
 A bar
 # should print a warning that this is not a real copy; foo is added
-bar was marked for addition. foo will not be committed as a copy.
+bar has not been committed yet, so no copy data will be stored for foo.
 A foo
 # dry-run; should show that foo is clean
 C foo