It will allow you to modify the previously made commit, and enter the correct commit message or select the correct file list. When using a Mercurial GUI client, just commit again with selecting the "Amend" option. Just use hg add and hg rm to modify the index, then make a hg commit -amend to re-commit the changes. You can also use the -amend option to modify the list of files in the commit. Hg commit -amend -m "PLYR-419 fixed: closing the video outstream" If it was the last commit that needs to be fixed, you can easily rewrite its commit message like this: The whole set of commits will be rejected if there is only commit that doesn't satisfy the conditions prescribed by the policy. When you finally do push, all commits will be verified in one go. Thus, the verification of the commit policy is delayed until you push your changes to the blessed repository. In Mercurial, you can create any number of commits without communicating with the blessed repository. If this feature would be important to you, please vote and comment on this feature request. Therefore, commit policies will not work automatically in a clone, after cloning a repository with the hook scripts set up.Īlthough Mercurial doesn't support this directly, we have several ideas to work around this limitation. Mercurial, unfortunately, does not clone the hook scripts when cloning a remote repository. These allow to verify when the developer commits a change, that may be well before he pushes that! Scripts executed by the hooks in the developers' local clones represent the earliest opportunity to verify commit policies. This feature is not available in the app yet, but we're seriously considering this. It is important to note that the earliest (thus best) opportunity to validate a commit policy would be in the developer's local clone repositories, using so-called client-side hooks. You can modify the rules any time, and those changes will be immediately reflected in all the repositories referencing them. This ensures that the rules are verified consistently in the blessed repository and all clones. When the hook script is installed to multiple repositories, all the hook scripts should verify the same policy. The sooner a commit gets rejected, the cheaper to fix it. Installing the hook scripts to these additional repositories will make your policies more efficient, as they are verified earlier in the process. In addition, you can also install the hook script to all the developer forks and in-between repositories. It is absolutely critical to verify the commit policy there. The blessed repository is the central hub for the developers, and it contains the reference source code. The hook script must be installed to the blessed repository, at least. The distributed nature of Mercurial allows you to select between multiple workflows.Īccordingly, you also have some flexibility in choosing where to install the hook scripts. Working with Mercurial commit policies Installing Mercurial commit hooks This question is specifically about the TortoiseHg GUI client.This page is about implementing Better Commit Policy with the Mercurial version control system.įor non-Mercurial-specific information, please see the starting page of the user manual. I know how to do all of this using the Mercurial command line client - hg.exe. Is there an hg pull -b BRANCH equivalent in TortoiseHg? In all of them TortoiseHg actually pulls all of the branches (even in the second, where the pulled revisions are arranged into a bundle presented in the incoming revisions view) I dislike all of these solutions, since all of them are client based. Use the Mercurial ACL extension to deny access to all the branches, but the current one. Check incoming revisions in TortoiseHg and only pull the ones belonging to the current branch.Setup a hook on the client side to reject pulls from unwanted branches.Is it possible to instruct it to pull from the current branch only? However, TortoiseHg proposes to pull from all the branches. I have cloned the default branch of a big repository and now I wish to pull from the server using the TortoiseHg client.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |