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
6
votes
3 answers

Let Jenkins build project from a Mercurial commit

Is there a way to specify a hook in the single repository? Now we have specified the hook in the "/etc/mercurial/hgrc" file, but every time it builds twice, and it builds for each commit in each repository. So we want to specify a build per…
MemLeak
  • 4,456
  • 4
  • 45
  • 84
6
votes
1 answer

How to run "hg update" via mercurial incoming hook

What is the correct way of running hg update in an incoming hook? Is it: [hooks] incoming.foo = hg update Or this Or is there a more elegant way of doing this?
Kimvais
  • 38,306
  • 16
  • 108
  • 142
5
votes
2 answers

How to show hook output in Tortoise Hg log window?

I need simple hook for mercurial that checks commit comment using pattern. Here is my hook: #!/usr/bin/env python # # save as .hg/check_whitespace.py and make executable import re def check_comment(comment): # print 'Checking comment...' …
Victor Haydin
  • 3,518
  • 2
  • 26
  • 41
5
votes
3 answers

How to use a relative pathname to a Mercurial hook

I have a script that is in the top level of my working copy and would like to use it as a Mercurial hook. If I use an absolute pathname to the hook then everything is fine, but I want a relative pathname so the whole thing can be easily moved…
Roger Binns
  • 3,203
  • 1
  • 24
  • 33
5
votes
5 answers

Mercurial - How to disable push

I am trying to find if there is an easy way to make a mercurial repository read-only. The user should be able to clone, but no pushes should be allowed. I need to do this for all my repositories which is more than 100.
Santhosh
  • 95
  • 1
  • 5
5
votes
3 answers

Temporarily disable a hook?

Is it possible to temporarily disable a hook when running a mercurial command? e.g., something like: hg push --no-hook
keflavich
  • 18,278
  • 20
  • 86
  • 118
5
votes
2 answers

Using Mercurial hooks to create/load database dumps for versioning

I've started using Mercurial for version-controlling my Drupal project source files (I'm both a VCS and Mercurial newbie). However, the database is still "version-controlled" using a directory of dated .sql.gz files. What I want is to have a single…
Eli Krupitsky
  • 888
  • 6
  • 10
4
votes
2 answers

Call a mercurial command ("hg update") from a python hook

I have Mercurial hgweb set up on Windows 2008 64 bit and IIS. The location of the repositories is a network share. I want to create a hook on the repository to issue an "hg update" command on a changeroup. I cannot use the external hook as this…
Lee Atkinson
  • 2,171
  • 3
  • 20
  • 32
4
votes
2 answers

Mercurial hook that operates like 'changegroup', but only on push?

We've built a changeset propagation mechanism, but it relies on bundling and unbundling the new changesets. If we were to use the changegroup hook, then it would cause cyclic behaviors, because the hook is run during a pull, push, or unbundle. What…
voithos
  • 68,482
  • 12
  • 101
  • 116
4
votes
1 answer

How to execute commandline application (bat) before mercurial commit?

I would like to execute command line application before each commit (push) to central repository. If application will execute with errors, commit should fail with some message. I have found some examples of python hooks, but nothing about calling…
Robert.K
  • 506
  • 5
  • 18
4
votes
1 answer

How to validate and enforce commit message in Mercurial?

What are all steps required to validate commit message with set of regular expressions? We want to work in semi-centralized set-up so I need a solution for the developer clone (local repository) and for our central clone (global repository). I read…
Michal Sznajder
  • 9,338
  • 4
  • 44
  • 62
4
votes
0 answers

How to distinguish between added and renamed files in Hg hook

There is a very similar question on how to achieve this in CLI. I am interested in how to do it in the hook function. My function currently is defined as def check_committed_files(ui, repo, **kwargs) With repo.status() I can see all files in the…
texnic
  • 3,959
  • 4
  • 42
  • 75
4
votes
1 answer

How do I reject pushes to a Mercurial server based on a script, without risking a bad pull during that time?

I'd like to write a script that examines the incoming changesets on a push to a mercurial server and rejects the push if the changesets do not conform to a particular standard. It seems like my options are the prechangegroup, pre-changegroup, and…
prewett
  • 1,587
  • 14
  • 19
4
votes
1 answer

Using hooks vs. wrapping commands in mercurial

What are the relative pros and cons for using hooks vs. using an extension that wraps a command for a particular task? In other words, what are the criteria for deciding whether to use hooks or wrap a command? Please also list the cases where one…
Geoffrey Zheng
  • 6,562
  • 2
  • 38
  • 47
4
votes
1 answer

Getting Mercurial in-process hook to run on Windows

I'm trying to get a Mercurial in-process hook to run on Windows. The problem is not how to write the hook (I want to use an existing one, in this case BugTracker.Net's hook for Mercurial integration - I didn't find a direct link to the file, but you…
Christian Specht
  • 35,843
  • 15
  • 128
  • 182
1
2
3
12 13