简体   繁体   中英

Beyond compare with Mercurial: How to get refresh & save to work properly?

I am trying to configure beyondcompare with mercurial to setup several workflows.

Currently I can do this:

  • Launch hg bcompare or hg bcompare --rev <something>
  • Make some changes to the file on the right
  • Save in beyond compare
  • Close beyond compare
  • Refresh my editor/IDE
  • Make changes in editor/IDE
  • Relaunch beyond compare

What I would like to do is this:

  • Launch hg bcompare or hg bcompare --rev <something>
  • Make some changes to the file on the right
  • Save in beyond compare
  • Refresh my editor/IDE
  • Make changes in editor/IDE
  • Refresh beyond compare

At the momement this workflow isn't working but I can't seem to figure out if it is beyond compare or mercurial that is messing things up. I can see that the file that is in the right-hand pane in beyond compare is in this directory: /tmp/extdiff.MIGT6x/dir .

Where is this directory coming from? Is there a way that I get beyondcompare to do a full diff between revisions (I know this will be slower)?

Alternatly, is there a way I can get beyond-compare's save to write the file to the real location and get beyond-compare's refresh to work properly?

I setup beyond-compare as described on the Beyond Compare site :

[extensions]
hgext.extdiff =

[extdiff]
cmd.bcompare =

[merge-tools]
bcomp.executable = /usr/bin/bcompare
bcomp.args = $local $other $base $output
bcomp.priority = 1
bcomp.premerge = True
bcomp.gui = True

在此输入图像描述

The 'extdiff' extension (which is what I expect you're using to be able to show your changes in bcompare), uses 'hg status' to check what files are different between 2 revisions (or between the current working directory and a revision).

It then copies all the files that are different to two temporary directories and calls bcompare (or any other difftool) to compare those two directories.

Benefits to this approach:

  • Only a small amount of files need to be compared (so the difftool itself doesn't need to traverse all the files)
  • There's no need for every difftool to add Mercurial support, the tools only need to support diffing 2 directories

The downside of course is that editing inside the difftool will not show an effect in your repository. In other words: it's not possible to do this the way you want.

What Mathiasdm said in their answer is correct in that HG creates temporary files which it then tells Beyond Compare to start a diff on.

If you still wish to save the edits you make to the temp file, the best alternative would be to use the Save As command and point it to the existing file in your repo. That being said, if all you want to do is edit the current working file, you can just edit the left side (working copy) and save the changes directly. Other than that, there isn't a way to force Beyond Compare to do a diff on files that aren't temp files, since the files are generated by HG.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM