# HG changeset patch # User Patrick Mezard # Date 2008-07-07 07:31:32 # Node ID 04503b75793594b0e4c276bc46f61812a698b750 # Parent cc7114d96548d7a9ecaef82cea32ac7ef8db0a62 # Parent 71e33971458659ee9090c42b5389078f275b0662 Merge with crew-stable diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1129,7 +1129,7 @@ class queue: f = repo.file(dst) src = f.renamed(man[dst]) if src: - copies[src[0]] = copies.get(dst, []) + copies.setdefault(src[0], []).extend(copies.get(dst, [])) if dst in a: copies[src[0]].append(dst) # we can't copy a file created by the patch itself diff --git a/tests/test-mq-qrefresh b/tests/test-mq-qrefresh --- a/tests/test-mq-qrefresh +++ b/tests/test-mq-qrefresh @@ -82,3 +82,28 @@ echo % patch file contents cat .hg/patches/mqbase | \ sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" +cd .. + + + +echo "[diff]" >> $HGRCPATH +echo "git=True" >> $HGRCPATH + +# Test qrefresh --git losing copy metadata +echo % create test repo +hg init repo +cd repo +echo a > a +hg ci -Am adda +hg copy a ab +echo b >> ab +hg copy a ac +echo c >> ac +echo % capture changes +hg qnew -f p1 +hg qdiff +echo % refresh and check changes again +hg qref +hg qdiff +cd .. + diff --git a/tests/test-mq-qrefresh.out b/tests/test-mq-qrefresh.out --- a/tests/test-mq-qrefresh.out +++ b/tests/test-mq-qrefresh.out @@ -159,3 +159,39 @@ diff -r b55ecdccb5cf 2/base @@ -1,1 +1,1 @@ -base +patched +% create test repo +adding a +% capture changes +diff --git a/a b/ab +copy from a +copy to ab +--- a/a ++++ b/ab +@@ -1,1 +1,2 @@ + a ++b +diff --git a/a b/ac +copy from a +copy to ac +--- a/a ++++ b/ac +@@ -1,1 +1,2 @@ + a ++c +% refresh and check changes again +diff --git a/a b/ab +copy from a +copy to ab +--- a/a ++++ b/ab +@@ -1,1 +1,2 @@ + a ++b +diff --git a/a b/ac +copy from a +copy to ac +--- a/a ++++ b/ac +@@ -1,1 +1,2 @@ + a ++c