mercurial-hook

Mercurial Hook - change a commit message pre commit

心不动则不痛 提交于 2019-12-03 13:54:30
问题 Edit Made this basic hook to prevent branch name & commit message bugID mismatches. https://gist.github.com/2583189 So basically the idea is that the hook should append " BugID:xyz" to the end of the commit messages if the branch name is like bug_123, or feature_123. However I'm having problems finding out how to do this, as most examples of pretxncommit people don't want to mutate the changeset description. This is what I have so far. It updates .hg/commit.save with the right message, but

Automating Review Requests with ReviewBoard and Mercurial using Python hooks

萝らか妹 提交于 2019-12-03 05:09:21
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 devs into the remote repository. Of course, I would need a hook that invoke post-review that also uses submit-as user which extracted using the mercurial api (ctx.user()), or else all the review requests tickets would be in the name of the user that connects the remote repository to the reviewboard server. My main dilemma is actually getting the start

How can I create a mercurial hook that prevents new heads?

跟風遠走 提交于 2019-12-01 09:18:22
I have several repositories that have been converted from SVN and moving forward we want make sure when people push to the repository they can't create additional heads. there are several hooks in the TipsAndTricks wiki page that prevent pushing if there are multiple heads, but how I can build a hook that prevents pushing new heads? It seems like the right way to do this would be to compare the number of heads from revision 0:parent and then compare 0:tip, but I can't seem to find a way to do that. hg heads -r $HG_NODE only shows me the number of heads after the user's first commit being

Mercurial hook not executing properly

為{幸葍}努か 提交于 2019-11-30 13:25:39
问题 This should be a very simple thing to have run, but for some reason it won't work with my Mercurial repository. All I want is for the remote repo to automatically run hg update whenever someone pushes to it. So I have this in my .hg/hgrc file: [hook] changegroup = hg update Simple, right? But for some reason, this never executes. I also tried writing a shell script that did this. .hg/hgrc looked like this: [hooks] changegroup = /home/marc/bin/hg-update and hg-update looked like this: #!/bin

Mercurial hook to disallow committing large binary files

拥有回忆 提交于 2019-11-28 10:05:17
I want to have a Mercurial hook that will run before committing a transaction that will abort the transaction if a binary file being committed is greater than 1 megabyte. I found the following code which works fine except for one problem. If my changeset involves removing a file, this hook will throw an exception. The hook (I'm using pretxncommit = python:checksize.newbinsize ): from mercurial import context, util from mercurial.i18n import _ import mercurial.node as dpynode '''hooks to forbid adding binary file over a given size Ensure the PYTHONPATH is pointing where hg_checksize.py is and

Mercurial hook to disallow committing large binary files

北城以北 提交于 2019-11-27 03:29:50
问题 I want to have a Mercurial hook that will run before committing a transaction that will abort the transaction if a binary file being committed is greater than 1 megabyte. I found the following code which works fine except for one problem. If my changeset involves removing a file, this hook will throw an exception. The hook (I'm using pretxncommit = python:checksize.newbinsize ): from mercurial import context, util from mercurial.i18n import _ import mercurial.node as dpynode '''hooks to