When using "Clone Other", I need to enter a Windows networking userid in the form "DOMAIN\userid:password" but the
backslash is causing the wizard to display the message "Invalid Repository URL". Command line use of "hg clone" allow
the use of the backslash character.
I tried changing the backslash to %5C, which is the hex value of backslash, and that gets through the URL check and
starts the clone process. However, the clone never finishes.
Clone appears to create the directories and files but I have to exit out NetBeans and restart it before I can use the
repository to open the project.
Change OS to Windows XP, since that is where I have the problem. I have not tried this anywhere else, but I expect it
would fail the same way on all Windows versions.
Replacing the \ with %5C will allow the Wizard to accept this URI. To do the validation we are just creating a URI using
the passed in string, it is this creation that fails with a URISyntaxException. So '\' is not allowed in the URI.
We should release note it as it will catch others I'm sure.
Created attachment 59568 [details]
Change URI hint that appears in Wizard when on Windows, to give user some hint as to how to include a DOMAIN in the URI:
Committed to main:
date: Wed Apr 02 17:35:42 2008 +0100
summary: #131440: add hint for Clone Wizard for Windows if using DOMAIN\username must use DOMAIN%5Cusername in uri
I am not satisfied with this "fix", which is no fix at all. Why are you checking the URI with the userid and password
included? A "real fix" would be to change the dialog to prompt for the URI without the userid and password and prompt
for userid and password separately. That URI could be checked and any syntax exception it recieves would be a real
exception. The complete URI is then built by adding the "userid:password@" before passing it off to the "hg clone" command.
BTW, this still leaves the problem of the clone operation never completing or is that a separate issue? Should I enter
another bug issue for that problem?
OK - I understand what you are saying, we can strip out the userId:password@ and validate the remaining URI, before
reassembling and sending onto hg.
In subversion the username and password is entered separately on the Wizard and we could certainly do that, but that is
an enhancement request.
Its a separate issue that clone is not completing, please raise another bug for that. Did you try and run this from the
command line to see what happens? Can you provide log output:
Can you add -J-Dorg.netbeans.modules.mercurial.level=100
to netbeans_default_options in your netbeans.conf and send us the output.
The initial bug issue I enterd concerned the use of a backslash in the UTI for cloning a repository. See issue 131440.
I added the -J-Dorg.netbeans.modules.mercurial.level=100 to netbeans_default_options in your netbeans.conf and send us
the output, as suggested by jrice in issue 131440.
I started up NetBeans and tried to clone a small project.
I used the work around of %5C for a backslash in the URI during an initial hg clone the command never completes. The
lower right cycling progress bar just keeps on chugging for many minutes even though the repository is small (3 source
files and only an initial commit).
If I check outside of NetBeans the local respository files are created, but NetBeans is left waiting. If I kill the
Mercurial child process, I can open the project in the same NetBenas sesiion and work with it.
The Mercurial output window contains 2 lines:
======================== begin log output ======================
======================== end log output ======================
Is there someplace else that the trace output would appear?
P.S., This respository is clonable using "hg clone" on a command line. With the backslah or the %5C in the URI. The
"hg clone" command completes without a problem.
Can you attach the generated log file, thanks. Do you have a test repo that I can access to try and do the clone from
our end using the DOMAIN and a test userid?
Or in Dev build:
netbeans_default_options="... -J-Dorg.netbeans.modules.mercurial.level=100 ... "
Or in Dev build:
Unfortunately I don't have an externally accessible repository you can use to test.
I have made the changes to netbeans.config and attempted the clone. I waited for about 5 minutes for the clone operation
to complete and then exited Netbeans.
I will attach the messages.log file. I made a minor modification to the log. I changed all occurrences of my password
to "password" in the log file. Otherwise, it is unchanged.
Created attachment 60003 [details]
trace log from previous comment.
Some additional problems I found with backslash in the the userid string.
Whenever Netbeans writes out the hgrc file it changes the backslash characters(s) that existed in the file. In order
for the command line "hg" commands to work the userid string must contain a single backslash character in the userid
portion of the string.
The problems I found are:
1) When reading the hgrc file with a single backslash, the backslash is removed when the information is displayed in the
Mercurial properties dialog. If you then fix up the string in the dialog by adding the backslash, 2 backsalsh
characters are written to the file.
2) Again starting with an hgrc file that has a single blackslash character in the userid string, if another value in the
properties dialog is changed, then the blackslash disappears from the userid string (i.e., the string is wrtten as
displayed in the dialog).
At this point, any push or pull operation now fails authorization. This is true when the operation is done from
NetBeans or from the command line.
The correct fix is to patch ini4j so it does not interpret the backslash as an escape sequence.
The code is now consistent in that for the <project>\.hg\hgrc, the %USEPROFILE%\Mercurial.ini and <Install Mercurial
Path>\Mercurial.ini it will escape any \ chars in the files before opening them with ini4j.
The result is that the DOMAIN\userid will be converted to DOMAIN\\userid.
As a workaround in the Push/ Pull and Clone Other HgCommand code we could detect if a DOMAIN has been specified as part
of the path and use the --config option to override the path setting, having replaced the \\ with a single \
filed issue against ini4j
I have looked at ini4j and found that it does not meet the needs for this feature.
The Mercurial plug-in needs to read a Python style configuration file(s). The problems with using ini2j to read these
files are many.
1) they are not the same as Windows INI files
2) ini4j does not handle special characters in a manner that is compatible with Windows INI files
3) ini4j does not handle special characters in a manner that is compatible with Python configuration files.
This leads me to the conclusion that using ini4j for the Mercurial plug-in is the WRONG solution and unless something
more appropriate is used this issue will not be solved.
fixing the ini4j part:
ini4j has been patched - a single backslash is now saved and read correctly
The "real fix", as suggested by the reporter on Apr 3 13:53:38 2008 GMT, has been implemented in NetBeans 6.7 as part of
fix of bug #162661 (see http://www.netbeans.org/issues/show_bug.cgi?id=162661 for more details).
Marked as FIXED. Feel free to reopen this bug report if you find it is not completely fixed.