Mercurial Tasks: Quick Reference

See Also

The following table describes common Mercurial tasks.

To perform this task: Follow these steps:
Place a Project under Mercurial Version Control
  1. Select the NetBeans project you wish to put under Mercurial version control.
  2. Either choose Team > Mercurial > Initialize Repository from the main menu, or
  3. Choose Versioning > Initialize Mercurial Project from the right-click menu of a node in the Projects, Files or Favorites window.

The project is placed under Mercurial control. You will then need to Commit the Project files.

Clone an External Repository
  1. Choose Team > Mercurial > Clone Other from the main menu.
  2. In the Mercurial Clone Other wizard, specify the location of the Mercurial repository, and click Next.
  3. In the Parent Directory, specify the location on your computer where you want the Clone to reside.
  4. In the Clone Name, specify the name of the Clone.
  5. Click Finish to Clone the remote repository.
View versioning information
  1. Select a project, directory, or file that is in a Mercurial working directory
  2. Choose Mercurial > Status from the right-click menu of a node in the Projects, Files or Favorites window. The Status Window opens to display versioning information on the selected item(s).
Diff files
  1. Select the file that you want to perform a diff on.
  2. Choose Mercurial > Diff from the right-click menu.
Update project
  1. Select the project that you want to update
  2. Choose Mercurial > Update from the right-click menu.
  3. This will update the working directory to match the repository contents.
Commit changes
  1. Select the file or directory that you want to commit.
  2. Choose Mercurial > Commit from right-click menu.
Create a patch
  1. Select the locally modified file or folder and choose Team > Export Diff from the main menu.
  2. Select the revision to export.
  3. Enter a name and location where you want to save the patch.
  4. The default is to place it in /tmp/%b_%r_%h. Where %b = Project Name, %r = revision and %h = ChangeSet ID
  5. Click Export.
Import a patch
  1. Select the Mercurial-versioned Project and choose Team > Import Patches from the main menu.
  2. Type the path or navigate to the patch file you want to apply.
  3. Click Ok.
Push to default
  1. Select the Cloned Mercurial Project you want to Push changes to.
  2. Choose Mercurial > Push to default from right-click menu.
  3. This will Push changes to the Clone's parent Repository.
Pull from default
  1. Select the Cloned Mercurial Project you want to Pull changes into.
  2. Choose Team > Share > Pull from default from the main menu. This will Pull changes from the Clone's parent Repository.

Notes:

See Also
About Mercurial

Legal Notices