Issue2076

Title External merge with UltraCompare - issue with spaces in pathnames
Priority bug Status resolved
Superseder Nosy List kiilerix, pietzcker, pmezard, sborho
Assigned To Topics

Created on 2010-03-08.15:14:19 by pietzcker, last changed 2010-03-31.10:18:39 by kiilerix.

Files
File name Uploaded Type Edit Remove
config.txt pietzcker, 2010-03-09.08:46:02 text/plain
merge_ok_without_space.png pietzcker, 2010-03-09.08:49:42 image/png
no_merge_with_space_in_path.png pietzcker, 2010-03-09.08:49:12 image/png
Messages
msg12190 (view) Author: pietzcker Date: 2010-03-31.07:31:11
Sorry for not getting around to testing sooner.

I have been trying around a lot, and I think (!) that I have found the
culprit, and it doesn't seem to be Mercurial.

To explain: There are two programs, uc.com and uc.exe (the latter being the
actual application, the first used as a proxy to enable (as far as I
understand) the passing of stdin/stdout/sdterr to the second). The docs say
that one should always use uc.com, so that's what I had done. 

It appears that uc.com is messing up the command line, because if I pass the
command line directly to uc.exe, everything works just fine as far as I can
tell. I also haven't found a problem yet in using uc.exe instead of uc.com,
so I apologize for the confusion I have caused, and suggest closing this
issue. I will take it up with IDM support instead.

Thank you very much for your time, and, again, sorry for the confusion.
msg12188 (view) Author: kiilerix Date: 2010-03-29.23:16:10
pietzcker, we need input from you in order to get this resolved. 

Or rather, as Mercurial seems to work for others on windows: You need your
input.
msg12166 (view) Author: kiilerix Date: 2010-03-24.11:08:21
abuehl: What do that link tell you - and what are you telling us?

That you and I were wrong in msg11969 and 019506.html?

That evidence from pietzcker can tell us that the documentation is wrong and
can't be trusted?

That the quotation rules are so strange that we shouldn't pretend that our
interpretation always works?
msg12163 (view) Author: abuehl Date: 2010-03-24.08:15:50
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-
us/cmd.mspx?mfr=true
msg12161 (view) Author: kiilerix Date: 2010-03-24.00:53:21
Oh. It is not so simple. See the threads on
http://www.selenic.com/pipermail/mercurial-devel/2006-December/000489.html
and
http://www.selenic.com/pipermail/mercurial-devel/2006-December/000487.html
and the patch http://www.selenic.com/hg/rev/a8c0365b2ace and issue397. The
single spurious quote looks a bit like msg2436 ... but different...

So the current behaviour seems to be there for good reasons and works
correctly for all(?) other users. The problem I (and abuehl?) thought I saw
was just strange windows semantics, and I have no idea what is going on.

pietzcker, can you try to do some experiments with a python interpreter and
some variants of
subprocess.call(r'""C:\Programme\IDM Computer Solutions\UltraCompare\uc.com"
"c:\dokume~1\tim~1.pie\lokale~1\temp\test.txt~base.e7vryp"
"E:\test\test-merge\test.txt"
"c:\dokume~1\tim~1.pie\lokale~1\temp\test.txt~other.u_qxme""', shell=True)
and find out what works and doesn't on your and other machines?
msg12029 (view) Author: kiilerix Date: 2010-03-12.10:06:53
pietzcker: I think everybody agrees this is a Mercurial bug and it is quite
well understood, but the proper fix is not a simple one-liner. Hopefully it
will be fixed for 1.5.1 or 1.6.

It seems like there is no good explanation why it usually works on windows -
andn why it doesn't work in your case. Perhaps you can try to put UC in a
path without space or a shorter path - or try on another machine or another
OS version. Sorry for the woodoo advice ;-)
msg12027 (view) Author: pietzcker Date: 2010-03-12.08:42:35
Sorry about the n00b question - what happens now? Is there anything I
can/should do?
msg11969 (view) Author: abuehl Date: 2010-03-09.15:16:45
util.system is wrong for cmd's containing args. It shouldn't enclose the whole 
cmd into ".." on Windows. The path to the program and path arguments should be 
enclosed in quotes each, not the whole thing.

See also http://selenic.com/pipermail/mercurial-devel/2010-March/019506.html
msg11966 (view) Author: kiilerix Date: 2010-03-09.11:59:37
Ouch.

I think I can see where the problem is ...
msg11965 (view) Author: pietzcker Date: 2010-03-09.11:34:45
@kiilerix: 

The same error occurs when I do a "hg merge" manually in the console window;
I just tried.
msg11964 (view) Author: pietzcker Date: 2010-03-09.11:32:18
I have a different installation where

UltraCompare.executable = C:\Programme\UltraCompare\uc.com

and the same error occurs. The problem is not with spaces in the command's
path/filename but in spaces in the repository's path/filename.
msg11963 (view) Author: abuehl Date: 2010-03-09.11:08:20
@pietzcker: My idea: Could you try and see what happens if you enclose the 
path to uc.com into double quotes?

I mean like this:

[merge-tools]
UltraCompare.executable = "C:\Programme\IDM Computer
Solutions\UltraCompare\uc.com"

(make sure the "UltraCompare.executable = ..." line is on a *single* line, 
disregarding line wrapped bug tracker/email display)
msg11962 (view) Author: kiilerix Date: 2010-03-09.10:46:01
Ok, this is with TortoiseHg gui, so it should probably have been reported in
the tortoisehg tracker. TortoiseHg extends Mercurial in this area.

