Thanks. Did anything changed in hg policy to add non-interactive key/value modification for config from command line? There seems to be a few plugins with this ability that can be merged.
https://www.mercurial-scm.org/wiki/UsingExtensions#Configuration_management On Thu, Jan 3, 2019 at 9:40 PM Arne Babenhauserheide <[email protected]> wrote: > > Hi Anatoly, > > > > For automation it should suffice to use > > > > > > echo '[hooks] > > > post-clone.something = ~/.hghooks/post-clone > > > ' >> ~/.hgrc > > > > No idempotency in this case. > > > > What happens if `[hooks]` would be specified several > > times? Will key/values be merged? Or are they replaced > > by the new block? > > You can specify it several times and all blocks get used. > > If you want to replace a value, just use the same suffix (after the period). > > The folloing prints moo after every commit: > > [hooks] > commit.foo = echo foo > commit.foo = echo moo > > > If you want to ensure that your hook is used regardless of the content of the > ~/.hgrc, you can use a uuid. > > Here’s a version to play it safe: > > echo " > [hooks] > post-clone.$(uuidgen) = ~/.hghooks/post-clone > " >> ~/.hgrc > > Best wishes, > Arne -- anatoly t. _______________________________________________ Mercurial mailing list [email protected] https://www.mercurial-scm.org/mailman/listinfo/mercurial
