tests/test-mq-safety
author Edouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 02:36:48 +0100
changeset 7583 77fec2d270ae
parent 5980 dcda0c90125c
child 8523 5b7da468531b
permissions -rwxr-xr-x
convert/gnuarch: parse continuation-of revisions in gnuarch source In GNU Arch, continuation-of was often used for: - tagging revisions - continue working on a project in a new archive, because arch was scaling poorly in revision numbers (cat-logs were slow to be parsed and scanned through) - very similar to the previous point, fork his own branch of a project. Parsing this header information will allow to 'follow' new history because it often hints at older/forked/personal revision trees. This patch however just implements the parsing of the continuation-of header. A followup patch will implement the proper use of this new information.

#!/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'