diff mercurial/cmdutil.py @ 11223:0d09f2244805

rename: make --after work if source is already in R state I routinely want to use `hg addrem` and then fix up missed renames manually using `hg mv -A`. This patch allows me to record such renames from a source in state R to a target in state A.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Wed, 26 May 2010 16:16:47 +0200
parents 6a64813276ed
children 1107888a1ad1
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue May 25 18:45:44 2010 +0200
+++ b/mercurial/cmdutil.py	Wed May 26 16:16:47 2010 +0200
@@ -351,12 +351,13 @@
 
     def walkpat(pat):
         srcs = []
+        badstates = after and '?' or '?r'
         m = match(repo, [pat], opts, globbed=True)
         for abs in repo.walk(m):
             state = repo.dirstate[abs]
             rel = m.rel(abs)
             exact = m.exact(abs)
-            if state in '?r':
+            if state in badstates:
                 if exact and state == '?':
                     ui.warn(_('%s: not copying - file is not managed\n') % rel)
                 if exact and state == 'r':