Now, merging is pretty easy if you are working with just text files and TortoiseHg provides tools to help you merge multiple changes. Issues arise where you are working with binary files (like SolidWorks) because TortoiseHg and Mercurial don't know what tools to use to properly merge them.
Say your team is working on a project and you just made some changes and committed them to your local repository. Now you want to send those changes to the shared repo so the rest of the team can have them in their designs.
Step 1: Sync with the shared repository and pull any changes. Follow the directions in this previous post to set up the sync. If anyone else on the team has pushed changes to the shared repository you should get them, and if they've made changes to files that you've made changes to you should see a branch in the Workbench.
Step 2: Right-click on the tip of the branch and select "Merge with local..."
This will show you the two branches that will be merged. Click "Next"
TortoiseHg will give you a summary of the merge letting you know that files need to be resolved before committing. If you click on the resolve link you will see this screen:
This gives you a list of the unresolved files and some buttons for resolve actions on each file.
Mercurial Resolve - Mercurial will attempt to resolve the conflicts, this probably won't work since we're working with binary files
Tool Resolve - this will use the default merge tool to allow you to resolve the conflicts, but none of the tools that come with TortoiseHg know how to handle SolidWorks files. There may be a solution to this...
Take Local - this will resolve the conflicts by saying the local file is the one you want to keep
Take Other - this will resolve the conflicts by saying the file you pulled in is the one you want to keep
Mark as Resolved - this will mark the file as resolved, basically keeping your local copy
If you want you could open the file from the shared location in SolidWorks, see what changes were made and then open your local file and make the changes. If you did this then you would use the Mark as Resolved button. But there may be an easier way.
Right-click in your local repository and select Global Settings. Look for the Three-way Merge Tool setting and select "internal:dump".
Now when you are in the resolve window and hit the Tool Resolve button Mecurial will dump out a set of files for the file being resolved.
.base - this is a copy of the file that is parent to the one with changes, so it is the version without either your changes or the other user's changes
.local - this is a copy of your file
.orig - this is also a copy of your file
.other - this is a copy of the other user's changes
Step 3: Now, if you add the proper file suffix (.sldprt, .sldasm, .slddrw) to .other you will be able to see the other user's changes and can incorporate them into your local file. Make sure you are saving the changes over the main file and not one of the .* files, otherwise your changes won't end up in the repository when you commit. Once you do this you can go back to the resolve window and select Mark as Resolved. Repeat this for all the unresolved files and make sure to delete all the .* files that were created.
Step 4: Now that you've resolved all the files you can commit the changes to your local repository and push them up to the shared one. When the other people on your team pull in the changes from the shared repository they will see your merge and get the updated file with both your changes and the one you incorporated from the other user.
I don't mean to make light of resolving changes with SolidWorks. It can still be a time consuming step to incorporate the other user's changes into the design. I do think that being able to easily get at the .base file can make this easier allowing you to start from the same point that both you and the other user did when the changes were made.
It may be possible to create a SolidWorks macro to help with all this. Mercurial has the ability to use custom merge tools and someone could write one that ran a macro which uses the .* files.
All this was done using TortoiseHg 2.2 with Mercurial 2.0