safeguard: check auto-publish value before sending listkeys command
Always sending listkeys command is just wasteful, let's first make sure users
even care about auto-publish behavior.
Testforthegrabcommand$cat>>$HGRCPATH<<EOF>[alias]>glog=log-G-T"{rev}:{node|short}{desc}\n">[extensions]>EOF$echo"evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/">>$HGRCPATH$mkcommit(){>echo"$1">"$1">hgadd"$1">hgci-m"add $1">}$hginitrepo$cdrepo$hghelpgrabhgpick[-r]revaliases:grabmoveacommitonthetopofworkingdirectoryparentandupdatestoit.options:-r--revREVrevisiontopick-c--continuecontinueinterruptedpick-a--abortabortinterruptedpick(somedetailshidden,use--verbosetoshowcompletehelp)$mkcommita$mkcommitb$mkcommitc$hgglog@2:4538525df7e2addc|o1:7c3bad9141dcaddb|o0:1f0dee641bb7addaGrabbinganancestor$hgpick-r7c3bad9141dcabort:cannotpickanancestorrevision[255]Grabbingtheworkingdirectoryparent$hgpick-r.abort:cannotpickanancestorrevision[255]Specifyingmultiplerevisionstograb$hgpick1f0dee641bb7-r7c3bad9141dcabort:specifyjustonerevision[255]Specifyingnorevisionstograb$hgpickabort:emptyrevisionset[255]Continuingwithoutinterruptedgrab$hgpick--continueabort:nointerruptedpickstateexists[255]Abortingwithoutinterruptedgrab$hgpick--abortabort:nointerruptedpickstateexists[255]Specifyingbothcontinueandrevs$hgup1f0dee641bb70filesupdated,0filesmerged,2filesremoved,0filesunresolved$hgpick-r4538525df7e2--continueabort:cannotspecifyboth--continueandrevision[255]Makingnewbranchheads$mkcommitxcreatednewhead$mkcommity$hgglog@4:d46dc301d92faddy|o3:8e224524cd09addx||o2:4538525df7e2addc|||o1:7c3bad9141dcaddb|/o0:1f0dee641bb7addaGrabbingarevision$hgpick7c3bad9141dcpicking1:7c3bad9141dc"add b"1neworphanchangesets$hgglog@5:7c15c05db6faaddb|o4:d46dc301d92faddy|o3:8e224524cd09addx||*2:4538525df7e2addc|||x1:7c3bad9141dcaddb|/o0:1f0dee641bb7addaWhengrabdoesnotcreateanychanges$hggraft-r4538525df7e2grafting2:4538525df7e2"add c"$hgglog@6:c4636a81ebebaddc|o5:7c15c05db6faaddb|o4:d46dc301d92faddy|o3:8e224524cd09addx||*2:4538525df7e2addc|||x1:7c3bad9141dcaddb|/o0:1f0dee641bb7adda$hgpick-r4538525df7e2picking2:4538525df7e2"add c"note:picking2:4538525df7e2creatednochangestocommit$hgglog@6:c4636a81ebebaddc|o5:7c15c05db6faaddb|o4:d46dc301d92faddy|o3:8e224524cd09addx|o0:1f0dee641bb7addainterruptedgrab$hgupd46dc301d92f0filesupdated,0filesmerged,2filesremoved,0filesunresolved$echofoo>c$hgci-Aqm"foo to c"$hgpick-rc4636a81ebebpicking6:c4636a81ebeb"add c"mergingcwarning:conflictswhilemergingc!(edit,thenuse'hg resolve --mark')unresolvedmergeconflicts(seehghelpresolve)[1]$echofoobar>c$hgresolve--all--mark(nomoreunresolvedfiles)continue:hgpick--continue$hgpick--continue$hgglog@8:44e155eb95c7addc|o7:2ccc03d1d096footoc||o5:7c15c05db6faaddb|/o4:d46dc301d92faddy|o3:8e224524cd09addx|o0:1f0dee641bb7addaWheninterruptedgrabresultsinnochangestocommit$hgupd46dc301d92f0filesupdated,0filesmerged,1filesremoved,0filesunresolved$echobar>c$hgaddc$hgci-m"foo to c"creatednewhead$hgup44e155eb95c71filesupdated,0filesmerged,0filesremoved,0filesunresolved$hgpick4e04628911f6picking9:4e04628911f6"foo to c"mergingcwarning:conflictswhilemergingc!(edit,thenuse'hg resolve --mark')unresolvedmergeconflicts(seehghelpresolve)[1]$echofoobar>c$hgresolve-m(nomoreunresolvedfiles)continue:hgpick--continue$hgpick--continuenote:picking9:4e04628911f6creatednochangestocommitTestingtheabortfunctionalityofhgpick$echofoo>b$hgci-Aqm"foo to b"$hgglog-r.^::@10:c437988de89ffootob|o8:44e155eb95c7addc|~$hgpick-r7c15c05db6fapicking5:7c15c05db6fa"add b"mergingbwarning:conflictswhilemergingb!(edit,thenuse'hg resolve --mark')unresolvedmergeconflicts(seehghelpresolve)[1]$hgpick--abortabortingpick,updatingtoc437988de89f$hgglog@10:c437988de89ffootob|o8:44e155eb95c7addc|o7:2ccc03d1d096footoc||o5:7c15c05db6faaddb|/o4:d46dc301d92faddy|o3:8e224524cd09addx|o0:1f0dee641bb7addaTryingtograbapublicchangeset$hgphase-r7c15c05db6fa-p$hgpick-r7c15c05db6faabort:cannotpickpublicchangesets:7c15c05db6fa(see'hg help phases'fordetails)[255]$hgglog@10:c437988de89ffootob|o8:44e155eb95c7addc|o7:2ccc03d1d096footoc||o5:7c15c05db6faaddb|/o4:d46dc301d92faddy|o3:8e224524cd09addx|o0:1f0dee641bb7addaCheckingphasepreservationwhilegrabbingsecretchangesetIncaseofmergeconflicts$hgphase-r7c15c05db6fa-s-f$hgpick-r7c15c05db6fapicking5:7c15c05db6fa"add b"mergingbwarning:conflictswhilemergingb!(edit,thenuse'hg resolve --mark')unresolvedmergeconflicts(seehghelpresolve)[1]$echobar>b$hgresolve-m(nomoreunresolvedfiles)continue:hgpick--continue$hgpick--continue$hgphase-r.11:secretNomergeconflicts$hgupd46dc301d92f0filesupdated,0filesmerged,3filesremoved,0filesunresolved$echofoo>l$hgaddl$hgci-qm"added l"--secret$hgphase-r.12:secret$hgglog@12:508d572e7053addedl||o11:10427de9e26eaddb|||o10:c437988de89ffootob|||o8:44e155eb95c7addc|||o7:2ccc03d1d096footoc|/o4:d46dc301d92faddy|o3:8e224524cd09addx|o0:1f0dee641bb7adda$hgup10427de9e26e3filesupdated,0filesmerged,1filesremoved,0filesunresolved$hgpick-r508d572e7053picking12:508d572e7053"added l"$hgphase-r.13:secret