3

I have two development machines. One machine is setup to use a specific Mercurial account. I'd like to setup the second machine in exactly the same way, using the same Mercurial account. As I switch between machines I will push and pull changes to keep the two dev machines in sync.

Will Mercurial cope ok with this scenario, or should I create a second Mercurial account for this purpose?

My worry is that Mercurial will 'see' the same account on the second machine and not synchronize properly because it 'thinks' the second machine already has the changes (which are actually only present on the first machine).

I'm using VS2010, TortoiseHg and VisualHg.

Thanks.

1
  • I put in a request to change the tags to exclude the VS references, and include tortoiseHg.
    – Origin
    Jan 2, 2012 at 11:46

1 Answer 1

8

Using the same account will work perfectly fine.

Mercurial will look at what is actually in the local copy when pulling changes and updating, the fact that you have another clone on another machine using the same credentials will not affect it at all.

Your credentials are really only used to authenticate you (to ensure you have permission to read when pulling and write when pushing) and to label each commit with the user who made it.

You can even have multiple local copies cloned from the same repository, using the same credentials. Each copy tracks its own state - each revision has a unique id that is used to synchronize changes.

If you have not already, I recommend reading this Mercurial tutorial.

3
  • beat me to it :). Mercurial only uses your user information to tag who has committed updates.
    – Origin
    Jan 2, 2012 at 11:48
  • @Origin: That is a good additional point (tagging the commit with the username), I hope you don't mind I added it to my answer. Jan 2, 2012 at 11:53
  • Not at all. Had I been a bit quicker to answer I might be merging your comments into mine. Can't be first on everything :)
    – Origin
    Jan 2, 2012 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.