1

If the question is not clear enough, I will try to explain it:

I am wondering if you can add the extension code/script to your repository and enable it inside .hg/hgrc with a relative path.

If possible, this should enable you to distribute extensions with the repositories, as long the extension "code" can run on each platform.

Some, question applies for git.

sorin
  • 161,544
  • 178
  • 535
  • 806

2 Answers2

1

With Mercurial, you can add the extension code to the repository without a problem and you can also reference this same extension with a relative path.

However, and this is a deal breaker I think, you cannot enforce the activation of the extension upon the clone. Each user will have to setup manually the extension in his hgrc.

krtek
  • 26,334
  • 5
  • 56
  • 84
  • 1
    *"Each user will have to setup manually the extension in his hgrc"* - [projrc extension](http://mercurial.selenic.com/wiki/ProjrcExtension) (now - part of TortoiseHG) solves this problem. But mentioned by Mark show-stopper still exist – Lazy Badger Mar 21 '12 at 04:37
0

I've found that distributing an extension in the repository is fine, but the users should install it outside the repository. The reason for this is that if a newer version of the extension is released, updating to older history downgrades the extension. @krtek is right, the user has to enable the extension manually in .hg/hgrc as well.

Mark Tolonen
  • 166,664
  • 26
  • 169
  • 251