[[PageOutline(2-5,Contents,pullout)]] = Track the status of code repository pull requests == Description This plugin allows you to track the status of your pull requests on your code repository. A **[wikipedia:"pull request"]** (PR) is a request or proposal to submit code changes into a main code repository. ''Pull'' is standard terminology from version control systems like Git or Mercurial. Basically it is a method of submitting contributions. The contributor has a clone of the main repository, pushes the proposed changes to that clone, then submits a pull request. The pull request contains the information required to merge these changes back to the main repository. Usually this means the URL of the repository and a branch (Git) or bookmark name (Mercurial). === Example of PRs created, reviewed and closed in ticket [[Image(PullRequestsExample.png, border=2)]] By default the PR status can be "open", "reviewed" or "closed". The available status values can be [#Configuration configured]. Ticket comments containing a ` PR: [arg]` can [#CreatePullRequest create a PR] or [#ChangeStatusofaPullRequest change its status]. This plugin also adds a [#PRQueryMacro macro that lists the queried pull requests], and it also adds a new admin panel, that lists all pull requests. === Admin panel [[Image(PullRequestsAdmin.png, border=2)]] === Create Pull Request A new pull request is automatically created when a ticket comment contains the command `open PR: `. Examples: * `open PR: changeset:123/ForkRepoName` * `open PR: log:ForkRepoName@branch` * `open PR: [https://www.example.com/git/branches/x BranchX]` The pull request ''number'' is automatically assigned and inserted into the ticket comment. === Change Status of a Pull Request The status of a pull request is automatically changed when a ticket comment contains the command ` PR:`. Examples: * `reviewed PR:3` * `closed PR:7` === Configuration The trac.ini option `[pullrequests] create_commands` can be changed to allow multiple or different commands that [#CreatePullRequest create pull requests] in different states. The status of a created pull request is always the same as the command that was used to create it. The trac.ini option `[pullrequests] update_commands` can be changed to allow different commands that [ChangeStatusofaPullRequets change the pull request status]. The next status of a pull request is always the same as the command that was used to change status. Example configuration: {{{#!ini [pullrequests] create_commands = open, draft, prototype, sketch update_commands = closed, reviewed, accepted, rejected, withdrawn, deferred, superseded, updated, verified, tested, suspended }}} === PRQuery Macro A new macro allows listing all pull requests by author and / or status. Examples: * `[[PRQuery()]]` * `[[PRQuery(status=reviewed)]]` * `[[PRQuery(status=!closed)]]` * `[[PRQuery(status=reviewed, author=joe)]]` * `[[PRQuery(status=open, author=!joe)]]` This allows creating overview wiki pages listing all relevant PRs. == !Bugs/Feature Requests Existing bugs and feature requests for PullRequestsPlugin are [report:9?COMPONENT=PullRequestsPlugin here]. If you have any issues, create a [/newticket?component=PullRequestsPlugin new ticket]. [[TicketQuery(component=PullRequestsPlugin&group=type,format=progress)]] == Download Download the zipped source from [export:pullrequestsplugin here]. == Source You can check out PullRequestsPlugin from [/svn/pullrequestsplugin here] using Subversion, or [source:pullrequestsplugin browse the source] with Trac. ||= Trac =||= Plugin =|| || >=1.4 || [source:pullrequestsplugin/trunk trunk] || || >=1.2 || [source:pullrequestsplugin/tags/pullrequestsplugin-1.1 1.1] || == Installation General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. == Recent Changes [[ChangeLog(pullrequestsplugin, 3)]] == !Author/Contributors **Author:** [wiki:lucid] [[BR]] **Maintainer:** [[Maintainer]] [[BR]] **Contributors:**