Mercurial > hg
changeset 6801:71e339714586
mq: fix qrefresh losing copy information (issue 1134)
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 07 Jul 2008 09:16:09 +0200 |
parents | bbd89c9e6012 |
children | 04503b757935 e1d8e79d7c8f |
files | hgext/mq.py tests/test-mq-qrefresh tests/test-mq-qrefresh.out |
diffstat | 3 files changed, 62 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Wed Jun 25 14:13:20 2008 -0700 +++ b/hgext/mq.py Mon Jul 07 09:16:09 2008 +0200 @@ -1106,7 +1106,7 @@ 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
--- a/tests/test-mq-qrefresh Wed Jun 25 14:13:20 2008 -0700 +++ b/tests/test-mq-qrefresh Mon Jul 07 09:16:09 2008 +0200 @@ -82,3 +82,28 @@ 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 .. +
--- a/tests/test-mq-qrefresh.out Wed Jun 25 14:13:20 2008 -0700 +++ b/tests/test-mq-qrefresh.out Mon Jul 07 09:16:09 2008 +0200 @@ -159,3 +159,39 @@ @@ -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