(0.9.2compat) add merge, resolve to restricted
This is not really backwards compatible (test only as comment)
and doesn't prevent extra conflicts with older Hg versions.
On the other hand it doesn't do any damage either and provides
the 3-way merge ease if possible.
#!/bin/shcat<<EOF >> $HGRCPATH[extensions]hgext.keyword =hgext.mq =[keyword]* =b = ignore[hooks]commit=commit.test=cp a hooktestEOFecho%help# grep for backwards compatibilityhghelpkeyword\|grep-E-v'^list of commands|hg -v help keyword|^$'echo%hgkwdemohg--quietkwdemo--default\|sed-e's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!'\-e's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /'\-e'/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /'\-e's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!'hg--quietkwdemo"Branch = {branches}"hginitTest-bndlcdTest-bndlecho%kwshrinkshouldexitsilentlyinempty/invalidrepohgkwshrink# Symlinks cannot be created on Windows. The bundle was made with:## hg init t# cd t# echo a > a# ln -s a sym# hg add sym# hg ci -m addsym -u mercurial# hg bundle --base null ../test-keyword.hg#hgpull-u"$TESTDIR/test-keyword.hg"\|sed's/pulling from.*test-keyword.hg/pulling from test-keyword.hg/'echo'expand $Id$'>aecho'do not process $Id:'>>aecho'xxx $'>>aecho'ignore $Id$'>becho%catcatabecho%addremovehgaddremoveecho%statushgstatusecho%defaultkeywordexpansionincludingcommithook#echo % interrupted commit should not change state or run commit hook#hg --debug commit#echo % status#hg statusecho%commithg--debugcommit-mab-d'0 0'-u'User Name <user@example.com>'echo%statushgstatusecho%identifyhgdebugrebuildstatehg--quietidentifyecho%catcatabecho%hgcathgcatabechoecho%diffahooktestdiffahooktestecho%removingcommithookfromconfigsed-e'/\[hooks\]/,$ d'$HGRCPATH>$HGRCPATH.nohookmv$HGRCPATH.nohook$HGRCPATHrmhooktestecho%bundlehg--quietbundle--basenull../kw.hgcd..hginitTestcdTestecho%pullfrombundlehgpull-u../kw.hgecho%touchtouchabecho%statushgstatusrmabecho%updatehgupdateecho%catcatabecho%checkwhetherexpansionisfilewiseecho'$Id$'>cecho'tests for different changenodes'>>cecho%commitchgcommit-A-mcndiff-d'1 0'-u'User Name <user@example.com>'echo%forceexpansionhg-vkwexpandecho%comparechangenodesinaccatacecho%qinit-chgqinit-cecho%qimporthgqimport-rtip-nmqtest.diffecho%qcommithgqcommit-mqtestecho%keywordsshouldnotbeexpandedinpatchcat.hg/patches/mqtest.diffecho%qpophgqpopecho%qpushhgqpushecho%catcatcecho%qpopandmoveonhgqpopecho%copyhgcpacecho%kwfilesaddedhgkwfilesecho%commithg--debugcommit-ma2c-d'1 0'-u'User Name <user@example.com>'echo%cataccatacecho%touchcopiedcafter1secondsleep1touchcecho%statushgstatusecho%kwfileshgkwfilesecho%diff--revhgdiff--rev1|grep-v'b/c'echo%rollbackhgrollbackecho%statushgstatusecho%update-Chgupdate--cleanecho%customkeywordexpansionecho%trywithkwdemohg--quietkwdemo"Xinfo = {author}: {desc}"cat<<EOF >>$HGRCPATH[keywordmaps]Id = {file} {node|short} {date|rfc822date} {author|user}Xinfo = {author}: {desc}EOFecho%catcatabecho%hgcathgcatabecho'$Xinfo$'>>acat<<EOF >> logfirstlinesecondlineEOF#echo % interrupted commit should not change state#hg commit#echo % status#hg statusecho%commithg--debugcommit-llog-d'2 0'-u'User Name <user@example.com>'rmlogecho%statushgstatusecho%verifyhgverifyecho%catcatabecho%hgcathgcatsymabechoecho%annotatehgannotateaecho%removehgdebugrebuildstatehgremoveahg--debugcommit-mrmaecho%statushgstatusecho%rollbackhgrollbackecho%statushgstatusecho%revertahgrevert--no-backup--revtipaecho%catacataecho%clonetotestincomingcd..# remove updating status for backwards compatibilityhgclone-r1TestTest-a|grep-v'working directory'cdTest-acat<<EOF >> .hg/hgrc[paths]default = ../TestEOFecho%incoming# remove path to temp dir for backwards compatibilityhgincoming|grep-v'^comparing with'#sed -e 's/Id.*/& rejecttest/' a > a.new#mv a.new a#echo % commit rejecttest#hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'#echo % export#hg export -o ../rejecttest.diff tipcd../Test#echo % import#hg import ../rejecttest.diff#echo % cat#cat a b#echo % rollback#hg rollback#echo % clean update#hg update --cleanecho%kwexpand/kwshrinkonselectedfilesmkdirxecho%copyax/ahgcopyax/aecho%kwexpandahg--verbosekwexpandaecho%kwexpandx/ashouldaborthg--verbosekwexpandx/acdxhg--debugcommit-mxa-d'3 0'-u'User Name <user@example.com>'echo%catacataecho%kwshrinkainsidedirectoryxhg--verbosekwshrinkaecho%catacatacd..echo%kwexpandnonexistenthgkwexpandnonexistent2>&1|sed's/nonexistent:.*/nonexistent:/'#echo % hg serve#hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log#cat hg.pid >> $DAEMON_PIDS#echo % expansion#echo % hgweb file#("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw')#echo % no expansion#echo % hgweb annotate#("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw')#echo % hgweb changeset#("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw')#echo % hgweb filediff#("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw')#echo % errors encountered#cat errors.log#echo % merge/resolve#echo '$Id$' > m#hg add m#hg commit -m 4kw #echo foo >> m#hg commit -m 5foo#echo % simplemerge#hg update 4#echo foo >> m#hg commit -m 6foo#hg merge#hg commit -m simplemerge#cat m#echo % conflict#hg update 4#echo bar >> m#hg commit -m 8bar#hg merge#echo % keyword stays outside conflict zone#cat m#echo % resolve to local#HGMERGE=internal:local hg resolve#hg commit -m localresolve#cat mecho%switchoffexpansionecho%kwshrinkwithunknownfileucpauhg--verbosekwshrinkecho%catcatabecho%hgcathgcatabrm$HGRCPATHecho%catcatabecho%hgcathgcatab