提交 28801ab2 编写于 作者: J jbq

Indent fix


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5317 71c3de6d-444a-0410-be80-ed276b4c234a
上级 5f776d40
......@@ -60,29 +60,29 @@ final class SubversionChangeLogBuilder {
final SVNClientManager manager = SubversionSCM.createSvnClientManager(createAuthenticationProvider());
try {
SVNLogClient svnlc = manager.getLogClient();
TransformerHandler th = createTransformerHandler();
th.setResult(changeLog);
SVNXMLLogHandler logHandler = new SVNXMLLogHandler(th);
// work around for http://svnkit.com/tracker/view.php?id=175
th.setDocumentLocator(DUMMY_LOCATOR);
logHandler.startDocument();
for (ModuleLocation l : scm.getLocations()) {
changelogFileCreated |= buildModule(l.remote, svnlc, logHandler);
}
for(String path : externals) {
changelogFileCreated |= buildModule(
getUrlForPath(build.getProject().getWorkspace().child(path)), svnlc, logHandler);
}
SVNLogClient svnlc = manager.getLogClient();
TransformerHandler th = createTransformerHandler();
th.setResult(changeLog);
SVNXMLLogHandler logHandler = new SVNXMLLogHandler(th);
// work around for http://svnkit.com/tracker/view.php?id=175
th.setDocumentLocator(DUMMY_LOCATOR);
logHandler.startDocument();
for (ModuleLocation l : scm.getLocations()) {
changelogFileCreated |= buildModule(l.remote, svnlc, logHandler);
}
for(String path : externals) {
changelogFileCreated |= buildModule(
getUrlForPath(build.getProject().getWorkspace().child(path)), svnlc, logHandler);
}
if(changelogFileCreated) {
logHandler.endDocument();
}
if(changelogFileCreated) {
logHandler.endDocument();
}
return changelogFileCreated;
return changelogFileCreated;
} finally {
manager.dispose();
manager.dispose();
}
}
......@@ -103,8 +103,8 @@ final class SubversionChangeLogBuilder {
}
Long thisRev = thisRevisions.get(url);
if (thisRev == null) {
listener.error("No revision found for URL: " + url + " in " + SubversionSCM.getRevisionFile(build) + ". Revision file contains: " + thisRevisions.keySet());
return true;
listener.error("No revision found for URL: " + url + " in " + SubversionSCM.getRevisionFile(build) + ". Revision file contains: " + thisRevisions.keySet());
return true;
}
if(thisRev.equals(prevRev)) {
logger.println("no change for "+url+" since the previous build");
......@@ -150,18 +150,18 @@ final class SubversionChangeLogBuilder {
public String invoke(File p, VirtualChannel channel) throws IOException {
final SVNClientManager manager = SubversionSCM.createSvnClientManager(authProvider);
try {
final SVNWCClient svnwc = manager.getWCClient();
SVNInfo info;
try {
info = svnwc.doInfo(p, SVNRevision.WORKING);
return info.getURL().toDecodedString();
} catch (SVNException e) {
e.printStackTrace();
return null;
}
final SVNWCClient svnwc = manager.getWCClient();
SVNInfo info;
try {
info = svnwc.doInfo(p, SVNRevision.WORKING);
return info.getURL().toDecodedString();
} catch (SVNException e) {
e.printStackTrace();
return null;
}
} finally {
manager.dispose();
manager.dispose();
}
}
......
......@@ -369,46 +369,46 @@ public class SubversionSCM extends SCM implements Serializable {
public List<String> invoke(File ws, VirtualChannel channel) throws IOException {
final SVNClientManager manager = createSvnClientManager(authProvider);
try {
final SVNUpdateClient svnuc = manager.getUpdateClient();
final List<String> externals = new ArrayList<String>(); // store discovered externals to here
final SVNRevision revision = SVNRevision.create(timestamp);
if(update) {
for (final ModuleLocation l : locations) {
try {
listener.getLogger().println("Updating "+ l.remote);
svnuc.setEventHandler(new SubversionUpdateEventHandler(listener, externals, l.local));
svnuc.doUpdate(new File(ws, l.local).getCanonicalFile(), revision, true);
} catch (final SVNException e) {
e.printStackTrace(listener.error("Failed to update "+l.remote));
// trouble-shooting probe for #591
if(e.getErrorMessage().getErrorCode()== SVNErrorCode.WC_NOT_LOCKED) {
listener.getLogger().println("Polled jobs are "+ SCMTrigger.DESCRIPTOR.getItemsBeingPolled());
final SVNUpdateClient svnuc = manager.getUpdateClient();
final List<String> externals = new ArrayList<String>(); // store discovered externals to here
final SVNRevision revision = SVNRevision.create(timestamp);
if(update) {
for (final ModuleLocation l : locations) {
try {
listener.getLogger().println("Updating "+ l.remote);
svnuc.setEventHandler(new SubversionUpdateEventHandler(listener, externals, l.local));
svnuc.doUpdate(new File(ws, l.local).getCanonicalFile(), revision, true);
} catch (final SVNException e) {
e.printStackTrace(listener.error("Failed to update "+l.remote));
// trouble-shooting probe for #591
if(e.getErrorMessage().getErrorCode()== SVNErrorCode.WC_NOT_LOCKED) {
listener.getLogger().println("Polled jobs are "+ SCMTrigger.DESCRIPTOR.getItemsBeingPolled());
}
return null;
}
return null;
}
}
} else {
Util.deleteContentsRecursive(ws);
} else {
Util.deleteContentsRecursive(ws);
for (final ModuleLocation l : locations) {
try {
final SVNURL url = SVNURL.parseURIEncoded(l.remote);
listener.getLogger().println("Checking out "+url);
for (final ModuleLocation l : locations) {
try {
final SVNURL url = SVNURL.parseURIEncoded(l.remote);
listener.getLogger().println("Checking out "+url);
svnuc.setEventHandler(new SubversionUpdateEventHandler(listener, externals, l.local));
svnuc.doCheckout(url, new File(ws, l.local).getCanonicalFile(), SVNRevision.HEAD, revision, true);
svnuc.setEventHandler(new SubversionUpdateEventHandler(listener, externals, l.local));
svnuc.doCheckout(url, new File(ws, l.local).getCanonicalFile(), SVNRevision.HEAD, revision, true);
} catch (final SVNException e) {
e.printStackTrace(listener.error("Failed to check out "+l.remote));
return null;
} catch (final SVNException e) {
e.printStackTrace(listener.error("Failed to check out "+l.remote));
return null;
}
}
}
}
return externals;
return externals;
} finally {
manager.dispose();
manager.dispose();
}
}
......@@ -495,10 +495,10 @@ public class SubversionSCM extends SCM implements Serializable {
private static SVNInfo parseSvnInfo(File workspace, ISVNAuthenticationProvider authProvider) throws SVNException {
final SVNClientManager manager = createSvnClientManager(authProvider);
try {
final SVNWCClient svnWc = manager.getWCClient();
return svnWc.doInfo(workspace,SVNRevision.WORKING);
final SVNWCClient svnWc = manager.getWCClient();
return svnWc.doInfo(workspace,SVNRevision.WORKING);
} finally {
manager.dispose();
manager.dispose();
}
}
......@@ -511,10 +511,10 @@ public class SubversionSCM extends SCM implements Serializable {
private static SVNInfo parseSvnInfo(SVNURL remoteUrl, ISVNAuthenticationProvider authProvider) throws SVNException {
final SVNClientManager manager = createSvnClientManager(authProvider);
try {
final SVNWCClient svnWc = manager.getWCClient();
return svnWc.doInfo(remoteUrl, SVNRevision.HEAD, SVNRevision.HEAD);
final SVNWCClient svnWc = manager.getWCClient();
return svnWc.doInfo(remoteUrl, SVNRevision.HEAD, SVNRevision.HEAD);
} finally {
manager.dispose();
manager.dispose();
}
}
......@@ -543,29 +543,29 @@ public class SubversionSCM extends SCM implements Serializable {
final SVNClientManager manager = createSvnClientManager(authProvider);
try {
final SVNWCClient svnWc = manager.getWCClient();
// invoke the "svn info"
for( ModuleLocation module : locations ) {
try {
SvnInfo info = new SvnInfo(svnWc.doInfo(new File(ws,module.local), SVNRevision.WORKING));
revisions.put(info.url,info);
} catch (SVNException e) {
e.printStackTrace(listener.error("Failed to parse svn info for "+module.remote));
}
}
for(String local : externals){
try {
SvnInfo info = new SvnInfo(svnWc.doInfo(new File(ws, local),SVNRevision.WORKING));
revisions.put(info.url,info);
} catch (SVNException e) {
e.printStackTrace(listener.error("Failed to parse svn info for external "+local));
final SVNWCClient svnWc = manager.getWCClient();
// invoke the "svn info"
for( ModuleLocation module : locations ) {
try {
SvnInfo info = new SvnInfo(svnWc.doInfo(new File(ws,module.local), SVNRevision.WORKING));
revisions.put(info.url,info);
} catch (SVNException e) {
e.printStackTrace(listener.error("Failed to parse svn info for "+module.remote));
}
}
for(String local : externals){
try {
SvnInfo info = new SvnInfo(svnWc.doInfo(new File(ws, local),SVNRevision.WORKING));
revisions.put(info.url,info);
} catch (SVNException e) {
e.printStackTrace(listener.error("Failed to parse svn info for external "+local));
}
}
}
return revisions;
return revisions;
} finally {
manager.dispose();
manager.dispose();
}
}
private static final long serialVersionUID = 1L;
......@@ -1021,7 +1021,7 @@ public class SubversionSCM extends SCM implements Serializable {
if(item!=null)
item.delete();
if (repository != null)
repository.closeSession();
repository.closeSession();
}
}
......@@ -1054,37 +1054,37 @@ public class SubversionSCM extends SCM implements Serializable {
if (checkRepositoryPath(repoURL)==SVNNodeKind.NONE) {
SVNRepository repository = null;
try {
repository = getRepository(repoURL);
long rev = repository.getLatestRevision();
// now go back the tree and find if there's anything that exists
String repoPath = getRelativePath(repoURL, repository);
String p = repoPath;
while(p.length()>0) {
p = SVNPathUtil.removeTail(p);
if(repository.checkPath(p,rev)==SVNNodeKind.DIR) {
// found a matching path
List<SVNDirEntry> entries = new ArrayList<SVNDirEntry>();
repository.getDir(p,rev,false,entries);
// build up the name list
List<String> paths = new ArrayList<String>();
for (SVNDirEntry e : entries)
if(e.getKind()==SVNNodeKind.DIR)
paths.add(e.getName());
String head = SVNPathUtil.head(repoPath.substring(p.length() + 1));
String candidate = EditDistance.findNearest(head,paths);
error("'%1$s/%2$s' doesn't exist in the repository. Maybe you meant '%1$s/%3$s'?",
p, head, candidate);
return;
}
}
error(repoPath+" doesn't exist in the repository");
repository = getRepository(repoURL);
long rev = repository.getLatestRevision();
// now go back the tree and find if there's anything that exists
String repoPath = getRelativePath(repoURL, repository);
String p = repoPath;
while(p.length()>0) {
p = SVNPathUtil.removeTail(p);
if(repository.checkPath(p,rev)==SVNNodeKind.DIR) {
// found a matching path
List<SVNDirEntry> entries = new ArrayList<SVNDirEntry>();
repository.getDir(p,rev,false,entries);
// build up the name list
List<String> paths = new ArrayList<String>();
for (SVNDirEntry e : entries)
if(e.getKind()==SVNNodeKind.DIR)
paths.add(e.getName());
String head = SVNPathUtil.head(repoPath.substring(p.length() + 1));
String candidate = EditDistance.findNearest(head,paths);
error("'%1$s/%2$s' doesn't exist in the repository. Maybe you meant '%1$s/%3$s'?",
p, head, candidate);
return;
}
}
error(repoPath+" doesn't exist in the repository");
} finally {
if (repository != null)
repository.closeSession();
if (repository != null)
repository.closeSession();
}
} else
ok();
......@@ -1109,18 +1109,18 @@ public class SubversionSCM extends SCM implements Serializable {
}
public SVNNodeKind checkRepositoryPath(SVNURL repoURL) throws SVNException {
SVNRepository repository = null;
SVNRepository repository = null;
try {
repository = getRepository(repoURL);
repository.testConnection();
try {
repository = getRepository(repoURL);
repository.testConnection();
long rev = repository.getLatestRevision();
String repoPath = getRelativePath(repoURL, repository);
return repository.checkPath(repoPath, rev);
long rev = repository.getLatestRevision();
String repoPath = getRelativePath(repoURL, repository);
return repository.checkPath(repoPath, rev);
} finally {
if (repository != null)
repository.closeSession();
if (repository != null)
repository.closeSession();
}
}
......
......@@ -150,29 +150,29 @@ public class SubversionTagAction extends AbstractScmTagAction {
try {
final SVNClientManager cm = SubversionSCM.createSvnClientManager(SubversionSCM.DescriptorImpl.DESCRIPTOR.createAuthenticationProvider());
try {
for (Entry<SvnInfo, String> e : tagSet.entrySet()) {
PrintStream logger = listener.getLogger();
logger.println("Tagging "+e.getKey()+" to "+e.getValue());
try {
SVNURL src = SVNURL.parseURIDecoded(e.getKey().url);
SVNURL dst = SVNURL.parseURIDecoded(e.getValue());
SVNCopyClient svncc = cm.getCopyClient();
svncc.doCopy(src, SVNRevision.create(e.getKey().revision), dst, false, true, "Tagged from "+build );
} catch (SVNException x) {
x.printStackTrace(listener.error("Failed to tag"));
return;
for (Entry<SvnInfo, String> e : tagSet.entrySet()) {
PrintStream logger = listener.getLogger();
logger.println("Tagging "+e.getKey()+" to "+e.getValue());
try {
SVNURL src = SVNURL.parseURIDecoded(e.getKey().url);
SVNURL dst = SVNURL.parseURIDecoded(e.getValue());
SVNCopyClient svncc = cm.getCopyClient();
svncc.doCopy(src, SVNRevision.create(e.getKey().revision), dst, false, true, "Tagged from "+build );
} catch (SVNException x) {
x.printStackTrace(listener.error("Failed to tag"));
return;
}
}
}
// completed successfully
for (Entry<SvnInfo,String> e : tagSet.entrySet())
SubversionTagAction.this.tags.get(e.getKey()).add(e.getValue());
build.save();
workerThread = null;
// completed successfully
for (Entry<SvnInfo,String> e : tagSet.entrySet())
SubversionTagAction.this.tags.get(e.getKey()).add(e.getValue());
build.save();
workerThread = null;
} finally {
cm.dispose();
cm.dispose();
}
} catch (Throwable e) {
e.printStackTrace(listener.fatalError(e.getMessage()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册