

- MERCURIAL WINDOWS HOOK ON COMMIT ADD COMMENT PATCH
- MERCURIAL WINDOWS HOOK ON COMMIT ADD COMMENT CODE
- MERCURIAL WINDOWS HOOK ON COMMIT ADD COMMENT DOWNLOAD
Can anyone help me shed light on this issue? Many thanks. The python script runs if I place it inside. Prechangegroup = python./commit.py:getV1ID

To make mercurial run the local commit.py, in my mercurial.ini file (in C:UsersUserNamemercurial.ini), I added the following statement: And so, commit.py cannot be a global python script that can reside in. Users can modify their local commit.py so that they only run a subset of those pre-push operations depending on the project their working on and each person could be working on more than one project at a time. The push should only be successful if those pre-push mechanisms pass.
MERCURIAL WINDOWS HOOK ON COMMIT ADD COMMENT CODE
V1id = ui.prompt('Enter the VersionOne ID')įor each branch, this commit.py is duplicated as it contains mechanisms that needs to run before code gets pushed onto the main respository. I created a python script as given below: # commit.py If hooks cause problems you'll want to know which hooks are defined/active and which configuration file they are defined in.I'm trying to create a Mercurial hook that runs when the commits are being pushed to the main repository. # then the code that uses the request package with ssl that used to blow up as above One way to deal with this "try except ImportError" not working with demandimport is to put the following before the code that actually needs it.įrom import ssl_ This is because requests/packages/urllib3/util/ssl_.py has this code:įrom ssl import OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION Remote: TypeError: unsupported operand type(s) for |=: 'int' and '_demandmod' Remote: File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py", line 229, in create_urllib3_context However, there is another way to "by-pass" demandimport: it is to actually use something in the module.įor example, if you have this error with your server-side push hook: ".util.ssl_", # requests uses relative imports ".ssl_", # requests uses relative imports So appending to the ignore list might not work, ex: # this might not work With in-process hooks, you can not turn off demandimport because has already been enabled by Mercurial. Precommit = python.hg/signoff.py:sign_commit_message Then, add the following to the section of.
MERCURIAL WINDOWS HOOK ON COMMIT ADD COMMENT DOWNLOAD
To automate the process of adding the "signed-off-by" tag line like it's used by the Linux Kernel community and many other projects, you could use a commit hook like this one: To enable it, simply download and place the file signoff.py into your repository's. Automatically add a "Signed-off-by:" tag line to commit messages Now Mercurial on remote will use /home/tmp as the temporary directory when receiving changesets, for every user (but only for mercurial).ħ. Somewhere in your $PYTHONPATH, put the following hgenviron.py file :ĭef settmpdir(ui, repo, hooktype, node=None, source=None, **kwargs): On remote global hgrc ( /etc/mercurial/hgrc or MERCURIAL.INI, set the following hook: To circumvent that, you can define a hook to set TMPDIR to another location before mercurial sets up its serving thread. This may be problematic on some servers with a small /tmp directory or with small quotas on that partition. Change temporary directory used on remote when pushingīy default Mercurial uses /tmp (or one of the directories defined by environment variables TMPDIR, TEMP, TMP) to uncompress the bundle received from a remote host. When we pointed this script at the node with the accidental inappropriate reversion, it went from being hidden in the noise to being painfully obvious.Ħ. Some of the brevity introduced in this script was driven by one of its authors being in the habit of reading changemail on his Treo, but it seems to generally help focus the review process on the things that really changed.
MERCURIAL WINDOWS HOOK ON COMMIT ADD COMMENT PATCH
This script filters out some of the other information that is really not needed for patch review: the changeset hash exists in the diff the parents are available by using hg log on the changeset hash the word "description" isn't really needed in this context the date is in the email header, etc. (hg log -vr $HG_NODE | egrep -v '^(changeset|parent|date):' | sed 's/^description:$//' | cat -s hg diff -r $PARENT -r $HG_NODE $FILES) | mail -s "$MODULE: $SUBJECT" $RECIP SUBJECT=$(hg log -r $HG_NODE -template '') hg/hgrc:Īnd put this in a file called "commithook" in your path: You can use the hook feature to, for example, automatically send mail when a commit occurs. For hooks implemented in Python this can be a bit misleading, since it means you return "False" to indicate success and "True" (or raise an exception) to indicate failure. The meaning of the return value in both cases is based on the convention for external executables: a value of 0 means "success". Hooks can be implemented as either external programs, or internal Python calls.

