{"id":21980007,"url":"https://github.com/jenkinsci/mercurial-plugin","last_synced_at":"2025-04-04T06:09:52.530Z","repository":{"id":858939,"uuid":"1163705","full_name":"jenkinsci/mercurial-plugin","owner":"jenkinsci","description":"Integrates the Mercurial version control system with Jenkins","archived":false,"fork":false,"pushed_at":"2025-03-01T14:39:25.000Z","size":1508,"stargazers_count":55,"open_issues_count":3,"forks_count":120,"subscribers_count":99,"default_branch":"master","last_synced_at":"2025-03-28T05:11:52.554Z","etag":null,"topics":["adopt-this-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/mercurial/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-13T05:49:17.000Z","updated_at":"2025-03-01T14:39:29.000Z","dependencies_parsed_at":"2023-07-05T19:18:15.841Z","dependency_job_id":"597624ba-4ea8-457c-a8c8-1b54d4fd4d64","html_url":"https://github.com/jenkinsci/mercurial-plugin","commit_stats":{"total_commits":1140,"total_committers":76,"mean_commits":15.0,"dds":0.7166666666666667,"last_synced_commit":"fa1c007006fdf95e37d15dd89962af642cdc2b4c"},"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fmercurial-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fmercurial-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fmercurial-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fmercurial-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/mercurial-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128753,"owners_count":20888235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adopt-this-plugin"],"created_at":"2024-11-29T17:09:03.602Z","updated_at":"2025-04-04T06:09:52.512Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jenkins Mercurial Plugin\n=========================\n\n[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/mercurial.svg)](https://plugins.jenkins.io/mercurial)\n[![GitHub release](https://img.shields.io/github/release/jenkinsci/mercurial-plugin.svg?label=release)](https://github.com/jenkinsci/mercurial-plugin/releases/latest)\n[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/mercurial.svg?color=blue)](https://plugins.jenkins.io/mercurial)\n\n\nThis plugin integrates the [Mercurial version control\nsystem](https://www.mercurial-scm.org/) with Jenkins.\n\nWith this plugin, you can designate a Mercurial repository as the\n\"upstream\" repository. Every build will then run something like\n`hg pull -u` to bring the tip of this upstream repository. In a similar\nmanner, polling will check if the upstream repository contains any new\nchanges, and use that as the triggering condition of the new build.\n This plugin is currently intended to support Mercurial 1.0 and later.\n\nViewers are included for various hosted services.\n\n### Push Notifications\n\nAs of version 1.38 it's possible to trigger builds using push\nnotifications instead of polling. In your repository's .hg/hgrc file\nadd:\n\n``` ini\n[hooks]\ncommit.jenkins = wget -q -O /dev/null \u003cjenkins root\u003e/mercurial/notifyCommit?url=\u003crepository remote url\u003e\nincoming.jenkins = wget -q -O /dev/null \u003cjenkins root\u003e/mercurial/notifyCommit?url=\u003crepository remote url\u003e\n```\n\nThis will scan all the jobs that's configured to check out the specified\nURL, and if they are also configured with polling, it'll immediately\ntrigger the polling (and if that finds a change worth a build, a build\nwill be triggered in turn.)\n\nThis allows a script to remain the same when jobs come and go in\nJenkins. This URL also doesn't require authentication even for secured\nJenkins, because the server doesn't directly use anything that the\nclient is sending. It runs polling to verify that there is a change,\nbefore it actually starts a build.\n\nWhen successful, this will return the list of projects that it triggered\npolling as a response.\n\nJobs on Jenkins need to be configured with the SCM polling option to\nbenefit from this behavior. This is so that you can have some jobs that\nare never triggered by the post-commit hook, such as release related\ntasks, by omitting the SCM polling option.\n\nAs of version 1.58 there is a new improved push notification that will\nresult in less work for Jenkins to determine the projects that need to\nbe rebuilt. This new hook is achieved by adding `branch` and\n`changsetId` parameters to the notification URL. Newer versions of\nMercurial can achieve this with an in-process hook such as\nthat shown in test sources in [hook.py](https://github.com/jenkinsci/mercurial-plugin/tree/master/src/test/resources/hook.py)\n\n## Windows/TortoiseHG Integration \n\nThere are some caveats to running TortoiseHG on windows, particularly\nwith ssh. Here are some notes to help.\n\n**Prerequisites:**\n\n-   If you use 64bit TortoiseHG, you may need to run your Jenkins\n    instance from a 64bit jvm to allow ssh support. If not, the initial\n    clone will hang.\n-   For ssh support, you will either  need putty/pageant installed to\n    send the proper keys to the server if the keys are password\n    protected, or you will need to specify the change in the ui section\n    mercurial.ini found in C:\\\\Users\\\\username\\\\mercurial.ini to use a\n    specific key:\n        \n     ``` ini\n     [ui]\n     ssh=\"C:\\program files\\tortoisehg\\TortoisePlink.exe\" -i \"C:\\Users\\username\\key_nopass.ppk\"\n     ```\n\n-   To accept the host key, use plink or putty to connect to the server\n    manually and accept the key prior to the initial clone. You can also\n    use the tortoiseplink.exe that's provided with the TortoiseHG\n    installation to do this, or just use TortoiseHG to clone to another\n    location on the machine.\n-   If you are running Jenkins as a Windows service, accessing pageant\n    key will likely not work. In this case, use a key without passphrase\n    configured in mercurial.ini\n-   The default installation runs windows service with \"local system\"\n    account, which does not seem to have enough priveleges for hg to\n    execute, so You could try running Jenkins service with the same\n    account as TortoiseHG, which will allow it to complete.\n\nExample, from a command prompt: \n\n    \"C:\\program files\\tortoisehg\\TortoisePlink.exe\" user@hg.example.com\n\nClick 'Yes' on the host key dialog. You can then cancel the next dialog\nprompting for password.\n\n**Main Configuration, Step by Step:**\n\n1.  Install the Jenkins Mercurial Plugin.\n2.  Under \"Manage Jenkins\", \"Configure System\", find the \"Mercurial\"\n    section and add your Mercurial instance.\n\n![](docs/images/mercurial.png)\n\n3\\. Save the configuration.\n\n**Job Configuration**\n\n1.   Select Mercurial under Source Code Management\n2.   Make sure you select the name of the Mercurial installation\n    specified above. In my case, \"TortoiseHG\"\n3.   The url can either be ssh or https.\n\nExample SSH URL:\n\n    ssh://hg@bitbucket.org/myuser/projectname\n\n**Other Windows+TortoiseHG+ssh notes:**\n\nTortoiseHG integrates directly with pageant/putty for it's ssh\nconnections, and the toolkit in jenkins only calls the executable, so it\nlooks like:\n\nJenkins -\\\u003e Mercurial Plugin -\\\u003e TortoiseHG \\\u003e plink/pageant\n\nTherefore, Jenkins has no direct influence on the SSH key setup for the\nuser. This differs from the linux/cygwin environment where the ssh keys\nby convention are stored under \\~/.ssh. \n\n## Environment Variables\n\nThe plugin exposes two new environment variables that can be used in\nbuild steps:\n\n-   MERCURIAL\\_REVISION: the changeset ID (SHA-1 hash) that uniquely\n    identifies the changeset being built\n-   MERCURIAL\\_REVISION\\_SHORT: the short version of changeset ID (SHA-1\n    hash) that uniquely identifies the changeset being built\n-   MERCURIAL\\_REVISION\\_NUMBER: the revision number for the changeset\n    being built. since this number may be different in each clone of a\n    repository, it is generally better to use MERCURIAL\\_REVISION.\n\n## Auto Installation\n\nThe plugin supports generic tool auto-installation methods for your\nMercurial installation, though it does not publish a catalog of\nMercurial versions. For users of Linux machines (with Python\npreinstalled), you can use ArchLinux packages. For example, in\n`/configure` under Mercurial installations, add a Mercurial installation\nwith whatever Name you like, Executable = `INSTALLATION/bin/hg`, Install\nautomatically, Run Command, Label = `linux` (if desired to limit this to\nagents configured with the same label), Command =\n`[ -d usr ] || wget -q -O -`\n`http://www.archlinux.org/packages/extra/i686/mercurial/download/`\n`| xzcat | tar xvf -` (or `…/x86_64/…` for 64-bit agents), Tool Home =\n`usr`, and configure a job with this installation tied to a Linux agent.\n\n## Version History\n\n### Versions 2.7 and later\n\nSee [GitHub\nreleases](https://github.com/jenkinsci/mercurial-plugin/releases).\n\n### Earlier versions\n\nPlease refer to the [changelog](CHANGELOG.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fmercurial-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fmercurial-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fmercurial-plugin/lists"}