2006-07-29 22:14:32 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-05-21 15:55:18 +04:00
|
|
|
. $TESTDIR/helpers.sh
|
2010-05-20 21:15:44 +04:00
|
|
|
|
2007-11-10 01:21:35 +03:00
|
|
|
checkundo()
|
|
|
|
{
|
|
|
|
if [ -f .hg/store/undo ]; then
|
|
|
|
echo ".hg/store/undo still exists after $1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2006-08-22 12:08:42 +04:00
|
|
|
echo "[extensions]" >> $HGRCPATH
|
|
|
|
echo "mq=" >> $HGRCPATH
|
2006-07-29 22:14:32 +04:00
|
|
|
|
2010-02-07 18:47:54 +03:00
|
|
|
echo "[mq]" >> $HGRCPATH
|
|
|
|
echo "plain=true" >> $HGRCPATH
|
|
|
|
|
2006-07-29 22:14:32 +04:00
|
|
|
echo % help
|
|
|
|
hg help mq
|
|
|
|
|
|
|
|
hg init a
|
|
|
|
cd a
|
|
|
|
echo a > a
|
2006-08-11 03:10:59 +04:00
|
|
|
hg ci -Ama
|
|
|
|
|
|
|
|
hg clone . ../k
|
|
|
|
|
2006-07-29 22:14:32 +04:00
|
|
|
mkdir b
|
|
|
|
echo z > b/z
|
|
|
|
hg ci -Ama
|
|
|
|
|
|
|
|
echo % qinit
|
|
|
|
|
|
|
|
hg qinit
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
hg init b
|
|
|
|
|
|
|
|
echo % -R qinit
|
|
|
|
|
|
|
|
hg -R b qinit
|
|
|
|
|
|
|
|
hg init c
|
|
|
|
|
|
|
|
echo % qinit -c
|
|
|
|
|
|
|
|
hg --cwd c qinit -c
|
|
|
|
hg -R c/.hg/patches st
|
|
|
|
|
2007-02-09 08:48:30 +03:00
|
|
|
echo '% qinit; qinit -c'
|
|
|
|
hg init d
|
|
|
|
cd d
|
|
|
|
hg qinit
|
|
|
|
hg qinit -c
|
|
|
|
# qinit -c should create both files if they don't exist
|
|
|
|
echo ' .hgignore:'
|
|
|
|
cat .hg/patches/.hgignore
|
|
|
|
echo ' series:'
|
|
|
|
cat .hg/patches/series
|
|
|
|
hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo '% qinit; <stuff>; qinit -c'
|
|
|
|
hg init e
|
|
|
|
cd e
|
|
|
|
hg qnew A
|
2007-11-10 01:21:35 +03:00
|
|
|
checkundo qnew
|
2007-02-09 08:48:30 +03:00
|
|
|
echo foo > foo
|
|
|
|
hg add foo
|
|
|
|
hg qrefresh
|
|
|
|
hg qnew B
|
|
|
|
echo >> foo
|
|
|
|
hg qrefresh
|
|
|
|
echo status >> .hg/patches/.hgignore
|
|
|
|
echo bleh >> .hg/patches/.hgignore
|
|
|
|
hg qinit -c
|
|
|
|
hg -R .hg/patches status
|
|
|
|
# qinit -c shouldn't touch these files if they already exist
|
|
|
|
echo ' .hgignore:'
|
|
|
|
cat .hg/patches/.hgignore
|
|
|
|
echo ' series:'
|
|
|
|
cat .hg/patches/series
|
2010-07-02 04:23:26 +04:00
|
|
|
|
|
|
|
echo '% status --mq with color (issue2096)'
|
|
|
|
hg status --mq --config extensions.color= --color=always
|
2007-02-09 08:48:30 +03:00
|
|
|
cd ..
|
|
|
|
|
2010-03-14 20:46:38 +03:00
|
|
|
echo '% init --mq without repo'
|
|
|
|
mkdir f
|
|
|
|
cd f
|
|
|
|
hg init --mq
|
|
|
|
cd ..
|
|
|
|
|
2010-03-15 22:52:22 +03:00
|
|
|
echo '% init --mq with repo path'
|
|
|
|
hg init g
|
|
|
|
hg init --mq g
|
|
|
|
test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
|
|
|
|
|
2010-03-14 20:46:38 +03:00
|
|
|
echo '% init --mq with nonexistent directory'
|
|
|
|
hg init --mq nonexistentdir
|
|
|
|
|
|
|
|
echo '% init --mq with bundle (non "local")'
|
|
|
|
hg -R a bundle --all a.bundle >/dev/null
|
|
|
|
hg init --mq a.bundle
|
|
|
|
|
2006-07-29 22:14:32 +04:00
|
|
|
cd a
|
|
|
|
|
|
|
|
hg qnew -m 'foo bar' test.patch
|
|
|
|
|
|
|
|
echo % qrefresh
|
|
|
|
|
|
|
|
echo a >> a
|
|
|
|
hg qrefresh
|
2006-08-09 23:05:40 +04:00
|
|
|
sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
|
2006-07-29 22:14:32 +04:00
|
|
|
-e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
|
|
|
|
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
|
|
|
|
|
2007-03-11 04:03:23 +03:00
|
|
|
echo % empty qrefresh
|
|
|
|
|
|
|
|
hg qrefresh -X a
|
|
|
|
echo 'revision:'
|
|
|
|
hg diff -r -2 -r -1
|
|
|
|
echo 'patch:'
|
|
|
|
cat .hg/patches/test.patch
|
|
|
|
echo 'working dir diff:'
|
|
|
|
hg diff --nodates -q
|
|
|
|
# restore things
|
|
|
|
hg qrefresh
|
2007-11-10 01:21:35 +03:00
|
|
|
checkundo qrefresh
|
2007-03-11 04:03:23 +03:00
|
|
|
|
2006-07-29 22:14:32 +04:00
|
|
|
echo % qpop
|
|
|
|
|
|
|
|
hg qpop
|
2007-11-10 01:21:35 +03:00
|
|
|
checkundo qpop
|
2006-07-29 22:14:32 +04:00
|
|
|
|
2009-07-16 18:39:42 +04:00
|
|
|
echo % qpush with dump of tag cache
|
2006-07-29 22:14:32 +04:00
|
|
|
|
2009-07-16 18:39:42 +04:00
|
|
|
# Dump the tag cache to ensure that it has exactly one head after qpush.
|
|
|
|
rm -f .hg/tags.cache
|
|
|
|
hg tags > /dev/null
|
|
|
|
echo ".hg/tags.cache (pre qpush):"
|
|
|
|
sed 's/ [0-9a-f]*//' .hg/tags.cache
|
2006-07-29 22:14:32 +04:00
|
|
|
hg qpush
|
2009-07-16 18:39:42 +04:00
|
|
|
hg tags > /dev/null
|
|
|
|
echo ".hg/tags.cache (post qpush):"
|
|
|
|
sed 's/ [0-9a-f]*//' .hg/tags.cache
|
|
|
|
|
2007-11-10 01:21:35 +03:00
|
|
|
checkundo qpush
|
2006-07-29 22:14:32 +04:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo % pop/push outside repo
|
|
|
|
|
|
|
|
hg -R a qpop
|
|
|
|
hg -R a qpush
|
|
|
|
|
|
|
|
cd a
|
|
|
|
hg qnew test2.patch
|
|
|
|
|
|
|
|
echo % qrefresh in subdir
|
|
|
|
|
|
|
|
cd b
|
|
|
|
echo a > a
|
|
|
|
hg add a
|
|
|
|
hg qrefresh
|
|
|
|
|
|
|
|
echo % pop/push -a in subdir
|
|
|
|
|
|
|
|
hg qpop -a
|
|
|
|
hg --traceback qpush -a
|
|
|
|
|
2010-06-07 17:33:03 +04:00
|
|
|
# setting columns & formatted tests truncating (issue1912)
|
2006-07-29 22:14:32 +04:00
|
|
|
echo % qseries
|
2010-06-07 17:33:03 +04:00
|
|
|
COLUMNS=4 hg qseries --config ui.formatted=true
|
|
|
|
COLUMNS=20 hg qseries --config ui.formatted=true -vs
|
2006-11-19 22:01:59 +03:00
|
|
|
hg qpop
|
|
|
|
hg qseries -vs
|
2010-05-07 23:14:41 +04:00
|
|
|
hg sum | grep mq
|
2006-11-19 22:01:59 +03:00
|
|
|
hg qpush
|
2010-05-07 23:14:41 +04:00
|
|
|
hg sum | grep mq
|
2006-07-29 22:14:32 +04:00
|
|
|
|
|
|
|
echo % qapplied
|
|
|
|
hg qapplied
|
|
|
|
|
2009-09-15 01:39:24 +04:00
|
|
|
echo % qtop
|
|
|
|
hg qtop
|
|
|
|
|
2009-08-19 14:50:46 +04:00
|
|
|
echo % prev
|
|
|
|
hg qapp -1
|
2006-07-29 22:14:32 +04:00
|
|
|
|
2009-08-19 14:50:46 +04:00
|
|
|
echo % next
|
|
|
|
hg qunapp -1
|
2006-07-29 22:14:32 +04:00
|
|
|
|
|
|
|
hg qpop
|
2006-08-11 02:02:18 +04:00
|
|
|
echo % commit should fail
|
|
|
|
hg commit
|
|
|
|
|
2006-08-11 03:10:59 +04:00
|
|
|
echo % push should fail
|
|
|
|
hg push ../../k
|
|
|
|
|
2008-10-19 00:22:29 +04:00
|
|
|
echo % import should fail
|
|
|
|
hg st .
|
|
|
|
echo foo >> ../a
|
|
|
|
hg diff > ../../import.diff
|
|
|
|
hg revert --no-backup ../a
|
|
|
|
hg import ../../import.diff
|
|
|
|
hg st
|
2009-11-16 22:31:08 +03:00
|
|
|
echo % import --no-commit should succeed
|
|
|
|
hg import --no-commit ../../import.diff
|
|
|
|
hg st
|
|
|
|
hg revert --no-backup ../a
|
2008-10-19 00:22:29 +04:00
|
|
|
|
2006-07-29 22:14:32 +04:00
|
|
|
echo % qunapplied
|
|
|
|
hg qunapplied
|
|
|
|
|
2006-09-12 19:26:20 +04:00
|
|
|
echo % qpush/qpop with index
|
|
|
|
hg qnew test1b.patch
|
|
|
|
echo 1b > 1b
|
|
|
|
hg add 1b
|
|
|
|
hg qrefresh
|
|
|
|
hg qpush 2
|
|
|
|
hg qpop 0
|
|
|
|
hg qpush test.patch+1
|
|
|
|
hg qpush test.patch+2
|
|
|
|
hg qpop test2.patch-1
|
|
|
|
hg qpop test2.patch-2
|
|
|
|
hg qpush test1b.patch+1
|
|
|
|
|
2010-04-30 17:05:51 +04:00
|
|
|
echo % qpush --move
|
|
|
|
hg qpop -a
|
|
|
|
hg qpush --move test2.patch # move to front
|
|
|
|
hg qpush --move test1b.patch
|
|
|
|
hg qpush --move test.patch # noop move
|
|
|
|
hg qseries -v
|
|
|
|
hg qpop -a
|
|
|
|
hg qpush --move test.patch # cleaning up
|
|
|
|
hg qpush --move test1b.patch
|
|
|
|
hg qpush --move bogus # nonexistent patch
|
|
|
|
hg qpush --move test.patch # already applied
|
|
|
|
hg qpush
|
|
|
|
|
2009-08-19 14:50:46 +04:00
|
|
|
echo % pop, qapplied, qunapplied
|
|
|
|
hg qseries -v
|
|
|
|
echo % qapplied -1 test.patch
|
|
|
|
hg qapplied -1 test.patch
|
|
|
|
echo % qapplied -1 test1b.patch
|
|
|
|
hg qapplied -1 test1b.patch
|
|
|
|
echo % qapplied -1 test2.patch
|
|
|
|
hg qapplied -1 test2.patch
|
|
|
|
echo % qapplied -1
|
|
|
|
hg qapplied -1
|
|
|
|
echo % qapplied
|
|
|
|
hg qapplied
|
|
|
|
echo % qapplied test1b.patch
|
|
|
|
hg qapplied test1b.patch
|
|
|
|
echo % qunapplied -1
|
|
|
|
hg qunapplied -1
|
|
|
|
echo % qunapplied
|
|
|
|
hg qunapplied
|
|
|
|
echo % popping
|
|
|
|
hg qpop
|
|
|
|
echo % qunapplied -1
|
|
|
|
hg qunapplied -1
|
|
|
|
echo % qunapplied
|
|
|
|
hg qunapplied
|
|
|
|
echo % qunapplied test2.patch
|
|
|
|
hg qunapplied test2.patch
|
|
|
|
echo % qunapplied -1 test2.patch
|
|
|
|
hg qunapplied -1 test2.patch
|
|
|
|
echo % popping -a
|
|
|
|
hg qpop -a
|
|
|
|
echo % qapplied
|
|
|
|
hg qapplied
|
|
|
|
echo % qapplied -1
|
|
|
|
hg qapplied -1
|
|
|
|
hg qpush
|
|
|
|
|
2006-08-11 03:10:59 +04:00
|
|
|
echo % push should succeed
|
|
|
|
hg qpop -a
|
|
|
|
hg push ../../k
|
|
|
|
|
2007-02-17 09:50:06 +03:00
|
|
|
echo % qpush/qpop error codes
|
|
|
|
errorcode()
|
|
|
|
{
|
|
|
|
hg "$@" && echo " $@ succeeds" || echo " $@ fails"
|
|
|
|
}
|
|
|
|
|
|
|
|
# we want to start with some patches applied
|
|
|
|
hg qpush -a
|
|
|
|
echo " % pops all patches and succeeds"
|
|
|
|
errorcode qpop -a
|
|
|
|
echo " % does nothing and succeeds"
|
|
|
|
errorcode qpop -a
|
|
|
|
echo " % fails - nothing else to pop"
|
|
|
|
errorcode qpop
|
|
|
|
echo " % pushes a patch and succeeds"
|
|
|
|
errorcode qpush
|
|
|
|
echo " % pops a patch and succeeds"
|
|
|
|
errorcode qpop
|
|
|
|
echo " % pushes up to test1b.patch and succeeds"
|
|
|
|
errorcode qpush test1b.patch
|
|
|
|
echo " % does nothing and succeeds"
|
|
|
|
errorcode qpush test1b.patch
|
|
|
|
echo " % does nothing and succeeds"
|
|
|
|
errorcode qpop test1b.patch
|
|
|
|
echo " % fails - can't push to this patch"
|
|
|
|
errorcode qpush test.patch
|
|
|
|
echo " % fails - can't pop to this patch"
|
|
|
|
errorcode qpop test2.patch
|
|
|
|
echo " % pops up to test.patch and succeeds"
|
|
|
|
errorcode qpop test.patch
|
|
|
|
echo " % pushes all patches and succeeds"
|
|
|
|
errorcode qpush -a
|
|
|
|
echo " % does nothing and succeeds"
|
|
|
|
errorcode qpush -a
|
|
|
|
echo " % fails - nothing else to push"
|
|
|
|
errorcode qpush
|
|
|
|
echo " % does nothing and succeeds"
|
|
|
|
errorcode qpush test2.patch
|
|
|
|
|
|
|
|
|
2006-07-29 22:14:32 +04:00
|
|
|
echo % strip
|
|
|
|
cd ../../b
|
|
|
|
echo x>x
|
|
|
|
hg ci -Ama
|
2010-05-20 21:15:44 +04:00
|
|
|
hg strip tip | hidebackup
|
2006-07-29 22:14:32 +04:00
|
|
|
hg unbundle .hg/strip-backup/*
|
2006-08-17 06:49:45 +04:00
|
|
|
|
2008-04-04 19:44:31 +04:00
|
|
|
echo % strip with local changes, should complain
|
|
|
|
hg up
|
|
|
|
echo y>y
|
|
|
|
hg add y
|
2010-05-20 21:15:44 +04:00
|
|
|
hg strip tip | hidebackup
|
2008-04-04 19:44:31 +04:00
|
|
|
echo % --force strip with local changes
|
2010-05-20 21:15:44 +04:00
|
|
|
hg strip -f tip | hidebackup
|
2008-04-04 19:44:31 +04:00
|
|
|
|
2006-08-30 04:08:55 +04:00
|
|
|
echo '% cd b; hg qrefresh'
|
|
|
|
hg init refresh
|
|
|
|
cd refresh
|
|
|
|
echo a > a
|
2009-04-26 16:29:02 +04:00
|
|
|
hg ci -Ama
|
2006-08-30 04:08:55 +04:00
|
|
|
hg qnew -mfoo foo
|
|
|
|
echo a >> a
|
|
|
|
hg qrefresh
|
|
|
|
mkdir b
|
|
|
|
cd b
|
|
|
|
echo f > f
|
|
|
|
hg add f
|
|
|
|
hg qrefresh
|
|
|
|
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
|
|
|
|
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
|
|
|
|
echo % hg qrefresh .
|
|
|
|
hg qrefresh .
|
|
|
|
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
|
|
|
|
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
|
|
|
|
hg status
|
|
|
|
|
2006-10-11 23:02:06 +04:00
|
|
|
echo % qpush failure
|
|
|
|
cd ..
|
|
|
|
hg qrefresh
|
|
|
|
hg qnew -mbar bar
|
|
|
|
echo foo > foo
|
2006-10-18 21:37:34 +04:00
|
|
|
echo bar > bar
|
|
|
|
hg add foo bar
|
2006-10-11 23:02:06 +04:00
|
|
|
hg qrefresh
|
|
|
|
hg qpop -a
|
|
|
|
echo bar > foo
|
|
|
|
hg qpush -a
|
2006-10-18 21:37:34 +04:00
|
|
|
hg st
|
2006-10-11 23:02:06 +04:00
|
|
|
|
2007-03-14 20:45:18 +03:00
|
|
|
echo % mq tags
|
|
|
|
hg log --template '{rev} {tags}\n' -r qparent:qtip
|
|
|
|
|
2008-02-04 02:03:46 +03:00
|
|
|
echo % bad node in status
|
|
|
|
hg qpop
|
|
|
|
hg strip -qn tip
|
|
|
|
hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
|
|
|
|
hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
|
2009-01-12 11:07:02 +03:00
|
|
|
hg qpop 2>&1 | sed -e 's/unknown node .*/unknown node/'
|
2008-02-04 02:03:46 +03:00
|
|
|
|
2006-08-22 12:08:42 +04:00
|
|
|
cat >>$HGRCPATH <<EOF
|
2006-08-17 06:49:45 +04:00
|
|
|
[diff]
|
|
|
|
git = True
|
|
|
|
EOF
|
|
|
|
cd ..
|
|
|
|
hg init git
|
|
|
|
cd git
|
|
|
|
hg qinit
|
|
|
|
|
|
|
|
hg qnew -m'new file' new
|
|
|
|
echo foo > new
|
|
|
|
chmod +x new
|
|
|
|
hg add new
|
|
|
|
hg qrefresh
|
2006-08-17 06:50:21 +04:00
|
|
|
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
|
|
|
|
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
|
2006-08-17 06:49:45 +04:00
|
|
|
|
|
|
|
hg qnew -m'copy file' copy
|
|
|
|
hg cp new copy
|
|
|
|
hg qrefresh
|
2006-08-17 06:50:21 +04:00
|
|
|
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
|
|
|
|
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
|
2006-08-17 06:49:45 +04:00
|
|
|
|
|
|
|
hg qpop
|
|
|
|
hg qpush
|
|
|
|
hg qdiff
|
2006-11-21 00:32:40 +03:00
|
|
|
cat >>$HGRCPATH <<EOF
|
|
|
|
[diff]
|
|
|
|
git = False
|
|
|
|
EOF
|
|
|
|
hg qdiff --git
|
2006-11-21 00:32:42 +03:00
|
|
|
cd ..
|
2009-12-29 18:00:24 +03:00
|
|
|
|
|
|
|
echo % test file addition in slow path
|
2006-11-21 00:32:42 +03:00
|
|
|
hg init slow
|
|
|
|
cd slow
|
|
|
|
hg qinit
|
|
|
|
echo foo > foo
|
|
|
|
hg add foo
|
|
|
|
hg ci -m 'add foo'
|
|
|
|
hg qnew bar
|
|
|
|
echo bar > bar
|
|
|
|
hg add bar
|
|
|
|
hg mv foo baz
|
|
|
|
hg qrefresh --git
|
|
|
|
hg up -C 0
|
|
|
|
echo >> foo
|
|
|
|
hg ci -m 'change foo'
|
|
|
|
hg up -C 1
|
|
|
|
hg qrefresh --git 2>&1 | grep -v 'saving bundle'
|
|
|
|
cat .hg/patches/bar
|
2009-12-13 20:06:24 +03:00
|
|
|
hg log -v --template '{rev} {file_copies}\n' -r .
|
2006-11-21 00:32:43 +03:00
|
|
|
hg qrefresh --git
|
|
|
|
cat .hg/patches/bar
|
2009-12-13 20:06:24 +03:00
|
|
|
hg log -v --template '{rev} {file_copies}\n' -r .
|
2007-07-17 03:50:47 +04:00
|
|
|
hg qrefresh
|
|
|
|
grep 'diff --git' .hg/patches/bar
|
2006-11-21 00:32:42 +03:00
|
|
|
|
2009-12-29 18:00:24 +03:00
|
|
|
echo % test file move chains in the slow path
|
2006-11-21 00:32:42 +03:00
|
|
|
hg up -C 1
|
|
|
|
echo >> foo
|
|
|
|
hg ci -m 'change foo again'
|
|
|
|
hg up -C 2
|
|
|
|
hg mv bar quux
|
|
|
|
hg mv baz bleh
|
|
|
|
hg qrefresh --git 2>&1 | grep -v 'saving bundle'
|
|
|
|
cat .hg/patches/bar
|
2009-12-13 20:06:24 +03:00
|
|
|
hg log -v --template '{rev} {file_copies}\n' -r .
|
2006-11-21 00:32:43 +03:00
|
|
|
hg mv quux fred
|
|
|
|
hg mv bleh barney
|
|
|
|
hg qrefresh --git
|
|
|
|
cat .hg/patches/bar
|
2009-12-13 20:06:24 +03:00
|
|
|
hg log -v --template '{rev} {file_copies}\n' -r .
|
2007-02-06 20:54:58 +03:00
|
|
|
|
2007-09-11 02:00:05 +04:00
|
|
|
echo % refresh omitting an added file
|
|
|
|
hg qnew baz
|
|
|
|
echo newfile > newfile
|
|
|
|
hg add newfile
|
|
|
|
hg qrefresh
|
|
|
|
hg st -A newfile
|
|
|
|
hg qrefresh -X newfile
|
|
|
|
hg st -A newfile
|
|
|
|
hg revert newfile
|
|
|
|
rm newfile
|
|
|
|
hg qpop
|
|
|
|
hg qdel baz
|
|
|
|
|
2007-07-28 22:15:54 +04:00
|
|
|
echo % create a git patch
|
|
|
|
echo a > alexander
|
|
|
|
hg add alexander
|
|
|
|
hg qnew -f --git addalexander
|
2007-07-29 20:53:09 +04:00
|
|
|
grep diff .hg/patches/addalexander
|
2007-07-28 22:15:54 +04:00
|
|
|
|
|
|
|
echo % create a git binary patch
|
|
|
|
cat > writebin.py <<EOF
|
|
|
|
import sys
|
|
|
|
path = sys.argv[1]
|
|
|
|
open(path, 'wb').write('BIN\x00ARY')
|
|
|
|
EOF
|
|
|
|
python writebin.py bucephalus
|
|
|
|
|
|
|
|
python "$TESTDIR/md5sum.py" bucephalus
|
|
|
|
hg add bucephalus
|
|
|
|
hg qnew -f --git addbucephalus
|
2007-07-29 20:53:09 +04:00
|
|
|
grep diff .hg/patches/addbucephalus
|
2007-07-28 22:15:54 +04:00
|
|
|
|
|
|
|
echo % check binary patches can be popped and pushed
|
|
|
|
hg qpop
|
2007-07-29 20:53:09 +04:00
|
|
|
test -f bucephalus && echo % bucephalus should not be there
|
2007-07-28 22:15:54 +04:00
|
|
|
hg qpush
|
|
|
|
test -f bucephalus || echo % bucephalus should be there
|
|
|
|
python "$TESTDIR/md5sum.py" bucephalus
|
|
|
|
|
|
|
|
|
2007-02-06 20:54:58 +03:00
|
|
|
echo '% strip again'
|
|
|
|
cd ..
|
|
|
|
hg init strip
|
|
|
|
cd strip
|
|
|
|
touch foo
|
|
|
|
hg add foo
|
2009-04-26 16:29:02 +04:00
|
|
|
hg ci -m 'add foo'
|
2007-02-06 20:54:58 +03:00
|
|
|
echo >> foo
|
2009-04-26 16:29:02 +04:00
|
|
|
hg ci -m 'change foo 1'
|
2007-02-06 20:54:58 +03:00
|
|
|
hg up -C 0
|
|
|
|
echo 1 >> foo
|
2009-04-26 16:29:02 +04:00
|
|
|
hg ci -m 'change foo 2'
|
2007-02-06 20:54:58 +03:00
|
|
|
HGMERGE=true hg merge
|
2009-04-26 16:29:02 +04:00
|
|
|
hg ci -m merge
|
2007-02-06 20:54:58 +03:00
|
|
|
hg log
|
2010-05-20 21:15:44 +04:00
|
|
|
hg strip 1 | hidebackup
|
2007-11-10 01:21:35 +03:00
|
|
|
checkundo strip
|
2007-02-06 20:54:58 +03:00
|
|
|
hg log
|
2007-02-15 13:44:08 +03:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo '% qclone'
|
|
|
|
qlog()
|
|
|
|
{
|
|
|
|
echo 'main repo:'
|
|
|
|
hg log --template ' rev {rev}: {desc}\n'
|
|
|
|
echo 'patch repo:'
|
|
|
|
hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
|
|
|
|
}
|
|
|
|
hg init qclonesource
|
|
|
|
cd qclonesource
|
|
|
|
echo foo > foo
|
|
|
|
hg add foo
|
|
|
|
hg ci -m 'add foo'
|
2007-07-10 20:52:32 +04:00
|
|
|
hg qinit
|
2007-02-15 13:44:08 +03:00
|
|
|
hg qnew patch1
|
|
|
|
echo bar >> foo
|
|
|
|
hg qrefresh -m 'change foo'
|
2007-07-10 20:52:32 +04:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# repo with unversioned patch dir
|
|
|
|
hg qclone qclonesource failure
|
|
|
|
|
|
|
|
cd qclonesource
|
|
|
|
hg qinit -c
|
2007-02-15 13:44:08 +03:00
|
|
|
hg qci -m checkpoint
|
|
|
|
qlog
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# repo with patches applied
|
|
|
|
hg qclone qclonesource qclonedest
|
|
|
|
cd qclonedest
|
|
|
|
qlog
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# repo with patches unapplied
|
|
|
|
cd qclonesource
|
|
|
|
hg qpop -a
|
|
|
|
qlog
|
|
|
|
cd ..
|
|
|
|
hg qclone qclonesource qclonedest2
|
|
|
|
cd qclonedest2
|
|
|
|
qlog
|
|
|
|
cd ..
|
2007-02-06 20:54:58 +03:00
|
|
|
|
2008-03-16 02:35:12 +03:00
|
|
|
echo % 'test applying on an empty file (issue 1033)'
|
|
|
|
hg init empty
|
|
|
|
cd empty
|
|
|
|
touch a
|
|
|
|
hg ci -Am addempty
|
|
|
|
echo a > a
|
|
|
|
hg qnew -f -e changea
|
|
|
|
hg qpop
|
|
|
|
hg qpush
|
|
|
|
cd ..
|
2008-04-16 18:04:07 +04:00
|
|
|
|
|
|
|
echo % test qpush with --force, issue1087
|
|
|
|
hg init forcepush
|
|
|
|
cd forcepush
|
|
|
|
echo hello > hello.txt
|
|
|
|
echo bye > bye.txt
|
|
|
|
hg ci -Ama
|
|
|
|
hg qnew -d '0 0' empty
|
|
|
|
hg qpop
|
|
|
|
echo world >> hello.txt
|
|
|
|
|
|
|
|
echo % qpush should fail, local changes
|
|
|
|
hg qpush
|
|
|
|
|
|
|
|
echo % apply force, should not discard changes with empty patch
|
2008-09-18 15:45:36 +04:00
|
|
|
hg qpush -f 2>&1 | sed 's,^.*/patch,patch,g'
|
2008-04-16 18:04:07 +04:00
|
|
|
hg diff --config diff.nodates=True
|
|
|
|
hg qdiff --config diff.nodates=True
|
|
|
|
hg log -l1 -p
|
|
|
|
hg qref -d '0 0'
|
|
|
|
hg qpop
|
|
|
|
echo universe >> hello.txt
|
|
|
|
echo universe >> bye.txt
|
|
|
|
|
|
|
|
echo % qpush should fail, local changes
|
|
|
|
hg qpush
|
|
|
|
|
|
|
|
echo % apply force, should discard changes in hello, but not bye
|
|
|
|
hg qpush -f
|
|
|
|
hg st
|
|
|
|
hg diff --config diff.nodates=True
|
|
|
|
hg qdiff --config diff.nodates=True
|
2009-01-12 11:07:02 +03:00
|
|
|
|
|
|
|
echo % test popping revisions not in working dir ancestry
|
|
|
|
hg qseries -v
|
|
|
|
hg up qparent
|
|
|
|
hg qpop
|
2009-12-11 09:09:52 +03:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
hg init deletion-order
|
|
|
|
cd deletion-order
|
|
|
|
|
|
|
|
touch a
|
|
|
|
hg ci -Aqm0
|
|
|
|
|
|
|
|
hg qnew rename-dir
|
|
|
|
hg rm a
|
|
|
|
hg qrefresh
|
|
|
|
|
|
|
|
mkdir a b
|
|
|
|
touch a/a b/b
|
|
|
|
hg add -q a b
|
|
|
|
hg qrefresh
|
|
|
|
|
|
|
|
echo % test popping must remove files added in subdirectories first
|
|
|
|
hg qpop
|
|
|
|
cd ..
|