Jump to content
Sign in to follow this  
smhillary

Diff with Mercurial/TortoiseHg

Recommended Posts

I have set up mercurial to use SemanticMerge for my diff and merge tool as per the instructions here: http://www.semanticmerge.com/documents/SemanticMerge-Mercurial.pdf .

 

I can merge files ok but if I try and "diff to parent" for a class (from TortoiseHg workbench) a SemanticMerge menu appears displaying merge and diff options. Using Process Explorer shows that no arguments were passed to SemanticMerge when it started.

 

I have consulted the documentation for extdiff here http://mercurial.selenic.com/wiki/ExtdiffExtension and I cannot see how SemanticMerge should be setup in the mercurial.ini.

 

I am using TortoiseHg 2.8.2, Mercurial 2.6.3 and SemanticMerge 0.9.34

Share this post


Link to post
Share on other sites
Hi smhillary,

 

Sorry for the inconveniences.

 

We have reviewed the guide available to configure semanticMerge with Mercurial and we found a mistake in the "mercurial.ini" file.

To properly configure it, we need replace the [extdiff] and [tortoisehg] sections as these:

 

[extdiff]

cmd.semanticdiff = C:\Users\<yourname>\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe

opts.semanticdiff = -s=$parent -d=$child

 

[tortoisehg]

vdiff = semanticdiff

 

Thanks for reporting! ;)

 

Best regards,

Míryam

Share this post


Link to post
Share on other sites

I have the same issue (diffing a modified shows the launcher; haven't had a conflicting merge to try so far), but adding the missing "diff" suffix didn't work.

Here is my mercurial.ini (minus the sensitive info ;) :

[ui]
username=***

[auth]
bitbucket.org.prefix=bitbucket.org
bitbucket.org.username=***
bitbucket.org.password=***

[diff]
ignorews = True
ignorewsamount = True
ignoreblanklines = True

[patch]
eol = auto

[annotate]
ignorews = True
ignorewsamount = True
ignoreblanklines = True

[tortoisehg]
postpull = update
tabwidth = 4

[extensions]
hgext.mq = 
hgext.purge = 
hgext.rebase = 


# Semantic Merge section
# http://www.semanticmerge.com/documents/SemanticMerge-Mercurial.pdf

[extensions]
extdiff =

[extdiff]
cmd.semanticdiff = D:\Users\Benoit FOULETIER\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe
opts.semanticdiff = -s=$parent -d=$child

[merge-tools]
semantic.executable = D:\Users\Benoit FOULETIER\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe
semantic.premerge=False
semantic.binary=False
semantic.args=-b=$base -s=$local -d=$other -r=$output -l=csharp
semantic.gui=True
semantic.checkconflicts=True

[merge-patterns]
**.cs = semantic

[tortoisehg]
vdiff = semanticdiff

[ui]
merge = semantic

# end Semantic Merge section

Share this post


Link to post
Share on other sites
Hi benblo,

 

I checked my mercurial.ini after adding your configuration and it worked fine.

 

Please, could you check the TortoiseHg settings? In TortoiseHg Workbench > File > Settings, the global settings and the repository settings.

It should load the new configuration of the mercurial.ini.

 

Thanks in advance

Míryam

Share this post


Link to post
Share on other sites

Aaah ok, the configuration was correct in the global, but this particular depot still had "semantic" selected as the visual diff tool, instead of "semanticdiff". It works now, thanks :) !

Share this post


Link to post
Share on other sites
Hi all,
 
We have improved the instructions to configure SemanticMerge with Mercurial, it is available here: http://www.semanticmerge.com/sm-guides/main.shtml#HowtoconfigurewithMercurial
 
For example, this is the mercurial configuration to launch the semanticmerge tool for csharp files and to set the kdiff3 tool as the default tool.
[extensions]
extdiff =

[extdiff]
cmd.semanticdiff = C:\Users\mgomez.CODICE\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe
opts.semanticdiff = -s=$parent -d=$child

[merge-tools]
semantic.executable = C:\Users\mgomez.CODICE\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe
semantic.premerge=False
semantic.binary=False
semantic.args=-b=$base -s=$other -d=$local -r=$output -l=csharp
semantic.gui=True
semantic.checkconflicts=True
kdiff3.executable = C:\Program Files\KDiff3\kdiff3.exe
kdiff3.args = $base $local $other -o $output

[merge-patterns]
**.cs = semantic
**.** = kdiff3

[diff-patterns]
**.cs = semanticdiff
**.** = kdiff3

[tortoisehg]
vdiff = semanticdiff

[ui]
username = Miryam <mgomez@codicesoftware.com>
merge = semantic
verbose = True

 

Best regards,

Míryam

Share this post


Link to post
Share on other sites

I'm currently trying to get SemanticMerge set up with diffs in mercurial. Here is my mercurial.ini file:

 

[extensions]
extdiff =
 
[extdiff]
cmd.semanticdiff = C:\Users\elbryant.SRPCORP\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe
opts.semanticdiff = -s=$parent -d=$child
 
[merge-tools]
semantic.executable = C:\Users\elbryant.SRPCORP\AppData\Local\PlasticSCM4\semanticmerge\semanticmergetool.exe
semantic.premerge=False
semantic.binary=False
semantic.args=-b=$base -s=$other -d=$local -r=$output -l=csharp
semantic.gui=True
semantic.checkconflicts=True
kdiff3.executable = C:\Program Files\KDiff3\kdiff3.exe
kdiff3.args = $base $local $other -o $output
 
[merge-patterns]
**.cs = semantic
**.** = kdiff3
 
[diff-patterns]
**.cs = semanticdiff
**.** = kdiff3
 
[tortoisehg]
vdiff = semanticdiff
 
[ui]
username = Lee Bryant
merge = semantic
 
When I try to do a diff on a cs file, I get the following error: Duplicate argument -s
 
Is there something that I'm missing?

Share this post


Link to post
Share on other sites

Hi,

 

Could you try removing:

 

Remove <"-s="> and <"-d="> from <"opts.semanticdiff"> line in Mercurial.ini. If these parameters are specified, Mercurial send duplicated parameters to SemanticMerge.

 

Regards,

Carlos

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...