Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,11 @@ THE SOFTWARE.
<artifactId>matrix-auth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.32.3.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
10 changes: 8 additions & 2 deletions src/main/java/hudson/scm/subversion/CheckoutUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb;
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec;
import org.tmatesoft.svn.core.wc.SVNRevision;
Expand Down Expand Up @@ -146,8 +147,13 @@ public List<External> perform() throws IOException, InterruptedException {
throw (InterruptedException)new InterruptedException().initCause(e);
}
} catch (SVNException e) {
e.printStackTrace(listener.error("Failed to check out " + location.remote));
throw new IOException("Failed to check out " + location.remote, e) ;
if (e.getErrorMessage().getErrorCode() == SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS &&
!location.isCancelProcessOnExternalsFail()) {
// we should not fail if external failed
} else {
e.printStackTrace(listener.error("Failed to check out " + location.remote));
throw new IOException("Failed to check out " + location.remote, e);
}
} finally {
try {
pos.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNErrorMessage;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.wc.ISVNExternalsHandler;
import org.tmatesoft.svn.core.wc.SVNEvent;
Expand Down Expand Up @@ -139,10 +140,10 @@ public void handleEvent(SVNEvent event, double progress) throws SVNException {
+ " failed!");
}

if (cancelProcessOnExternalsFailed) {
throw new SVNException(new RemotableSVNErrorMessage(SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS,
SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS.getDescription() + ": <" + file.getName() + ">"));
}
SVNErrorMessage error = new RemotableSVNErrorMessage(SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS,
SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS.getDescription() + ": <" + file.getName() + ">");

throw new SVNException(error, new SVNException(event.getErrorMessage()));
}

