Hello Biörn,
First of all, please check these bug reports, since they could be
related to the situation you've described:
* Using svn+ssh:// repositories with private key
authentication causes subversive to popup ssh login dialog two
times for every repository operation. (bug 239871)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=239871
* Refresh on location/root nodes in SVN
Repositories View shows multiple credential dialogs (bug 385690)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385690
* Unchecked "Save password" repository location option shouldn't
prevent user name from being saved (bug 385890)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385890
All these are already fixed bugs and the corresponding fixes will
be included into the early access build next week.
Regarding how authentication information are stored - there could
be multiple credential sets stored for the same repository
location due to certain SVN feature (svn:externals, which may
point to a different repository with different authentication
information). All this should be managed automatically by
Subversive itself and shouldn't require writing of your own
credentials prompt dialog.
Best regards,
Alexander.
02.08.2012 18:01, Biörnstad, Biörn пишет:
Hi Alexander,
We have followed your instructions and sharing the project
works. However, lately we are having trouble with the
credentials.
On every start of our application, we are looking for a
repository location that is usable for the project -- creating
one if it does not exist -- and are setting the credentials on
it. We even specify that the credentials should be saved. Then,
if the project is not already shared, we share it using the
repository location.
However, as soon as the first svn operation is executed, we are
prompted for credentials. We have found out that different
repository locations are involved, although we would expect only
one to exist.
I tried implementing my own ISVNCredentialsPrompt and
IOptionProvider, which solves the problem of the user being
prompted, because I can provide the credentials without asking
the user (he would not know what to enter). But that seems like
a workaround to me.
Can you explain how credentials are stored and how we can
specify credentials in such a way that we are not prompted? That
would save us from having to provide an ISVNCredentialsPrompt
and would thus reduce complexity.
Thanks,
Biörn
Hello Biörn,
First of all you should detect which repository location you
could use in order to share the project (below is the part
of AlreadyConnectedPage which is responsible for the doing):
String url = "">
for (int i = 0; i < projects.length; i++) {
SVNChangeStatus info =
SVNUtility.getSVNInfoForNotConnected(projects[i]);
String tmp = SVNUtility.decodeURL(info.url);
if (url == null) {
url = "">
}
else {
IPath tPath = SVNUtility.createPathForSVNUrl(url);
IPath tPath2 =
SVNUtility.createPathForSVNUrl(tmp);
if (tPath2.isPrefixOf(tPath)) {
url = "">
}
else {
while (!tPath.isPrefixOf(tPath2)) {
tPath = tPath.removeLastSegments(1);
}
url = "">
}
}
}
IRepositoryRoot []repositoryRoots =
SVNUtility.findRoots(url, true); // here you will get all
the acceptable repository locations
IRepositoryLocation location =
repositoryRoots[0].getRepositoryLocation(); // you can
take the first acceptable one, for example
If there are no location then you should create it first. In
order to do so you can use the url you got from the previous
step:
AbstractActionOperation createOp = null;
if ( repositoryRoots.length == 0) {
location =
SVNRemoteStorage.instance().newRepositoryLocation();
......// fill the IRepositoryLocation
instance here
createOp = new
AddRepositoryLocationOperation(location);
}
And in the end this is how you could share the projects that
already contains Subversion metadata:
IProject []projects = ....;
IRepositoryLocation location = ....;
ReconnectProjectOperation mainOp = new
ReconnectProjectOperation(projects, location); //
reconnect operation itself
CompositeOperation op = new
CompositeOperation(mainOp.getId(),
mainOp.getMessagesClass());
op.add(new
NotifyProjectStatesChangedOperation(mainOp.getProjects(),
ProjectStatesChangedEvent.ST_PRE_SHARED)); // send
required notifications
if ( createOp != null) {
op.add(createOp);
op.add(new SaveRepositoryLocationsOperation());
op.add(mainOp, new IActionOperation[] {createOp});
}
else {
op.add(mainOp);
}
op.add(new RefreshResourcesOperation(mainOp,
IResource.DEPTH_INFINITE,
RefreshResourcesOperation.REFRESH_ALL)); // initialize SVN
metadata cache loading, redraw for the workspace resources
tree etc.
op.add(new
NotifyProjectStatesChangedOperation(mainOp.getProjects(),
ProjectStatesChangedEvent.ST_POST_SHARED)); // send
required notifications
UIMonitorUtility.doTaskScheduledDefault(op);
Best regards,
Alexander Gurov.
14.09.2011 18:45, Biörnstad, Biörn пишет:
Hello
We want to programmatically enable the sharing of a project that already contains Subversion meta data (.svn). I have found the ShareProjectOperation and the ShareProjectWizard with the AlreadyConnectedPage. However, they contain much code and I am getting slightly lost.
Can someone give me instructions on how to achieve this?
Additionally, we want to provide the credentials (username and password) that Subversive should use when contacting the Subversion repository. Is it possible to specify the information when sharing the project? Or do we need to use an ISVNCredentialsPrompt through an IOptionProvider?
The point is that both operations should be done programmatically without user interaction.
Thanks in advance,
Biörn
_______________________________________________
subversive-dev mailing list
subversive-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/subversive-dev
_______________________________________________
subversive-dev mailing list
subversive-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/subversive-dev
|