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

Python custom Mercurial merge tool in process?

Given a custom hg merge tool mymergetool.py On Linux, I can do this: merge-tools.MyMergeTool.executable=mymergetool.py which runs the python in a new process. However on Windows one has to specify python.exe as the executable. But given that one…
Tom
  • 6,325
  • 4
  • 31
  • 55
2
votes
1 answer

Mercurial changeset hook exists with status -1

I am using Mercurial SCM over a LAN using a normal shared folder instead of HTTP and I'm having a problem getting the auto update hook to run. I have entered this hook as detailed in the FAQ. This installs the hook, but when I push something to the…
Gary Willoughby
  • 50,926
  • 41
  • 133
  • 199
2
votes
0 answers

Mercurial subrepo with secret phases: avoiding inconsistent host repo state

Assuming the following situation: I have a mercurial "host repo" with a subrepo. The subrepo contains a changeset in the secret phase. The "host repo" has a changeset in the draft phase that depends on the secret-phase changeset in the subrepo. If…
ARF
  • 7,420
  • 8
  • 45
  • 72
2
votes
1 answer

mercurial: how do I get the project's root folder name in changegroup hook?

I'm aware of this answer and maybe there is no solution to my problem in the end anyway. However, what I want to achieve is this: Whenever a changeset for a repo on my server is incoming, I want to perform some custom tasks. I added a hooks section…
LarsVegas
  • 6,522
  • 10
  • 43
  • 67
2
votes
1 answer

mercurial: is there a remote global hook?

On my remote server that hosts all mercurial repos (+100) I want to define a global hook. That is, after a commit to any of the repos a certain action is suppose to take place (actually a post request should be triggered). I know that I can define…
LarsVegas
  • 6,522
  • 10
  • 43
  • 67
2
votes
0 answers

phpstorm mercurial pre commit hook not executed

I have this pre-commit hook set up in .hg/hgrc [hooks] pre-commit = python:commit.py:run commit.py #!/usr/bin/env python import os import time def run(ui, repo, **kwargs): datestring = time.strftime('%d-%m-%y %H:%M') filecontent =…
Douwe
  • 557
  • 7
  • 16
2
votes
1 answer

Is it possible to have colorized diffs for Mercurial notifications?

We're in the process of migrating from Subversion to Mercurial. The VisualSVN server we were using produced colored diffs within its notification emails, but I can't find how to reproduce this in Mercurial. I have enabled the color extension on…
Darren Oster
  • 9,146
  • 10
  • 48
  • 66
2
votes
3 answers

precommit mercurial hook to stop commits to the wrong branch

I have a piece of software in a Mercurial repository. I'm packaging my software project as a Debian package. It seems the standard way to do this is to have a separate branch for the Debian package files, which live in the debian…
Faheem Mitha
  • 6,096
  • 7
  • 48
  • 83
2
votes
1 answer

Getting authenticated user in mercurial hook

I have an Apache httpd+mod_wsgi+Mercurial setup and I would like to get authenticated user in a hook, specifically pretxnchangegroup hook. I have read (most likely incorrectly) that os.environ['REMOTE_USER'] should contain that info, but doesn't…
Paulius K.
  • 813
  • 1
  • 7
  • 13
2
votes
1 answer

hg commands in powershell hook from tortoisehg

I created a powershell script to run as a commit hook to write the username to a file. The command I am using in powershell to extract the username is: $repodir = "C:\Users\Administrator\Documents\Visual Studio 2012\Projects\testRepo" cd…
kieferm
  • 23
  • 4
2
votes
1 answer

hgweb alternatives to allow_push

I've got Mercurial running on IIS7 fine. One thing that is frustrating is that allow_push will only take a list of usernames rather than a group. To that end, I was wondering if it'd be possible to use a hook to carry out this task. i.e. by passing…
Martin Clarke
  • 5,636
  • 7
  • 38
  • 58
2
votes
2 answers

disable/deprecate (but not delete) mercurial repository

My colleagues and I use several repositories that live on a centralized (ubuntu, if it matters) server. For several of our projects, we include the same 4 repositories as subrepositories in lots of different projects. This can be a little irritating…
dino
  • 3,093
  • 4
  • 31
  • 50
2
votes
1 answer

Mercurial rollback hook?

I'm writing an extension for which it would be very convenient to be able to perform some logic after a rollback is made. I looked through all of the documentation I could find on hooks, but I couldn't find a rollback hook. I also tried the post-*…
voithos
  • 68,482
  • 12
  • 101
  • 116
2
votes
1 answer

mercurial: including precommit-changed file

On commit to repository I have a hook defined in Mercurial: [hooks] precommit.exportDB=exportDB.bat This creates/updates a SQL-dump from my database, which should be included in the commit. BUT: although this works, the Sql is marked as new, but…
reinhard
  • 818
  • 1
  • 10
  • 24
2
votes
1 answer

How to run mercurial changegroup hook only after a rebase?

We have a simple mercurial hook that runs every time we pull remote changes. We use changegroup hook. Our hook rebuilds some dlls and copy them to a folder. We automatically rebase when we do a pull. This causes our hook to be run two times,…
EtienneT
  • 5,045
  • 6
  • 36
  • 39