super.handleEvent(event, progress);
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/hudson/scm/subversion/UpdateUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ public List<External> perform() throws IOException, InterruptedException {
} catch (final SVNException e) {
SVNException cause = e;
do {
if (location.isCancelProcessOnExternalsFail() &&
cause.getErrorMessage().getErrorCode() == SVNErrorCode.CL_ERROR_PROCESSING_EXTERNALS) {
break;
}

SVNErrorCode errorCode = cause.getErrorMessage().getErrorCode();
if (errorCode == SVNErrorCode.WC_LOCKED) {
// work space locked. try fresh check out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.interceptor.RequirePOST;

/**
Expand All @@ -138,7 +139,15 @@ public class SubversionSCMSource extends SCMSource {
private String excludes = DescriptorImpl.DEFAULT_EXCLUDES;

private SubversionRepositoryBrowser browser;


private String excludedRegions = "";
private String includedRegions = "";
private String excludedUsers = "";
private String excludedCommitMessages = "";
private boolean ignoreDirPropChanges;
private boolean filterChangelog;
private boolean quietOperation;

private WorkspaceUpdater workspaceUpdater = new UpdateUpdater();

@GuardedBy("this")
Expand Down Expand Up @@ -235,6 +244,77 @@ public void setWorkspaceUpdater(WorkspaceUpdater workspaceUpdater) {
this.workspaceUpdater = workspaceUpdater;
}

@DataBoundSetter
public void setExcludedRegions(String excludedRegions) {
this.excludedRegions = excludedRegions;
}

@Exported
public String getExcludedRegions() {
return excludedRegions;
}

@DataBoundSetter
public void setIncludedRegions(String includedRegions) {
this.includedRegions = includedRegions;
}

@Exported
public String getIncludedRegions() {
return includedRegions;
}


@DataBoundSetter
public void setExcludedUsers(String excludedUsers) {
this.excludedUsers = excludedUsers;
}

@Exported
public String getExcludedUsers() {
return excludedUsers;
}

@DataBoundSetter
public void setExcludedCommitMessages(String excludedCommitMessages) {
this.excludedCommitMessages = excludedCommitMessages;
}

@Exported
public String getExcludedCommitMessages() {
return excludedCommitMessages;
}

@DataBoundSetter
public void setIgnoreDirPropChanges(boolean ignoreDirPropChanges) {
this.ignoreDirPropChanges = ignoreDirPropChanges;
}

@Exported
public boolean isIgnoreDirPropChanges() {
return ignoreDirPropChanges;
}

@DataBoundSetter
public void setFilterChangelog(boolean filterChangelog) {
this.filterChangelog = filterChangelog;
}

@Exported
public boolean isFilterChangelog() {
return filterChangelog;
}

@DataBoundSetter
public void setQuietOperation(boolean quietOperation) {
this.quietOperation = quietOperation;
}

@Exported
public boolean isQuietOperation() {
return quietOperation;
}

/**
* Gets the base SVN URL of the project.
*
Expand Down Expand Up @@ -729,7 +809,19 @@ public SubversionSCM build(@NonNull SCMHead head,
// name contains an @ so need to ensure there is an @ at the end of the name
remote.append('@');
}
return new SubversionSCM(remote.toString(), credentialsId, ".", workspaceUpdater, browser);

return new SubversionSCM(
SubversionSCM.ModuleLocation.parse(
new String[]{remote.toString()},
new String[]{credentialsId},
new String[]{"."},
null,
null,
null),
workspaceUpdater,
browser,
excludedRegions, excludedUsers, null, excludedCommitMessages, includedRegions, ignoreDirPropChanges, filterChangelog,
null, quietOperation);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,24 @@
<f:dropdownDescriptorSelector title="${%Check-out Strategy}" field="workspaceUpdater" descriptors="${descriptor.getWorkspaceUpdaterDescriptors()}"/>
<j:set var="scm" value="${instance}"/>
<t:listScmBrowsers name="svn.browser"/>
<f:advanced>
<f:entry title="${%Ignore Property Changes on directories}" field="ignoreDirPropChanges">
<f:checkbox />
</f:entry>
<f:entry title="${%Excluded Regions}" field="excludedRegions">
<f:textarea />
</f:entry>
<f:entry title="${%Included Regions}" field="includedRegions">
<f:textarea />
</f:entry>
<f:entry title="${%Excluded Users}" field="excludedUsers">
<f:textarea />
</f:entry>
<f:entry title="${%Excluded Commit Messages}" field="excludedCommitMessages">
<f:textarea />
</f:entry>
<f:entry title="${%Filter changelog}" field="filterChangelog">
<f:checkbox />
</f:entry>
</f:advanced>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
If set, and Jenkins is set to poll for changes, Jenkins will ignore any revisions
with commit messages containing any of the given regular expressions when
determining if a build needs to be triggered.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
Wenn Jenkins Subversion nach Änderungen befragt (um gegebenenfalls einen
neuen Builds zu starten), werden alle Revisionen ignoriert, deren Commit-Kommentar
mindestens einen der hier angegebenen regulären Ausdrücke enthält.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
SCMをポーリングするように設定していると、ビルドを起動するかどうか決定する際に、
設定した正規表現に合致するコミットメッセージを持つリビジョンを無視します。
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
設定後,如果 Jenkins 同時也被設定成輪詢變更,那麼在判斷是否要觸發建置時,會略過所有
Commit 訊息包含任一指定正規表示式的修訂版次。
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div>
If set, and Jenkins is set to poll for changes, Jenkins will ignore any files and/or
folders in this list when determining if a build needs to be triggered.
<p/>
Each exclusion uses regular expression pattern matching, and must be separated by a new line.
<p/>
<pre>
/trunk/myapp/src/main/web/.*\.html
/trunk/myapp/src/main/web/.*\.jpeg
/trunk/myapp/src/main/web/.*\.gif
</pre>
The example above illustrates that if only html/jpeg/gif files have been committed to
the SCM a build will not occur.
<p/>
More information on regular expressions can be found
<a href="http://www.regular-expressions.info/" target="_blank">here</a>.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div>
Ist dieses Feld nicht leer und das Projekt so konfiguriert, dass Jenkins regelmäßig
ein SVN-Repository nach Änderungen befragt, so werden dabei die hier angegebenen Dateien
und/oder Verzeichnisse bei der Bestimmung, ob ein neuer Build ausgelöst werden soll,
ignoriert.
<p/>Jeder Ausschluss kann reguläre Ausdrücke verwenden und muss ein einer eigenen Zeile stehen.<p/>
Im folgenden Beispiel wird <em>kein</em> neuer Build ausgelöst, wenn nur html/jpeg/gif-Dateien geändert wurden.
<pre>
/trunk/myapp/src/main/web/.*\.html
/trunk/myapp/src/main/web/.*\.jpeg
/trunk/myapp/src/main/web/.*\.gif
</pre>

<p/>Diese Option kann auch gemeinsam mit der Option "Eingeschlossene Bereiche" verwendet werden.
In diesem Fall sind nur Dateien und/oder Verzeichnisse relevant, die zwar in den Einschlüssen enthalten,
aber in den Ausschlüssen <em>nicht</em> enthalten sind.

<p/><a href="http://www.regular-expressions.info/" target="_blank">Mehr zu regulären Ausdrücken...</a>.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
Si cette option est cochée et que Jenkins est configuré pour scruter les changements, Jenkins ignorera tout fichier ou répertoire de cette liste au moment où il cherchera à déterminer si un build doit être lancé.
<p/>Chaque clause d'exclusion utilise les expressions régulières et doit être séparée des autres par une nouvelle ligne.
<p/>
<pre>
/trunk/myapp/src/main/web/.*\.html
/trunk/myapp/src/main/web/.*\.jpeg
/trunk/myapp/src/main/web/.*\.gif
</pre>
Dans l'exemple ci-dessus, si seuls des fichiers html/jpeg/gif ont été versionnées dans l'outil de gestion de version, un build n'aura pas lieu.
<p/>Plus d'information sur les expressions régulières peuvent être trouvés <a href="http://www.regular-expressions.info/" target="_blank">ici</a>.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
Jenkinsが変更をポーリングするように設定されている場合、ビルドを実行する必要があるかどうか判断する際に、このリストにあるファイルやフォルダを無視します。
<p/>リストには正規表現を使用し、改行で区切ります。
<p/>
<pre>
/trunk/myapp/src/main/web/.*\.html
/trunk/myapp/src/main/web/.*\.jpeg
/trunk/myapp/src/main/web/.*\.gif
</pre>
上記は、html/jpeg/gifファイルがSCMにコミットされても、ビルドは起動しない例です。
<p/>正規表現の詳細については、<a href="http://www.regular-expressions.info/" target="_blank">こちら</a>を参照してください。
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div>
設定後,Jenkins 在輪詢變更判斷是否要觸發建置時,會略過列出的檔案或目錄。

<p>
每一筆排除設定都是要用來比對的正規表示式,一行一筆。

<p>
<pre>
/trunk/myapp/src/main/web/.*\.html
/trunk/myapp/src/main/web/.*\.jpeg
/trunk/myapp/src/main/web/.*\.gif
</pre>
上述例子示範在只有 Commit html, jpeg 及 gif 這些檔進 SCM 時不要觸發新建置。

<p>
<a href="http://www.regular-expressions.info/" target="_blank">這裡</a>有更多正規表示式的資訊。
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div>
If set, and Jenkins is set to poll for changes, Jenkins will ignore any revisions
that are marked with the given revision property (revprop) when determining if
a build needs to be triggered. This can be used to exclude commits done by the
build itself from triggering another build, assuming the build server commits
the change with the correct revprop.
<p/>This type of exclusion only works with Subversion 1.5 servers and newer.
<p/>More information on revision properties can be found
<a href="http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html" target="_blank">here</a>.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
Wenn Jenkins Subversion nach Änderungen befragt (um gegebenenfalls einen
neuen Build zu starten), werden alle Revisionen ignoriert, die eine der hier
angegebenen Revisionseigenschaften (revprop) enthalten. Dadurch können Sie
vermeiden, dass Builds, die das Subversion-Repository modifizieren, weitere,
ungewollte Builds auslösen.
<p/>
Diese Funktion erfordert einen Subversion-Server Version 1.5 oder höher.
<p/>
Mehr über Revisionseigenschaften (revprops) finden Sie
<a href="http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html" target="_blank">hier</a>.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div>
SCMをポーリングするように設定していると、ビルドを起動するかどうか決定する際に、
設定したリビジョン属性(revprop)でマークされたリビジョンを無視します。
ビルドサーバーがリビジョン属性を使用してコミットした場合、ビルド自身が行ったコミットによって他のビルドを起動しないようにすることもできます。
<p/>Subversion 1.5以降でのみ動作します。
<p/>リビジョン属性についての詳細は<a href="http://www.caldron.jp/~nabetaro/svn/svnbook-1.5-final/html-chunk/svn.advanced.props.html" target="_blank">こちら</a>を参照してください。
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div>
設定後,Jenkins 在輪詢變更判斷是否要觸發建置時,會略過標有指定修訂屬性 (revprop) 的版次。
要是建置伺服器 Commit 變更時有用正確的 revprop,就可以排除建置過程自己 Commit 的版次,避免重複建置。

<p>
這種類型的排除條件只適用於 Subversion 伺服器 1.5 或是更新的版本。

<p>
<a href="http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html" target="_blank">這裡</a>可以找到更多修訂屬性的資訊。
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
If set, and Jenkins is set to poll for changes, Jenkins will ignore any revisions committed by users in this list when determining if a build needs to be triggered. This can be used to exclude commits done by the build itself from triggering another build, assuming the build server commits the change with a distinct SCM user.
<p/>Each exclusion uses literal pattern matching, and must be separated by a new line.
<p/>
<pre>
auto_build_user
</pre>
The example above illustrates that if only revisions by "auto_build_user" have been committed to the SCM a build will not occur.
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div>
Wenn Jenkins Subversion nach Änderungen befragt (um gegebenenfalls einen
neuen Builds zu starten), werden alle Revisionen ignoriert, die von einem
der hier angegebenen Committer eingecheckt wurden.
<p/>
Bei diesem Ausschluß müssen Sie vollständige Subversion-Benutzernamen angeben.
Bei mehreren Benutzernamen schreiben Sie diese in jeweils eine eigene Zeile.
<pre>
auto_build_user
</pre>
<p/>
Das obige Beispiel würde <i><b>keine</b></i> neuen Builds als Reaktion auf neue Revisionen des Committers "auto_build_user" auslösen.
</div>
Loading
Loading