IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Switch between Mercurial working directories

Last modified: 10 August 2022

The Mercurial integration with IntelliJ IDEA provides the possibility to switch update the repository's working directory to the specified changeset or a specific line of development. Changesets can be identified by their hashes or by previously assigned tag identifiers.

You can update a named branch or a bookmark to another named branch, another bookmark, or a specific changeset identified by a tag or a revision number.

  • Updating a named branch or a bookmark to another named branch or bookmark means updating to its head.

    Updating to named branches and bookmarks can be invoked through the menu item VCS | Mercurial | Update to, which opens the Mercurial-specific Switch Working Directory dialog of from the Branches list.

    Merge from branches

  • Updating a named branch or a bookmark to a changeset means updating the branch head to the specified changeset. A changeset can be identified either by a revision number or a tag, see https://www.mercurial-scm.org/wiki/Tag.

    Updating a named branch or a bookmark to a specific changeset can be invoked only through VCS | Mercurial | Update to.

By default, Mercurial requires that before update the current working directory should be clean, that is, it should not contain any uncommitted changes. Otherwise the update operation fails and IntelliJ IDEA shows the corresponding error message. The message also recommends that you clean the current working directory by running the hg update <target branch, bookmark, or changeset> -C to discard the uncommitted changes.

If your current working copy is not clean, you can either commit the changes or shelve them as described in Shelve and unshelve changes. IntelliJ IDEA provides the possibility to discard any uncommitted changes when the update operation is already invoked. This option is available only in the Mercurial-specific Switch Working Directory dialog.