changeset 5294:e14118f92730

mq: fix regression in 6fd953d5faea It caused qrefresh; qrefresh -X addedfile to leave the file as normal in dirstate. It should be marked added on the second pass.
author Brendan Cully <brendan@kublai.com>
date Mon, 10 Sep 2007 15:00:05 -0700
parents 05889b6b1468
children 51b132b4fd36
files hgext/mq.py tests/test-mq tests/test-mq.out
diffstat 3 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Fri Sep 07 17:54:38 2007 +0200
+++ b/hgext/mq.py	Mon Sep 10 15:00:05 2007 -0700
@@ -1025,9 +1025,8 @@
                 copies = {}
                 for dst in a:
                     src = repo.dirstate.copied(dst)
-                    if src is None:
-                        continue
-                    copies.setdefault(src, []).append(dst)
+                    if src is not None:
+                        copies.setdefault(src, []).append(dst)
                     repo.dirstate.add(dst)
                 # remember the copies between patchparent and tip
                 # this may be slow, so don't do it if we're not tracking copies
--- a/tests/test-mq	Fri Sep 07 17:54:38 2007 +0200
+++ b/tests/test-mq	Mon Sep 10 15:00:05 2007 -0700
@@ -338,6 +338,19 @@
 cat .hg/patches/bar
 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
 
+echo % refresh omitting an added file
+hg qnew baz
+echo newfile > newfile
+hg add newfile
+hg qrefresh
+hg st -A newfile
+hg qrefresh -X newfile
+hg st -A newfile
+hg revert newfile
+rm newfile
+hg qpop
+hg qdel baz
+
 echo % create a git patch
 echo a > alexander
 hg add alexander
--- a/tests/test-mq.out	Fri Sep 07 17:54:38 2007 +0200
+++ b/tests/test-mq.out	Mon Sep 10 15:00:05 2007 -0700
@@ -360,6 +360,10 @@
 @@ -0,0 +1,1 @@
 +bar
 3 barney (foo)
+% refresh omitting an added file
+C newfile
+A newfile
+Now at: bar
 % create a git patch
 diff --git a/alexander b/alexander
 % create a git binary patch