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
2
votes
1 answer

Hg equivalent to git post-receive hook

I need the equivalent of git post-receive hook in Mercurial so I can notify another service that a push has been done to the repository. What I need in my hook is simple: changeset revision of the last changeset. Of course I understand that the…
Antoine Pelisse
  • 12,871
  • 4
  • 34
  • 34
1
vote
1 answer

Setting Environment Variables for Mercurial Hook

I am trying to call a shell script that sets a bunch of environment variables on our server from a mercurial hook. The shell script gets called fine when a new changegroup comes in, but the environment variables aren't carrying over past the call to…
Mjr578
  • 23
  • 4
1
vote
1 answer

How should one manage hook specific files in the '.hg/' state directory?

I'm writing a series of changegroup and commit hooks using the native Python implementation of the Mercurial API. Part of this requires me to save certain bits of information that are specific to my hooks, such as the last revision ID that my hooks…
Tim Post
  • 33,371
  • 15
  • 110
  • 174
1
vote
0 answers

Syncing configuration files from production server to mercurial repository

We have an admin page that allows us to upload and update a configuration file on our production server. We want to maintain a record of all changes made to the configuration file, so we need to push it to the main branch of our Mercurial repository…
1
vote
2 answers

Mercurial external precommit hook: get changed files list

I could get it either with hg status --change $HG_NODE or with hg log -r $HG_NODE --style mycustomstyle But I can't get HG_NODE in precommit hook. Is there any workaround?
utapyngo
  • 6,946
  • 3
  • 44
  • 65
1
vote
1 answer

Why does MERCURIAL_REVISION return the value NULL when I try accessing it on Jenkins

On Mercurial I've implemented a hook in my hgrc file that activates when some sort of change occurs in Jenkins(i.e tagging or committing). Here is my hook code: curl -X POST…
1
vote
0 answers

How to share mercurial hooks with your team for jenkins

I am aware that I need to add hooks in my .hg/hgrc file. I could add something like: commit.jenkins = wget -q -O /dev/null /mercurial/notifyCommit?url= incoming.jenkins = wget -q -O /dev/null
Brogrammer
  • 191
  • 1
  • 1
  • 10
1
vote
0 answers

Prevent pull of a branch using a hook

There is a repository which must be protected from accepting a specific set of named branches coming from other repositories. How can this be accomplished using hooks? It seems possible by using pretxnchangegroup hook, but: (1) how to determine…
Michael
  • 11
  • 2
1
vote
1 answer

How do I find out where the Mercurial hook file is being called from?

On the project I am working on there is a standard pre-commit hook for mercurial that looks something like this: python:hookhgext.messagevalidation.checkCommitMessage I would like to find out where the python script is located so I can create my…
OultimoCoder
  • 244
  • 2
  • 7
  • 24
1
vote
0 answers

hg clone error raise keyerror(key)

I have a main mercurial repo and a remote clone repo. After the initial clone I added a pretxnchangegroup hook function to the main repo. The hook function uses os.environ["REMOTE_USER"] to retrieve the authenticated user. The hook function works as…
Asha
  • 11
  • 1
1
vote
1 answer

Possible to use a different set of hooks for a user or group in Mercurial?

I am not sure if this is possible currently but is it possible to specify a separate set of hooks for a user or group (groups from the ACL extension). I know you can specify the hooks on each user's machine individually but I would like to also…
DavidW
  • 301
  • 3
  • 11
1
vote
1 answer

Is it possible to add new files to mercurial commit via pretxncommit hook or any other method?

I want to check what files have been modified in current commit and base on that I want to modify or not specified file and add it to that commit. I was thinking about using script on pretxncommit hook who gives me information that I need but I…
Laston
  • 71
  • 4
1
vote
1 answer

Is it possible to get the files changed information from commit ids using mercurial python library?

I am implementing a custom hook in Rhodecode CI, which sends a build request to Buildbot on every push. The hook gives me the revisions commit-id, how can I extract information about the files that were changed as part of this…
Javed
  • 5,904
  • 4
  • 46
  • 71
1
vote
1 answer

How to set up python interpreter for pyCharm for Mercurial Hooks

I am very new to Python and am trying to learn it so that I can write Mercurial hooks (https://www.mercurial-scm.org/wiki/MercurialApi). I downloaded PyCharm by Jetbrains with the hope that I could start writing a python script and have the IDE…
user1015214
  • 2,733
  • 10
  • 36
  • 66
1
vote
1 answer

precommit hook returns list of checked marked files in tortoiseHg

precommit hook returns list of checked marked files in tortoiseHg So Basically i am writing a pre-commit hook which, will static analysis the code and give me HTML output of error report. What I had done: I am done with Get a list MODIFIED and ADDED…
Dupinder Singh
  • 7,175
  • 6
  • 37
  • 61