I think you are just looking for this:
hg pull hg up --clean
This will lead to the latest patch set from the remote repo and then update the local repository with a clean copy, regardless of whether you made any changes to the files. No merge required.
The only caveat is that if you added files to your local repository and they were not committed, they will be lost (left in place, but not in the repository) after the update. If you execute hg stat , you will see that they are indicated by question marks. If the added files were transferred to your local repository, Mercurial will correctly clean up after them.
Here's the remote repository (remote rev 6):
Mode LastWriteTime Length Name
Here's the local repository (cloned from remote version 4 earlier) with the modified and added files (local rev 5):
Mode LastWriteTime Length Name
Here's the local repository after doing pull and clean update (local rev 6):
Mode LastWriteTime Length Name
Changes to sample.txt were destroyed, addedtolocal.txt was deleted and addedtoremote.txt was added.
Andy s
source share