This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225091 - Missing URL credentials from subrepository URL, Netbeans infinitely asks for user credentials
Summary: Missing URL credentials from subrepository URL, Netbeans infinitely asks for ...
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-19 10:36 UTC by styu_
Modified: 2013-01-21 10:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description styu_ 2013-01-19 10:36:24 UTC
Netbeans infinitely asks for user credentials for subrepository, when pushing the main repository, even when the credentials are set in the repository url. Push works on the subrepository when initiated directly from the subrepository's directory.

So there is a main repository and one subrepository, and the user credentials are set for both of them in their respective Mercurial properties and in the hgrc and subrepo files as well in this format:
https://user:password@domain.com/project

Output window:
Mercurial Push
--------------
INFO Pushing To: https://user:****@domain.com/project ...
ERROR Command failed:
Command: [hg, push, --repository, /var/webpages/project, https://user:****@domain.com/project]
Output: [pushing to https://user:***@domain.com/project, pushing subrepo private/subproject to https://domain.com/subproject, abort: http authorization required]
INFO: End of Mercurial Push

As you can see, the user credentials are missing from the subrepository url. Directly pushing the subrepository works, but the main repo always trying to push the subrepo as well, so there is no way to push it within Netbeans, always need to push from linux terminal.
Comment 1 styu_ 2013-01-19 10:45:02 UTC
Mercurial asks for the credentials of the subrepository when using the command line tool as well (and the credentials are missing from the URL just as in the Netbeans output window), so maybe the infinite asking for the credentials is the only issue in Netbeans.
Comment 2 styu_ 2013-01-19 11:36:07 UTC
Found a workaround. Add the following to mercurial.ini or to .hgrc (domaincom could be anything, it just groups the prefix with the username and password):

[auth]
domaincom.prefix = https://domain.com
domaincom.username = user
domaincom.password = password
Comment 3 Ondrej Vrabec 2013-01-19 21:04:36 UTC
How does it work in commandline? When you run hg push --repository /var/webpages/project https://user:pwd@domain.com/project, what do you get as the output? Does it push without any questions?
Comment 4 styu_ 2013-01-19 21:28:59 UTC
It rewrites the subrepository url, so the credentials are missing from it, and the command line tool asks for the credentials once, for the subrepository. The subrepository url is set in the ".hgsub" file in this format:
private/subproject = https://user:password@domain.com/subproject

Here is the output:

pushing to https://user:***@domain.com/project
pushing subrepo private/subproject to https://domain.com/subproject
http authorization required
realm: Mercurial Repositories
user: user
password: password
searching for changes
no changes found
searching for changes
no changes found

If I trying to push within Netbeans, then Netbeans asks for the credentials once with empty user and password, then again and again with already filled username but empty password.
The .hgrc [auth] workaround is working in Netbeans and in the command line as well (so there is no need for the credentials in the URL and mercurial and Netbeans doesn't asks for them). This way push and pull are working fine within Netbeans!
Comment 5 Ondrej Vrabec 2013-01-21 10:30:23 UTC
Unfortunately i cannot fix it. mercurial push command does not accept credentials for subrepository and we have no way to pass the subrepo's credentials to it. So the only way seems to be modify .hgrc and set the credentials there manually by user. I could try to detect this scenario, display a warning mesage in that case and point to a proper www URL describing this workaround