keyword: set overwrite message only once, not for each file
[ original upstream message ]
%helpkeywordextension-keywordexpansioninlocalrepositoriesThisextensionexpandsRCS/CVS-likeorself-customized$Keywords$intrackedtextfilesselectedbyyourconfiguration.Keywordsareonlyexpandedinlocalrepositoriesandnotstoredinthechangehistory.Themechanismcanberegardedasaconvenienceforthecurrentuserorforarchivedistribution.Configurationisdoneinthe[keyword]and[keywordmaps]sectionsofhgrcfiles.Example:[keyword]#expandkeywordsineverypythonfileexceptthosematching"x*"**.py=x*=ignoreNote:themorespecificyouareinyourfilenamepatternsthelessyoulosespeedinhugerepositories.For[keywordmaps]templatemappingandexpansiondemonstrationandcontrolrun"hg kwdemo".Anadditionaldatetemplatefilter{date|utcdate}isprovided.Thedefaulttemplatemappings(viewwith"hg kwdemo -d")canbereplacedwithcustomizedkeywordsandtemplates.Again,run"hgkwdemo"tocontroltheresultsofyourconfigchanges.Beforechanging/disablingactivekeywords,run"hg kwshrink"toavoidtheriskofinadvertedlystoringexpandedkeywordsinthechangehistory.Toforceexpansionafterenablingit,oraconfigurationchange,run"hg kwexpand".Also,whencommittingwiththerecordextensionorusingmq's qrecord,be aware that keywords cannot be updated. Again, run "hg kwexpand" onthe files in question to update keyword expansions after all changeshave been checked in.Expansions spanning more than one line and incremental expansions,like CVS'$Log$,arenotsupported.Akeywordtemplatemap"Log = {desc}"expandstothefirstlineofthechangesetdescription.listofcommands:kwdemoprint[keywordmaps]configurationandanexpansionexamplekwexpandexpandkeywordsinworkingdirectorykwfilesprintfilescurrentlyconfiguredforkeywordexpansionkwshrinkrevertexpandedkeywordsinworkingdirectoryenabledextensions:keywordkeywordexpansioninlocalrepositoriesmqpatchmanagementanddevelopmentnotifyhookextensiontoemailnotificationsoncommits/pushesuse"hg -v help keyword"toshowaliasesandglobaloptions%hgkwdemo[extensions]hgext.keyword=[keyword]*=b=ignoredemo.txt=[keywordmaps]RCSFile={file|basename},vAuthor={author|user}Header={root}/{file},v{node|short}{date|utcdate}{author|user}Source={root}/{file},vDate={date|utcdate}Id={file|basename},v{node|short}{date|utcdate}{author|user}Revision={node|short}$RCSFile:demo.txt,v$$Author:test$$Header:/TMP/demo.txt,vxxxxxxxxxxxx2000/00/0000:00:00test$$Source:/TMP/demo.txt,v$$Date:2000/00/0000:00:00$$Id:demo.txt,vxxxxxxxxxxxx2000/00/0000:00:00test$$Revision:xxxxxxxxxxxx$[extensions]hgext.keyword=[keyword]*=b=ignoredemo.txt=[keywordmaps]Branch={branches}$Branch:demobranch$%kwshrinkshouldexitsilentlyinempty/invalidrepopullingfromtest-keyword.hgrequestingallchangesaddingchangesetsaddingmanifestsaddingfilechangesadded1changesetswith1changesto1files1filesupdated,0filesmerged,0filesremoved,0filesunresolved%catexpand$Id$donotprocess$Id:xxx$ignore$Id$%addremoveaddingaaddingb%statusAaAb%defaultkeywordexpansionincludingcommithook%interruptedcommitshouldnotchangestateorruncommithookabtransactionabort!rollbackcompletedabort:emptycommitmessage%statusAaAb%commitaboverwritingaexpandingkeywordsrunninghookcommit.test:cpahooktestcommittedchangeset1:ef63ca68695bc9495032c6fda1350c71e6d256e9%status?hooktest%identifyef63ca68695b%catexpand$Id:a,vef63ca68695b1970/01/0100:00:00user$donotprocess$Id:xxx$ignore$Id$%hgcatexpand$Id:a,vef63ca68695b1970/01/0100:00:00user$donotprocess$Id:xxx$ignore$Id$a%diffahooktest%removingcommithookfromconfig%bundle2changesetsfound%notifyonpulltocheckwhetherkeywordsstayasisinemail%ie.ifpatch.diffwrapperactsasitshould%pullfrombundlepullingfrom../kw.hgrequestingallchangesaddingchangesetsaddingmanifestsaddingfilechangesadded2changesetswith3changesto3filesdiff-r000000000000-ra2392c293916sym---/dev/nullThuJan0100:00:001970+0000+++b/symSatFeb0920:25:472008+0100@@-0,0+1,1@@+a\Nonewlineatendoffilediff-ra2392c293916-ref63ca68695ba---/dev/nullThuJan0100:00:001970+0000+++b/aThuJan0100:00:001970+0000@@-0,0+1,3@@+expand$Id$+donotprocess$Id:+xxx$diff-ra2392c293916-ref63ca68695bb---/dev/nullThuJan0100:00:001970+0000+++b/bThuJan0100:00:001970+0000@@-0,0+1,1@@+ignore$Id$3filesupdated,0filesmerged,0filesremoved,0filesunresolved%removenotifyconfig%touch%status%update3filesupdated,0filesmerged,0filesremoved,0filesunresolved%catexpand$Id:a,vef63ca68695b1970/01/0100:00:00user$donotprocess$Id:xxx$ignore$Id$%checkwhetherexpansionisfilewise%commitcaddingc%forceexpansionoverwritingaexpandingkeywordsoverwritingcexpandingkeywords%comparechangenodesinacexpand$Id:a,vef63ca68695b1970/01/0100:00:00user$donotprocess$Id:xxx$$Id:c,v40a904bbbe4c1970/01/0100:00:01user$testsfordifferentchangenodes%qinit-c%qimport%qcommit%keywordsshouldnotbeexpandedinpatch#HGchangesetpatch#UserUserName<user@example.com>#Date10#NodeID40a904bbbe4cd4ab0a1f28411e35db26341a40ad#Parentef63ca68695bc9495032c6fda1350c71e6d256e9cndiffdiff-ref63ca68695b-r40a904bbbe4cc---/dev/nullThuJan0100:00:001970+0000+++b/cThuJan0100:00:011970+0000@@-0,0+1,2@@+$Id$+testsfordifferentchangenodes%qpoppatchqueuenowempty%qgoto-shouldimplyqpushapplyingmqtest.diffnowat:mqtest.diff%cat$Id:c,v40a904bbbe4c1970/01/0100:00:01user$testsfordifferentchangenodes%qpopandmoveonpatchqueuenowempty%copy%kwfilesaddedac%commitcc:copya:0045e12f6c5791aac80ca6cbfd97709a88307292overwritingcexpandingkeywordscommittedchangeset2:e22d299ac0c2bd8897b3df5114374b9e4d4ca62f%catacexpand$Id:a,vef63ca68695b1970/01/0100:00:00user$donotprocess$Id:xxx$expand$Id:c,ve22d299ac0c21970/01/0100:00:01user$donotprocess$Id:xxx$%touchcopiedc%status%kwfilesac%diff--revdiff-ref63ca68695bc---/dev/nullThuJan0100:00:001970+0000@@-0,0+1,3@@+expand$Id$+donotprocess$Id:+xxx$%rollbackrollingbacklasttransaction%statusAc%update-C0filesupdated,0filesmerged,1filesremoved,0filesunresolved%customkeywordexpansion%trywithkwdemo[extensions]hgext.keyword=[keyword]*=b=ignoredemo.txt=[keywordmaps]Xinfo={author}:{desc}$Xinfo:test:hgkeywordconfigandexpansionexample$%catexpand$Id:a,vef63ca68695b1970/01/0100:00:00user$donotprocess$Id:xxx$ignore$Id$%hgcatexpand$Id:aef63ca68695bThu,01Jan197000:00:00+0000user$donotprocess$Id:xxx$ignore$Id$a%interruptedcommitshouldnotchangestatetransactionabort!rollbackcompletedabort:emptycommitmessage%statusMa?log%commitaoverwritingaexpandingkeywordscommittedchangeset2:bb948857c743469b22bbf51f7ec8112279ca5d83%status%verifycheckingchangesetscheckingmanifestscrosscheckingfilesinchangesetsandmanifestscheckingfiles3files,3changesets,4totalrevisions%catexpand$Id:abb948857c743Thu,01Jan197000:00:02+0000user$donotprocess$Id:xxx$$Xinfo:UserName<user@example.com>:firstline$ignore$Id$%hgcatexpand$Id:abb948857c743Thu,01Jan197000:00:02+0000user$donotprocess$Id:xxx$$Xinfo:UserName<user@example.com>:firstline$ignore$Id$a%annotate1:expand$Id$1:donotprocess$Id:1:xxx$2:$Xinfo$%removecommittedchangeset3:d14c712653769de926994cf7fbb06c8fbd68f012%status%rollbackrollingbacklasttransaction%statusRa%reverta%cataexpand$Id:abb948857c743Thu,01Jan197000:00:02+0000user$donotprocess$Id:xxx$$Xinfo:UserName<user@example.com>:firstline$%clonetotestincomingrequestingallchangesaddingchangesetsaddingmanifestsaddingfilechangesadded2changesetswith3changesto3filesupdatingworkingdirectory3filesupdated,0filesmerged,0filesremoved,0filesunresolved%incomingcomparingwithtest-keyword/Testsearchingforchangeschangeset:2:bb948857c743tag:tipuser:UserName<user@example.com>date:ThuJan0100:00:021970+0000summary:firstline%commitrejecttestaoverwritingaexpandingkeywordscommittedchangeset2:85e279d709ffc28c9fdd1b868570985fc3d87082%export%importapplying../rejecttest.diff%catexpand$Id:a4e0994474d25Thu,01Jan197000:00:03+0000user$rejecttestdonotprocess$Id:rejecttestxxx$$Xinfo:UserName<user@example.com>:rejects?$ignore$Id$%rollbackrollingbacklasttransaction%cleanupdate1filesupdated,0filesmerged,0filesremoved,0filesunresolved%kwexpand/kwshrinkonselectedfiles%copyax/a%kwexpandaoverwritingaexpandingkeywords%kwexpandx/ashouldabortabort:outstandinguncommittedchangesx/ax/a:copya:779c764182ce5d43e2b1eb66ce06d7b47bfe342eoverwritingx/aexpandingkeywordscommittedchangeset3:cfa68229c1167443337266ebac453c73b1d5d16e%cataexpand$Id:x/acfa68229c116Thu,01Jan197000:00:03+0000user$donotprocess$Id:xxx$$Xinfo:UserName<user@example.com>:xa$%kwshrinkainsidedirectoryxoverwritingx/ashrinkingkeywords%cataexpand$Id$donotprocess$Id:xxx$$Xinfo$%kwexpandnonexistentnonexistent:%hgserve%expansion%hgwebfile200Scriptoutputfollowsexpand$Id:abb948857c743Thu,01Jan197000:00:02+0000user$donotprocess$Id:xxx$$Xinfo:UserName<user@example.com>:firstline$%noexpansion%hgwebannotate200Scriptoutputfollowsuser@1:expand$Id$user@1:donotprocess$Id:user@1:xxx$user@2:$Xinfo$%hgwebchangeset200Scriptoutputfollows#HGchangesetpatch#UserUserName<user@example.com>#Date30#NodeIDcfa68229c1167443337266ebac453c73b1d5d16e#Parentbb948857c743469b22bbf51f7ec8112279ca5d83xa---/dev/nullThuJan0100:00:001970+0000+++b/x/aThuJan0100:00:031970+0000@@-0,0+1,4@@+expand$Id$+donotprocess$Id:+xxx$+$Xinfo$%hgwebfilediff200Scriptoutputfollows---a/aThuJan0100:00:001970+0000+++b/aThuJan0100:00:021970+0000@@-1,3+1,4@@expand$Id$donotprocess$Id:xxx$+$Xinfo$%errorsencountered%merge/resolve%simplemerge1filesupdated,0filesmerged,0filesremoved,0filesunresolvedcreatednewhead0filesupdated,0filesmerged,0filesremoved,0filesunresolved(branchmerge,don't forget to commit)$Id: m 8731e1dadc99 Thu, 01 Jan 1970 00:00:00 +0000 test $foo% conflict1 files updated, 0 files merged, 0 files removed, 0 files unresolvedcreated new headmerging mwarning: conflicts during merge.merging m failed!0 files updated, 0 files merged, 0 files removed, 1 files unresolveduse 'hgresolve' to retry unresolved file merges or 'hgup--clean'toabandon%keywordstaysoutsideconflictzone$Id$<<<<<<<localbar=======foo>>>>>>>other%resolvetolocal$Id:m43dfd2854b5bThu,01Jan197000:00:00+0000test$bar%switchoffexpansion%kwshrinkwithunknownfileuoverwritingashrinkingkeywordsoverwritingmshrinkingkeywordsoverwritingx/ashrinkingkeywords%catexpand$Id$donotprocess$Id:xxx$$Xinfo$ignore$Id$%hgcatexpand$Id:abb948857c743Thu,01Jan197000:00:02+0000user$donotprocess$Id:xxx$$Xinfo:UserName<user@example.com>:firstline$ignore$Id$a%catexpand$Id$donotprocess$Id:xxx$$Xinfo$ignore$Id$%hgcatexpand$Id$donotprocess$Id:xxx$$Xinfo$ignore$Id$a