Suppress needless dialogs from kdiff3? - mercurial

I use kdiff3 on Windows as the visual merge tool for TortoiseHG / Mercurial.
Often when doing a merge or rebase it will show a dialog like this:
Another variation is that the two files being merged were "binary equal".
Since these messages are basically saying that there is no conflicts / nothing to do, I'd like to suppress them - is that possible?
I don't see anything pertinent in the kdiff3 command line options.

Although having a bit misleading name, --auto option does what you want.
From the documentation:
--auto No GUI if all conflicts are auto-solvable. (Needs -o file)
This help text can also be accessing from the command line with kdiff3 --help.

Related

Select only one line in TortoiseHGs chunk selection for commit

In TortoiseHG there is this chunk-selection for your local changes. How can I select only one line from these chunks to commit? I had this problem a few times now and it's quite annoying you can't select only one line.
TortoiseHG doesn't support this. However you can still get the same functionality with mercurial CLI by setting [ui] interface = curses in your hgrc and then hg commit -i. It will invoke a ncurses based window in which you can select/deselect the individual hunks and lines using spacebar. This is much more powerful than what THG offers.

How to get meld to use hgignore

I've just started using Meld. I'm using its Version Control Diff feature and its working well, except that it doesn't seem to use the .hgignore file.
The tree I'm working in is huge, but I only mercurial-track a small portion, so Meld is taking a loong time to scan the entire tree, 90% of which I could care less about.
I'm using Meld 1.6.0, which doesn't appear to allow the user to manually select the VC type, so I'm forced to start the compare in the directory containing the .hg sub-dir.
Is there a way to get Meld to use the .hgignore file or perhaps override Meld's default VC choice?
I think you should do "the other way around", that is:
configure mercurial to use meld as its "external diff" tool, utilizing "extdiff" extension.
NOTE: All of the above has been tested in UNIX-like environment
in ~/.hgrc enable "extdiff" extension by adding to [extensions] section:
[extensions]
extdiff =
add this below:
[extdiff]
cmd.meld = # if meld is not in your path, you may need to type in here the absolute path to the script
Save ~/.hgrc file.
Now, Then a new hg subcommand shall be available to you.
Enter the hg repo folder, in terminal:
user#machine:~$ cd myrepo
user#machine:~/myrepo$ hg meld
That would spawn meld properly, respectful to .hgignore, mercurial respects itself )
For GUI trickery, you may hook this up to context menus of your favourite file manager:
1. Linux: you may to dance with the Shaman's drum a bit more, but TortoiseHg respects extdiff extension.
1. Windows: TortoiseHg does this automagically
1. Mac: no idea how to do this to Finder :), maybe AppleScripting will be needed here.
Regards.

Mercurial with KDiff3 -- can it directly expand all folders?

With Mercurial, every time a
hg vdiff
which invokes kdiff3, there are 2 steps that need to be done:
1) close the pop up that says how many files are diff'ing
2) go to Directory -> Unfold all Subdirs
Is there a way to skip the step 1 and step 2 and have it automatically expand all folders and show the files?
There are 2 check-boxes available on kdiff3 Version 0.9.98 under Settings -> Configure KDiff -> Directory: "Unfold all subdirectories on load" and "Skip directory report status".
Hrm, that'll be entirely up to kdiff3, but if you can find a command line option that starts kdiff3 out in expanded mode you'll can tweak the vdiff string in the configuration lines for the ExtdiffExtension, which is the feature someone has configured for you. That can be configured in any hgrc which can be per-repo (.hg/hgrc), per-user (~/.hgrc), or system-wide (/etc/mercurial'hgrc). If you don't recall setting it up it's probably in the system-wide location.
If you want to see exactly where as setting is coming from in a recent version of Mercurial you can use the command:
hg --debug showconfig
look for kdiff3 there and you'll find exactly what file and line to tweak.
It doesn't seem possible, as it's not in kdiff3's command line options, and there's no config item for it as seen from kdiff3 --confighelp.
I guess you can hack the source. It's Qt so it can't be hard, can it?
(BTW Beyond Compare has -expandall option that does exactly that. I don't want to sound like I get commission from Scooter Software, but BC is literally beyond any diff/merge tool that I've seen. There's one thing that kdiff3 can but BC cannot, though: 3-directory comparison.)

Mercurial: No editor appears when merge conflicts are detected

I wonder if anyone here has any experience with mercurial running on Ubuntu? I've been playing with it all morning and love everything I've seen so far.
The one problem I though is when I do a merge and conflicts are detected, it doesn't automatically bring the file up in the command line editor to allow me to resolve the conflicts. It just tells me there's a conflict, then it's up to me to open the editor and resolve it.
But this is strange as the docs show that the editor is automatically launched when there is a merge conflict. I know it's not a problem with the editor (nano) in general as it's works when I do a commit and have to add a comment.
Any ideas?
Chris
p.s I already tried the mercurial IRC channel, but silence....
You probably need to define your merge tool in ~/.hgrc:
[ui]
merge = vimdiff
What commands are you using, and what does your ~/.hgrc look like? If you're using the fetch extension, it should be opening up a configured merge tool when a conflict is detected.
I detailed my full mercurial config a while back in a blog post where I use kdiff3 as my merge tool.
When doing an "hg fetch" or an "hg merge" (after a conflict is detected) it launches kdiff3 as you'd expect and lets me resolve the merge.

How to commit only a part of the changes made to a file?

I want to commit separately different parts of the same file.
I want to commit line 2 first with the message (changeset 1) and the 4th line with the message (changeset 2). How do I do it?
I am using Mercurial Distributed SCM (version 3.5.2+20151001)
You can do this with the interactive option to commit.
First add the following to your ~/.hgrc file:
[ui]
interface = curses
Then use:
hg commit -i
This will tell commit to allow you to interactively select what files or (by drilling into the file) select sub file changes.
You can use this multiple times, selecting individual changes in the files.
Note: without the addition to your .hgrc, hg commit -i will ask you for each file and not allow you to drill into and select individual file changes.
The interactive option is also being implemented in other mercurial commands such as restore (you can select what changes are to be restored) and the new experimental amend command. It is very powerful and easy to use.