Merge with TortoiseHG

From LabVIEW Wiki
Jump to: navigation, search

TortoiseHG is a client to Mercurial.

This page will show the steps needed to perfrom a visual merge between two branches of one repository. Prerequisites:

  • Working TortoiseHG
  • Configured Merge-Tools
  • LabVIEW Professional

We start with a Repository A that has a file 'ToMerge' that contains a string constant with the contents 'Repository A'.This file is committed to Mercurial, we clone the repository to Repository B, and edit the string constant to 'Repository B' and commit the edit. In repository A we change the constant to 'Repository A edited', save and commit the changes. In repository B we perform a Pull (since we cloned from repository A we pull per default from repository A).

HG.MergeBeforeCommit.png

This shows the repository B changesets (if you pulled B into A changes 1 and 2 would be switched). Now the merging begins:

  • Rightclick changeset 2 and select 'Merge with local'

The following dialog appears:

HG.PreparetoMerge.png

Click Next>

HG.Merging.png

Click on the underlined word 'Resolved'

HG.Resolve.png

Make sure you do the following things:

  1. Select the file you want to merge
  2. Select LVMerge as the MergeTool
  3. Hit 'Tool Resolve'

This will launch LVMerge, and will show the three versions of the VI together with an editable version of the VI to save the actual Merge Result. HG.LVMerge.png

Select Close, and LabVIEW will ask if you want to save the edits (you can easily chose yours or theirs versions).

TortoiseHG will return and the file will have moved into the 'Resolved conflichts' list: HG.Resolved.png

You can edit the resulting file, view the diffferences between the different versions if you want.

Use the close button to finalize the resolve conflicts. Then you will need to add a comment about the merge, and the merge will be committed to Mercurial. Make sure you push the merge to Repository A so that is up to date as well.

Here's the result of the merge:

HG.MergeResult.png