git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3011 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-04-11 01:55:11 +00:00
1 parent 34bfe2a634
commit 4816ff2ec5
1 file changed
+23 -15
@@ -81,21 +81,7 @@ final class SubversionChangeLogBuilder {
}
private String getUrlForPath(FilePath path) throws IOException, InterruptedException {
final ISVNAuthenticationProvider authProvider = createAuthenticationProvider();
return path.act(new FileCallable<String>() {
public String invoke(File p, VirtualChannel channel) throws IOException {
SVNWCClient svnwc = SubversionSCM.createSvnClientManager(authProvider).getWCClient();
SVNInfo info;
try {
info = svnwc.doInfo(p, SVNRevision.WORKING);
return info.getURL().toDecodedString();
} catch (SVNException e) {
e.printStackTrace();
return null;
}
}
});
return path.act(new GetUrlForPath(createAuthenticationProvider()));
}
private ISVNAuthenticationProvider createAuthenticationProvider() {
@@ -144,4 +130,26 @@ final class SubversionChangeLogBuilder {
DUMMY_LOCATOR.setColumnNumber(-1);
}
private static class GetUrlForPath implements FileCallable<String> {
private final ISVNAuthenticationProvider authProvider;
public GetUrlForPath(ISVNAuthenticationProvider authProvider) {
this.authProvider = authProvider;
}
public String invoke(File p, VirtualChannel channel) throws IOException {
SVNWCClient svnwc = SubversionSCM.createSvnClientManager(authProvider).getWCClient();
SVNInfo info;
try {
info = svnwc.doInfo(p, SVNRevision.WORKING);
return info.getURL().toDecodedString();
} catch (SVNException e) {
e.printStackTrace();
return null;
}
}
private static final long serialVersionUID = 1L;
}
}