{ "info": { "author": "Jon Ribbens", "author_email": "jon-hg-autohooks@unequivocal.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Version Control" ], "description": "Mercurial Autohooks Extension\n=============================\n\nThis project is an extension for Mercurial that enables Mercurial hooks to\nbe included inside a source repository such that they are automatically\ndetected and utilised merely by being present.\n\nIt is important to realise that using this extension means that you\nare giving permission to run code as your user to anyone who can commit to\nthe repositories you are using. For this reason, the extension will only\nbe activated for respositories with a default upstream that you have\nconfigured as 'trusted'.\n\nInstallation\n------------\n\n pip install hg-autohooks\n\nAdd the following to your Mercurial configuration:\n\n [extensions]\n hgautohooks=\n\n [autohooks]\n trusted=\"ssh://hg@hg/\"\n\nThe `trusted` configuration is a list of repository upstream address\nprefixes are trusted. The extension will only be active for repositories\nwhose default upstream starts with one of the strings in this list.\n\nAutomatic hooks\n---------------\n\nTo use the automatic hooks, create a top-level directory inside your\nrepository named either `hg-autohooks` or `.hg-autohooks` and then\nadd hook files inside it. The file names should be prefixed with the\nhook name and have a suffix of `.sh` or `.py` for shell or Python\nextensions respectively. Pre- and post- hooks should be named\n'pre_hookname.ext' or 'post_hookname.ext' respectively.\n\nExample\n-------\n\nTo require that your Python module can be successfully imported\nbefore allowing it to be committed, create a file named\n`hg-autohooks/pre_commit.import.py` containing:\n\n```python\n \"\"\"Mercurial pre-commit hook to try importing the project.\"\"\"\n # pylint: disable=invalid-name,unused-argument\n\n import subprocess\n\n def pre_commit(ui, repo, **kwargs):\n \"\"\"Try importing the project and see if anything bad happens.\"\"\"\n imp = subprocess.Popen((\"bin/python\", \"-c\", \"import foo\"),\n cwd=repo.root, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n stdout, stderr = imp.communicate()\n if imp.returncode or stdout or stderr:\n if stdout:\n ui.write(stdout)\n if stderr:\n ui.write(stderr)\n return True\n return False\n```\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jribbens/hg-autohooks", "keywords": null, "license": "GPLv2+", "maintainer": null, "maintainer_email": null, "name": "hg-autohooks", "package_url": "https://pypi.org/project/hg-autohooks/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/hg-autohooks/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jribbens/hg-autohooks" }, "release_url": "https://pypi.org/project/hg-autohooks/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Mercurial Autohooks Extension", "version": "0.1.0" }, "last_serial": 1557188, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8edb930c5a98a8b0a20532376c13a01b", "sha256": "1a7fc5e21ac10d0d1981b71c81535aedafe8d0085ae6bc5c356cc8812ef810c9" }, "downloads": -1, "filename": "hg-autohooks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8edb930c5a98a8b0a20532376c13a01b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9881, "upload_time": "2015-05-22T00:24:08", "url": "https://files.pythonhosted.org/packages/f6/3a/946de4d7abe61c513be012fa07efddcc73f02cbfd227d11961e5370956ee/hg-autohooks-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8edb930c5a98a8b0a20532376c13a01b", "sha256": "1a7fc5e21ac10d0d1981b71c81535aedafe8d0085ae6bc5c356cc8812ef810c9" }, "downloads": -1, "filename": "hg-autohooks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8edb930c5a98a8b0a20532376c13a01b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9881, "upload_time": "2015-05-22T00:24:08", "url": "https://files.pythonhosted.org/packages/f6/3a/946de4d7abe61c513be012fa07efddcc73f02cbfd227d11961e5370956ee/hg-autohooks-0.1.0.tar.gz" } ] }