tests/test-mq-qdiff
author Mads Kiilerich <mads@kiilerich.com>
Tue, 29 Jun 2010 12:12:34 +0200
branchstable
changeset 11488 f786fc4b8764
parent 11049 a84f14228b1d
permissions -rwxr-xr-x
log: follow filenames through renames (issue647) In commands.log a displayer was initialized from cmdutil.show_changeset() with the initial matchfn (which designates the specified files which only is correct in the highest revision in the range). prep() is handed the correct list of files, but displayer.show() didn't use that list but keept using the original matchfn. The matchfn argument to cmdutil.show_changeset() wasn't specified in other places and is only used in .show(), so now we give the matchfn as an optional parameter to .show(). We do however still have to detect --patch and --stat from opts in show_changeset() and let it imply a matchall, but that can now be overruled with the new .show() matchfn parameter.

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH
echo "[mq]" >> $HGRCPATH
echo "git=keep" >> $HGRCPATH

echo % init
hg init a
cd a

echo % commit
echo 'base' > base
hg ci -Ambase -d '1 0'

echo % qnew mqbase
hg qnew -mmqbase mqbase

echo % qrefresh
echo 'patched' > base
hg qrefresh

echo % qdiff
hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"

echo % qdiff dirname
hg qdiff . | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
                 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"

echo % qdiff filename
hg qdiff --nodates base

echo % revert
hg revert -a

echo % qpop
hg qpop

echo % qdelete mqbase
hg qdelete mqbase

echo % commit 2
printf '1\n2\n3\n4\nhello world\ngoodbye world\n7\n8\n9\n' > lines
hg ci -Amlines -d '2 0'

echo % qnew 2
hg qnew -mmqbase2 mqbase2
printf '\n\n1\n2\n3\n4\nhello  world\n     goodbye world\n7\n8\n9\n' > lines

echo % qdiff -U 1
hg qdiff --nodates -U 1

echo % qdiff -b
hg qdiff --nodates -b

echo % qdiff -U 1 -B
hg qdiff --nodates -U 1 -B

echo % qdiff -w
hg qdiff --nodates -w

echo % qdiff --reverse
hg qdiff --nodates --reverse

echo % qdiff preserve existing git flag
hg qrefresh --git
echo a >> lines
hg qdiff

echo % qdiff --stat
hg qdiff --stat