1

Is there any way to easily share .hg/hgrc settings across all clones of a Mercurial repo?

e.g., I want to automatically enable the commitsigs extension for all clones of a repo (obviously, I'd include a copy of commitsigs.py in the repo). If I make other settings changes over time, I want them all to be easily pushed out to all clones.

I want to have:

  1. hg clone automatically setup the .hg/hgrc of a new clone
  2. all clones receive updated settings from the central repo (presumably on bitbucket.com)

If there is no built-in functionality for this, is the best practice to:

  1. have a mandatory.hgrc in the root of the repo
  2. use the ACL extension to restrict committers & pushers for mandatory.hgrc
  3. have scripts in the root of the repo named something like setup-hg.sh & setup-hg.bat (are there better, more standard names?) that add the following to .hg/hgrc (or that overwrite .hg/hgrc):

    %include ../mandatory.hgrc
    
  4. include a README.md containing instructions to run setup-hg.sh or setup-hg.bat, depending on your platform

XDR
  • 4,070
  • 3
  • 30
  • 54
  • This might be helpful https://www.mercurial-scm.org/wiki/ConfigExpressExtension – Pulkit Goyal Jun 03 '18 at 12:35
  • Thanks for the tip. I’ll look into it soon. As per my reply to your comment on my other question: is there any way to do this on a bitbucket.com repo? – XDR Jun 03 '18 at 14:08
  • sorry again, I don't think this can be done on bitbucket. – Pulkit Goyal Jun 04 '18 at 11:57
  • Provide a readme to explain how to setup the extension, and use the server-side hook to ensure commits pushed to your repository have valid signatures. – ewindes Aug 02 '18 at 13:10

0 Answers0