##// END OF EJS Templates
mq: preserve --git flag when merging patches...
mq: preserve --git flag when merging patches Without this, merging a patch queue without diff.git=1 downgrades all git patches to regular patches, losing data in the process.

File last commit:

r8426:2ff17c4d default
r10185:7637fe4f stable
Show More
test-mq-qfold
36 lines | 538 B | text/plain | TextLexer
#!/bin/sh
echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH
filterdiff()
{
grep -v diff | \
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
}
echo '% init'
hg init repo
cd repo
echo a > a
hg ci -Am adda
echo a >> a
hg qnew -f p1
echo b >> a
hg qnew -f p2
echo c >> a
hg qnew -f p3
echo '% fold in the middle of the queue'
hg qpop p1
hg qdiff | filterdiff
hg qfold p2
hg qser
hg qdiff | filterdiff
echo '% fold with local changes'
echo d >> a
hg qfold p3
hg diff -c . | filterdiff
cd ..