Questions tagged [mercurial-hook]

Mercurial hook is a mechanism to customize and extend functionalities of the Mercurial DVCS.

What it is?

Mercurial hook is a mechanism to customize and extend functionalities of the Mercurial DVCS.

Related tags

  • For more specific questions, this tag can be used in conjunction with and which are independent of the software configuration management system that is used.

See also

185 questions
1
vote
0 answers

How to configure Notify extension in mercurial

I have seen many posts which are not helping. I can see that hook is getting called but not able to see any output in the output log when I set Test="True" I followed many posts mentioning to make changes in hgrc file, but I'm wondering how changing…
Vinay
  • 577
  • 6
  • 17
1
vote
0 answers

Preventing changesets with files matching .hgignore patterns from being pushed to an hg repo

How can I prevent changesets (from the source repo) with files matching .hgignore patterns (in the head of each respective target branch in the target repo) from being pushed to an hg repo? It looks like the ACL Extension can deny pushes based on…
XDR
  • 4,070
  • 3
  • 30
  • 54
1
vote
1 answer

Mercurial changegroup hook is being passed wrong HG_URL

I've setup a simple changegroup hook for my Mercurial repositories to email the set of changes to interested users. I'd like to use a single script for every repository I manage, and I would also like to identify the repository the changegroup came…
purecharger
  • 1,213
  • 2
  • 15
  • 34
1
vote
1 answer

Mercurial: Redirect an incoming push to a separate repo

I am looking for some solution where a push made to a branch in production server is redirected to some other mercurial server. I can then trigger a hook, run some basic tests and send the changes back to the production server only if my tests…
user3513429
1
vote
2 answers

Mercurial: enable merge but forbid commit

How can I forbid commits and allow merges into specific branch? eg. master branch can't be complete with a commit but can with merge.
abu
  • 11
  • 5
1
vote
1 answer

Mercurial hooks: How can I detect second head in a particular push?

I'm using server-side (remote) hooks to prevent specific kind of pushes. Among other thing, I want to ban pushes that are creating new heads in mercurial repository even if they were pushed with --force. I can think only of one way to achieve…
shabunc
  • 23,119
  • 19
  • 77
  • 102
1
vote
2 answers

How to set up mercurial hooks in Kallithea

I've been at it for a while now and I can't seem to get it working. As per Kallithea documentation: To add another custom hook simply fill in the first textbox with . and the second with the hook path. Example hooks can be found in…
Mario
  • 128
  • 7
1
vote
2 answers

Prevent mercurial precommit hook from running on histedit

I would like to run clang-format (actually clang-format-diff.py, to format only what's changed) on the code I commit in Mercurial automatically. I know I can do it with a precommit hook. In fact, I've done it in the past but it messed up some…
MikMik
  • 3,426
  • 2
  • 23
  • 41
1
vote
2 answers

mercurial pre-push hook parameter to obtain the remote repo path

I'm trying to implement a mercurial pre-push hook which checks the target repo path and adds the appropriate id by ssh-add. The not so nice solution would be checking the command line parameters and if the path isn't forced, then reading the default…
abdus_salam
  • 738
  • 2
  • 7
  • 19
1
vote
1 answer

A Mercurial update hook to send certain data to a text file

I guess this is really 2 questions: How do I get an update hook to execute the following: hg heads --template 'version {tags}\tbuild {rev}.{node|short}\tcommitted on {date|shortdate}' Simply putting: update = in the [hooks] section…
RdeG
  • 83
  • 5
1
vote
2 answers

How can I alert developers they need to run certain commands after they pull my commit (in version control/git)?

Here’s a common scenario: You’re working on a project (such as, but not necessarily, a web app) with other developers. I decide we should use a certain open-sourced tool and add it to the project dependencies. Of course, I add it to our package…
Alan H.
  • 16,219
  • 17
  • 80
  • 113
1
vote
1 answer

Disabling Mercurial Hooks For Specific Repo Sources

On my computer I have some Mercurial commit hooks that run on every commit that make sure I branch correctly and do a few other things. But I only need these for work projects. Here are the hooks implemented in my ~/.hgrc file: [hooks] # This hook…
Patrick
  • 3,302
  • 4
  • 28
  • 47
1
vote
2 answers

Detect creating of branches or bookmarks in HG

Is it possible to detect if a commit creates a new bookmark or branch via hooks in .hgrc? I've tried to see if I can find out using hg log, but it just shows on what branch/bookmark the commit has been created:…
Richard Deurwaarder
  • 2,023
  • 1
  • 26
  • 40
1
vote
3 answers

How do I prevent a commit using pre-commit and hg incoming?

Sometimes developers on my team forget to pull in other developer's changesets before committing their own (admittedly, I do this as well). For a week long project there could be dozens of changes in the tree that the new commit skips over. When…
NeilAE
  • 11
  • 2
1
vote
1 answer

How to read hgrc properties from Mercurial hook

I did not find anything from the Mercurial hook documentation explaining how to get properties of the repository's hgrc file from a custom python hook. As the documentation states that we have access to the full Mercurial API from hooks, I suppose…
greydet
  • 5,509
  • 3
  • 31
  • 51