I have CCed the main developers of TortoiseHg - perhaps they can guide you
further.
msg11958 (view) Author: pietzcker Date: 2010-03-09.08:46:02
No, merge is not working. I'll upload some screenshots of when merge works
(path without space) and when it doesn't (path with space). Seems like only
one upload per post is possible.

I don't think that Process Explorer is wrong because what I see in
UltraCompare is exactly what I would expect with this corrupted command line.

I've attached the output of hg showconfig.

Perhaps it's also relevant to note how I'm trying to do the merge:
Right-click on the directory I'm merging to, select "HG Repository
Explorer", right-click on the tip revision, select "Merge with..." and press
"Merge" in the dialog "Merging in...".
msg11954 (view) Author: kiilerix Date: 2010-03-08.23:14:02
Is merge working correctly anyway?

The simplest explanation would be that the output of process explorer is
incorrect. Could that be possible?

If it is worth investigating further, then please post the exact output of
"hg showconfig" - perhaps slightly censored, but especially all lines
related to merge.
msg11952 (view) Author: pietzcker Date: 2010-03-08.16:40:42
Oh, I should probably mention that this happens with Mercurial
1.4.3/TortoiseHg 0.9.3 as well as 1.5/1.0.
msg11951 (view) Author: pietzcker Date: 2010-03-08.15:14:19
Dear all,

this is my first bug report here, and I'm not entirely sure where the fault
lies. I haven't found a similar issue when searching the bug database, if I
did miss one, please point me towards it.

I have been trying to setup UltraCompare as my external merge/diff tool.
vdiff worked, but 3-way-merge fails if the path to the repository contains
space characters. 

This is the relevant section of my Mercurial.ini:

[merge-tools]
UltraCompare.executable = C:\Programme\IDM Computer
Solutions\UltraCompare\uc.com
UltraCompare.args = $base $local $other
UltraCompare.priority = 1
UltraCompare.gui = True
UltraCompare.binary = True
UltraCompare.checkconflicts = True
UltraCompare.checkchanged = True

Using Process Explorer (under Win XP SP3), I find that the command line used
to invoke UltraCompare contains an extraneous " character between the
command and the first parameter if the path of the repository that is being
merged to contains a space:

"C:\Programme\IDM Computer Solutions\UltraCompare\uc.exe" "
"c:\dokume~1\tim~1.pie\lokale~1\temp\test.txt~base.akr6au" "E:\Eigene
Dateien\test\test-merge\test.txt"
"c:\dokume~1\tim~1.pie\lokale~1\temp\test.txt~other.b92442"

as opposed to a correct command line when the path is space-free:

"C:\Programme\IDM Computer Solutions\UltraCompare\uc.com"
"c:\dokume~1\tim~1.pie\lokale~1\temp\test.txt~base.e7vryp"
"E:\test\test-merge\test.txt"
"c:\dokume~1\tim~1.pie\lokale~1\temp\test.txt~other.u_qxme"

Is this a bug?

Thanks for your time,
Tim
History
Date User Action Args
2010-03-31 10:18:39kiilerixsetstatus: chatting -> resolved
nosy: sborho, pmezard, kiilerix, pietzcker
2010-03-31 07:31:11pietzckersetnosy: sborho, pmezard, kiilerix, pietzcker
messages: + msg12190
2010-03-29 23:16:10kiilerixsetnosy: sborho, pmezard, kiilerix, pietzcker
messages: + msg12188
2010-03-24 12:05:50abuehlsetnosy: - abuehl
2010-03-24 11:08:21kiilerixsetnosy: sborho, pmezard, kiilerix, abuehl, pietzcker
messages: + msg12166
2010-03-24 08:15:50abuehlsetnosy: sborho, pmezard, kiilerix, abuehl, pietzcker
messages: + msg12163
2010-03-24 00:53:21kiilerixsetnosy: sborho, pmezard, kiilerix, abuehl, pietzcker
messages: + msg12161
2010-03-12 10:06:53kiilerixsetnosy: sborho, pmezard, kiilerix, abuehl, pietzcker
messages: + msg12029
2010-03-12 08:42:35pietzckersetnosy: sborho, pmezard, kiilerix, abuehl, pietzcker
messages: + msg12027
2010-03-09 15:16:46abuehlsetnosy: + pmezard
messages: + msg11969
2010-03-09 11:59:37kiilerixsetnosy: sborho, kiilerix, abuehl, pietzcker
messages: + msg11966
2010-03-09 11:34:45pietzckersetnosy: sborho, kiilerix, abuehl, pietzcker
messages: + msg11965
2010-03-09 11:32:18pietzckersetnosy: sborho, kiilerix, abuehl, pietzcker
messages: + msg11964
2010-03-09 11:08:20abuehlsetnosy: sborho, kiilerix, abuehl, pietzcker
messages: + msg11963
2010-03-09 10:46:01kiilerixsetnosy: + abuehl, sborho
messages: + msg11962
2010-03-09 08:49:42pietzckersetfiles: + merge_ok_without_space.png
nosy: kiilerix, pietzcker
2010-03-09 08:49:12pietzckersetfiles: + no_merge_with_space_in_path.png
nosy: kiilerix, pietzcker
2010-03-09 08:46:02pietzckersetfiles: + config.txt
nosy: kiilerix, pietzcker
messages: + msg11958
2010-03-08 23:14:02kiilerixsetnosy: + kiilerix
messages: + msg11954
2010-03-08 16:40:42pietzckersetstatus: unread -> chatting
messages: + msg11952
2010-03-08 15:14:19pietzckercreate