# HG changeset patch # User Brendan Cully # Date 1189461605 25200 # Node ID e14118f927301d5387d0f806c207c19ab6e6e7ba # Parent 05889b6b1468e98f9305ed6823287a2d3a542429 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. diff -r 05889b6b1468 -r e14118f92730 hgext/mq.py --- 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 diff -r 05889b6b1468 -r e14118f92730 tests/test-mq --- 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 diff -r 05889b6b1468 -r e14118f92730 tests/test-mq.out --- 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