DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Mercurial: Early Thoughts

Mercurial: Early Thoughts

Mark Needham user avatar by
Mark Needham
·
Apr. 12, 10 · Java Zone · Interview
Like (0)
Save
Tweet
7.30K Views

Join the DZone community and get the full member experience.

Join For Free

We're using Mercurial as our source control system on the project I'm working on at the moment and since I've not yet used a distributed source control system on a team I thought it'd be interesting to note some of my initial thoughts.

One of the neat things about having a local repository and a central one is that you can check in lots of times locally and then push those changes to the central repository when you want everyone else to get the changes that you've made.

So far we've been pushing much more frequently than would usually be the case using something like Subversion. For example I checked in after doing some tidy up on unused references whereas with Subversion I'd probably have included that as part of another checkin.

It actually makes development more fun and reminds me of a kata I did while checking in almost every minute last year.

We're all still very much learning Mercurial but these are some of the commands that we've found ourselves using a lot so far:

  • To check if there are any changes to pull from the central repository:
    hg incoming
    hg in
  • To check if we have any changes that we haven't pushed to the central repository:
    hg outgoing
    hg out
  • To add any unversioned files and remove any missing files:
    hg addremove
  • To remove a file from the repository and from the file system:
    hg remove /file/name
  • To remove a file from the repository on the next commit but not remove it from the file system:
    hg forget /file/name
  • To pull any changes from the remote repository and update your repository with them:
    hg pull -u

    This one only completely works if you don't have any changes locally on the files you're pulling in. Otherwise you'll need to do a 'hg merge' afterwards.

    It seems like there's a lot more merging to do when using Mercurial than with Subversion which we're still getting used to but seems to be more natural as we use Mercurial more.

  • To undo committing a file locally:
    hg rollback
    hg ci -X /file/to/not/commit -m"message and so on"

I've found Mercurial: The Definitive Guide by Bryan Sullivan and Joel's hginit to be useful resources for learning more about this tool.

 

From http://www.markhneedham.com/blog/2010/04/10/mercurial-early-thoughts/

source control

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 7 Features in Jakarta EE 10 Release
  • Spring, IoC Containers, and Static Code: Design Principles
  • Top 10 Automated Software Testing Tools
  • Migrating Legacy Applications and Services to Low Code

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo