Search code examples
mercurial

Mercurial: How do I find out the difference between my working copy and another copy


I am new to Mercurial and mostly worked on Clearcase.

Before I pull in changes from the latest branch, I would like to know the changes that are there and which files have conflicts. (Mainly to see if I should do a update now or later.)

Is there any way do do a hg diff between a working copy and another?


Solution

  • You can check what changes are in the other repository using:

    hg incoming path
    

    This is basically like pull, however it doesn’t actually pull.

    But actually, you can usually just pull, because pulling incoming changesets doesn’t touch your working copy. Only when you update or merge does your working copy get updated, with a risk for conflicts.

    Ideally there would be an option on update and merge to do a tentative merge, that is, it would merge unless there is a conflict, but afaik such an option currently does not exist yet.

    Once the changes are pulled into your repository though, you can use diff to compare it with your working copy as usual.

    hg diff -r tip