mercurial-hook

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

依然范特西╮ 提交于 2020-08-24 10:45:07
问题 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 we need is for the sync to be done after a commit, which the commit hook works perfectly for, but also after a push . Note, the post-push hook is not the answer, as it is run when you push from that repository to another. This scenario calls,

Automating Review Requests with ReviewBoard and Mercurial using Python hooks

对着背影说爱祢 提交于 2020-01-22 10:07:42
问题 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

Automating Review Requests with ReviewBoard and Mercurial using Python hooks

∥☆過路亽.° 提交于 2020-01-22 10:07:06
问题 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

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

送分小仙女□ 提交于 2020-01-11 06:34:49
问题 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

How do I set up a hook in HG / Mercurial that gets dictated by the repository?

旧街凉风 提交于 2019-12-23 15:28:54
问题 I have a need for a hook to run after update (this will build the solution they have updated) and I don't want to have to add that hook manually for each person that clones my central repository. When someone first clones my central repository, is it possible to include hooks into that clone? It seems that the .hgrc file doesn't get cloned automatically. I did read about site-wide hooks, but as far as I understand it, they work on each created repository, where I only want to have the hooks

Reading command line arguments from Mercurial prechangegroup hook

人盡茶涼 提交于 2019-12-23 12:24:34
问题 I'm attempting to disallow pushes to a Mercurial repository if a certain condition holds true. However, it is essential that if the user uses push --force , the push goes through regardless. I know that it's easy enough to do this on the machine that's doing the push by using the pre-push hook, which passes in the command line arguments to the hook. However, since hooks aren't propagated, I'd have to somehow distribute the hook to every single user of the repository and rely on them not

Jenkins Mercurial plugin does not detect changes

微笑、不失礼 提交于 2019-12-13 02:58:25
问题 When my pipeline polls the Mercurial repo for changes it does not detect any change, and new builds are not triggered. Following the plugin docs, I set up a push hook to trigger the polling, which works fine, but is not able to detect changes. All I get is Mercurial Polling Log Started on May 19, 2018 11:58:10 PM no polling baseline in /var/lib/jenkins/workspace/test-repo on Done. Took 0 ms No changes I am working with: - Jenkins v2.107.3 - Mercurial plugin v2.3 I just created a test

Mercurial: enforce “hg pull -u” before “hg commit”

♀尐吖头ヾ 提交于 2019-12-12 10:39:51
问题 I have in some cases a need to enforce that Mercurial-users have run hg pull -u before any hg commit can be allowed, i.e., hg pull will mean that the incoming queue is empty — and furthermore I also want that the person is using the head version of the branch. How can I set up such a restriction? (I am fully aware that this goes against parts of the DVCS design core) 回答1: You could ask your developers to install [hooks] pre-commit = hg pull -u in their config files (it should probably be

Kallithea does not use hooks defined in .hg/hgrc

青春壹個敷衍的年華 提交于 2019-12-12 03:39:33
问题 I want to allow pushing to the default branch only for certain users. Since Kallithea does not have this functionality built in my attempt was creating a hook that should provide that behavior. I know that Kallithea has a GUI for this but I wanted to use built in mercurial functionality and hgrc file in the repository. I have a hook defined in .hg/hgrc file in a repository that is served through Kallithea SCM [extensions] acl = [hooks] pretxnchangegroup.acl = python:hgext.acl.hook [acl]

Make TortoiseHG use my Python installation

人盡茶涼 提交于 2019-12-11 23:32:15
问题 I created some python hooks for Mercurial that use some external libraries (namely jira-python). In Linux, I install the packages using pip. In Windows, however, Mercurial comes with a bundled version of Python. My hooks fail when I run them because the external packages are not installed. I want to make Mercurial / TortoiseHG use my Python installation so I can control its environment. How can I do that? 回答1: You can install Mercurial package for Python: Mercurial 2.4 Python 2.7 package -