Jump to content

Diff with Mercurial/TortoiseHg


Go to solution Solved by miryamgsm,

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

Link to post
Share on other sites
  • 3 weeks later...
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

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

Link to post
Share on other sites
  • Solution
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
Link to post
Share on other sites
  • 2 months later...
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

Link to post
Share on other sites
  • 3 months later...

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?
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...