view tests/test-mq-safety @ 7566:5f7e3f17aece

mq: drop copy records when refreshing regular patches (issue1441) Copy information was saved in a common loop, then refined in a git-only block. The problem was the latter did filter out renames occuring in the current patch and irrelevant to commit. In the non-git case, copy records still existed in the dirstate, referencing removed files, making the commit to fail. Git and non-git copy handling paths are now separated for simplicity. Reported by Gary Bernhardt
author Patrick Mezard <pmezard@gmail.com>
date Sun, 04 Jan 2009 21:32:40 +0100
parents dcda0c90125c
children 5b7da468531b
line wrap: on
line source

#!/bin/sh

echo '[extensions]' >> $HGRCPATH
echo 'hgext.mq =' >> $HGRCPATH

hg init repo
cd repo

echo foo > foo
hg ci -qAm 'add a file'

hg qinit

hg qnew foo
echo foo >> foo
hg qrefresh -m 'append foo'

hg qnew bar
echo bar >> foo
hg qrefresh -m 'append bar'

echo '% try to commit on top of a patch'
echo quux >> foo
hg ci -m 'append quux'

# cheat a bit...
mv .hg/patches .hg/patches2
hg ci -m 'append quux'
mv .hg/patches2 .hg/patches

echo '% qpop/qrefresh on the wrong revision'
hg qpop
hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
hg qrefresh

hg up -C qtip
echo '% qpop'
hg qpop

echo '% qrefresh'
hg qrefresh

echo '% tip:'
hg tip --template '#rev# #desc#\n'