Committing to a Mercurial project

After changing the files and making sure that everything is working properly the developer will want to send those changes to the server.

In this recipe we will see how to do this using Mercurial.

Getting ready

For more information on how to get the Mercurial sources and repositories up and running for this recipe, please refer to the Getting Ready section of the Creating a Mercurial Project recipe in this chapter.

How to do it...

To delete a file follow the steps below:

  1. Expand the Project node, Source Packages, and nbcookbookhg.
  2. Right-click on the NBCookbookHG.java and select Delete.
  3. On the Delete Window choose Safe Delete option and click on Refactor.

To create a file:

  1. Right-click on the now empty nbcookbookhg package and select New and Java Class....
  2. On the New Java Class window under Name and Location, write under Class Name Car and click Finish.
  3. Enter the following code inside of Car.java.
    String model;
    String plate;
    int year;
    int price;
    String color;
    
  4. Save it.

To commit code:

  1. Right-click on the project node and select Mercurial and Commit....
  2. On the Commit window enter as Commit Message, first commit and click on Commit.
How to do it...

How it works...

By clicking on the Commit button NetBeans sends the modifications to the Mercurial server.

NetBeans interfaces with Mercurial on behalf of the user to abstract all the command line work with a simple and intuitive UI.

There's more...

Need to revert to a certain version?

For moments when that commit did not sit so well

To revert to an earlier version execute the following steps:

  1. Right-click on the project node, select Mercurial and Revert....
  2. The Revert Modifications window presents the developer with the latest commit.
    For moments when that commit did not sit so well
  3. On the Revert Modifications window on the Choose from Revisions select the desired revision and click on Revert.
For moments when that commit did not sit so well
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.239.155