I have some custom diff software that I'd like to use to compare versions. To do this I need to have both the old (local) version of a file, and the pulled version, in the same folder. Is it possible to, on a pull, for any modified files (on the server) rename the local ones, and then pull the newest ones to the same names as before?
Is there any reason you'd want to do this except in the case of a merge conflict? If there's a merge conflict, then both versions are available anyway via hg/git, you can 'resolve using theirs' or 'resolve using mine', or indeed use a merge tool.
If it's just because you want to diff the history, you can do this just by hooking up your diff tool as an external diff option. In Preferences > Diff you can select one of a number of pre-configured tools, or you can set up a custom tool if you want. Then, you can use that to diff from the log either for a single commit's changes, or for a range of commits (multi-select).
OK, so I think what I actually want is to do an diff using an external program. I'm trying to use the latexdiff tool, which takes in two latex documents and returns a third which is the diff. Normal command line usage is:
latexdiff file1.tex file2.tex > diff.tex
I've tried a set up where I put latexdiff in the the "diff command" box and "$LOCAL $REMOTE > diff.tex" in the arguments box, but it doesn't seem to do anything. I'm running OS X 10.8.2 on a Macbook Air, and version 1.5.5 of SourceTree. The repository in question is a Mercurial repository, stored on Bitbucket.
OK, well the external diff tool should work then, because it will be called with 2 parameters, the file instances will just be extracted from the repo on demand and put in a temp folder before the ext diff is called. Although the intention is usually to display a visual tool, there's nothing to say that it has to be that. The only tricky part might be the pipe you're trying to use there, which won't work because it won't be called in a full shell. If there's an --output option or similar, that should work.
This unfortunately may not be doable via the external diff features of git/hg then (ST essentially just sets these up in the ~/.gitconfig etc al). You may just have to use custom scripts to export file contents at given commits and execute your tool on them that way - you can hook up most external scripts to SourceTree via the Custom Action feature in Preferences, including the context of the commit and selected file.
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs