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
2 answers

Using a Django model from a mercurial python hook

I'm trying to queue up some build requests in a DB during a changegroup hook. The DB table is managed by a Django app. So, in the hook, I want to use the Django model to submit the build request. However, I'm unable to get my settings right to…
Nick Jennings
  • 3,853
  • 6
  • 30
  • 45
2
votes
2 answers

Mercurial hooks -- pass information between hooks?

I currently have a pre-commit hook in my mercurial project that gives the user the option to update the version number of the project if they wish (e.g. 1.0 to 1.0.1 or 1.1 or 2.0). They select one of these options, and the hook updates the version…
mathematical.coffee
  • 55,977
  • 11
  • 154
  • 194
2
votes
2 answers

Is it possible to specify Windows shell to use when specifying hooks in Mercurial?

I am trying to set up a hook on a remote repository (using hgweb) on a Windows IIS server. The issue I have is that the repository is specified as a UNC path in hgweb's config, and the hook executes cmd.exe using a UNC path which cmd.exe does not…
Lee Atkinson
  • 2,171
  • 3
  • 20
  • 32
2
votes
1 answer

How to get the revision history between particular time frame or after a certain revision or commit id upto the latest using Mercurial API?

I want to fetch all the commits with their changeset after a particular commit id or time. Is there any straight way to do that using Mercurial API?
sra
  • 71
  • 1
  • 5
2
votes
2 answers

How to access commit message from Mercurial Input or Changeset hook

I would like to write a hook for Mercurial to do the following, an am struggling to get going.: Run on central repo, and execute when changeset(s) are pushed (I think I should use the "input" or "changegroup" hook) Search each commit message for a…
James
  • 7,877
  • 7
  • 42
  • 57
2
votes
2 answers

Mercurial HG_NODE hook variable on windows

I'm currently testing mercurial hooks on windows and it seems like I cannot access hook variables.... here's hgrc content : [hooks] prechangegroup = ruby prechangegroup.rb test1 test2 $HG_NODE I also tried with %HG_NODE% Here's prechangegroup.rb…
jfabre
  • 514
  • 5
  • 13
2
votes
1 answer

Automating Review Requests with ReviewBoard and Mercurial using Python hooks

Here is my problem: I got a remote mercurial repository where the hook is gonna be setup either incoming or changegroup, and I got a ReviewBoard setup on a different server. The idea is to automate review request tickets generation upon push from…
Wissam Youssef
  • 800
  • 1
  • 10
  • 20
2
votes
2 answers

Mercurial does not send emails using changenotify

I set up a http central Mercurial repository and try to send emails on every push. I follow instructions from mercurial page and from http://morecode.wordpress.com/2007/08/03/setting-up-mercurial-to-e-mail-on-a-commit/. Push works fine, but I don't…
devgp
  • 1,321
  • 3
  • 17
  • 36
2
votes
1 answer

Mercurial hook to set policy on tag names

I write (in-process) hook to prevent add BAD tag name locally: .hg/hgrc: pretag.badtagname = python:.hg/hgcheck.py:localbadtag .hg/hgcheck.py: goodtag_re = r'(ver-\d+\.\d+\.\d+|tip)$' def localbadtag(ui, repo, hooktype, node, **kwargs): …
gavenkoa
  • 45,285
  • 19
  • 251
  • 303
2
votes
1 answer

How do I write a hook around mercurial's "push creates new remote head"?

I want to make a hook that when someone is pushing to the remote, if they get the abort: push creates new remote head error message, the hook will try to merge the remote and local head (if easy merge i.e. no conflicting files) and push again. How…
Jonathan Allen Grant
  • 3,408
  • 6
  • 30
  • 53
2
votes
0 answers

Mercurial - repos with multiple ACL rules

I'm trying to use 2 set of rules for the ACL of my repos. I was thinking that maybe the action name could be useful from the hooks section but that not the case. The rules are : 1) Only be able to commit on a specific branch (ex: acceptance) 2)…
maestro2
  • 43
  • 3
2
votes
1 answer

How can a Mercurial Hook validate the used flags and sync alias?

I would like to write a pre- hook for Mercurial written in Python. I would like to check the flags passed to the pull command, and also check the sync alias (the "remote URL"). I didn't notice anything like that…
Peter
  • 3,322
  • 3
  • 27
  • 41
2
votes
0 answers

how to use Mercurial's Buildbot hook with python3?

I am using this buildbot hook to send information about HG repository changesets to Buildmaster(build server) and the setup works fine with python2. Now I am upgrading Buildbot to 2.0.1 version, which supports only python3.5+ and the Buildbot…
Javed
  • 5,904
  • 4
  • 46
  • 71
2
votes
0 answers

HG command line input receives unwanted default input automatically in THG

I've written an Hg hook (in Python) to check the validity of the committed files according to out team rules. One of these rules prohibits files larger than XX kB, unless agreed with the ream. In case a large file is committed, I would like the hook…
texnic
  • 3,959
  • 4
  • 42
  • 75
2
votes
3 answers

check head mercurial python hook is not working in version 4.6.1

I am working on Hg python hook.These hooks are currently running on Hg version 2.2.1 fine but now we are planning to upgrade Hg to Higher version 4.6.1 and I found the issue with below hook on higher version with error def chkheads(ui, repo,…
unknown
  • 1,815
  • 3
  • 26
  • 51