Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-9342] using the view mask for the changelog is now a s…
…eparate option
  • Loading branch information
rpetti committed Aug 16, 2013
1 parent 15b98cb commit 3de2bc8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/hudson/plugins/perforce/PerforceSCM.java
Expand Up @@ -263,6 +263,7 @@ public class PerforceSCM extends SCM {
private String viewMask = null;
private boolean useViewMaskForPolling = true;
private boolean useViewMaskForSyncing = false;
private boolean useViewMaskForChangeLog = false;

/**
* Sync only on master option.
Expand Down Expand Up @@ -595,6 +596,10 @@ public Object readResolve() {
configVersion = 1L;
}

if (configVersion == 1L) {
this.useViewMaskForChangeLog = this.useViewMaskForSyncing;
}

return this;
}

Expand Down Expand Up @@ -972,7 +977,7 @@ public boolean checkout(AbstractBuild build, Launcher launcher,
changes = new ArrayList<Changelist>(0);
} else {
List<Integer> changeNumbersTo;
if (useViewMaskForSyncing && useViewMask) {
if (useViewMaskForChangeLog) {
changeNumbersTo = depot.getChanges().getChangeNumbersInRange(p4workspace, lastChange+1, newestChange, viewMask, showIntegChanges);
} else {
changeNumbersTo = depot.getChanges().getChangeNumbersInRange(p4workspace, lastChange+1, newestChange, showIntegChanges);
Expand Down Expand Up @@ -1798,6 +1803,7 @@ public SCM newInstance(StaplerRequest req, JSONObject formData) throws FormExcep
newInstance.setViewMask(Util.fixEmptyAndTrim(req.getParameter("p4.viewMask")));
newInstance.setUseViewMaskForPolling(req.getParameter("p4.useViewMaskForPolling") != null);
newInstance.setUseViewMaskForSyncing(req.getParameter("p4.useViewMaskForSyncing") != null);
newInstance.setUseViewMaskForChangeLog(req.getParameter("p4.useViewMaskForChangeLog") != null);

String cleanType = req.getParameter("p4.cleanType");
boolean useWipe = false;
Expand Down Expand Up @@ -2881,6 +2887,14 @@ public void setUseViewMaskForSyncing(boolean useViewMaskForSyncing) {
this.useViewMaskForSyncing = useViewMaskForSyncing;
}

public boolean isUseViewMaskForChangeLog() {
return useViewMaskForChangeLog;
}

public void setUseViewMaskForChangeLog(boolean useViewMaskForChangeLog) {
this.useViewMaskForChangeLog = useViewMaskForChangeLog;
}

public String getViewMask() {
return viewMask;
}
Expand Down
Expand Up @@ -228,6 +228,9 @@
<f:entry title="Use mask when syncing" help="/plugin/perforce/help/useViewMaskForSyncing.html">
<f:checkbox name="p4.useViewMaskForSyncing" checked="${instance.useViewMaskForSyncing}"/>
</f:entry>
<f:entry title="Use mask when determining changelog" help="/plugin/perforce/help/useViewMaskForChangeLog.html">
<f:checkbox name="p4.useViewMaskForChangeLog" checked="${instance.useViewMaskForChangeLog}"/>
</f:entry>
</f:optionalBlock>
</f:advanced>

Expand Down
7 changes: 7 additions & 0 deletions src/main/webapp/help/useViewMaskForChangeLog.html
@@ -0,0 +1,7 @@
<div>
<p>
If this option is checked, perforce will use the depot paths
listed in the view mask when retreiving the list of changes and culprits
since the last build.
</p>
</div>

2 comments on commit 3de2bc8

@oleg-nenashev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my humble opinion, PerforceSCM's needs more collapsing sections in the "Advanced".
Just to prevent user's brain collapsing :)

@rpetti
Copy link
Member Author

@rpetti rpetti commented on 3de2bc8 Aug 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I certainly wouldn't argue with that. Perforce just has too many use-cases... Even the official p4v dialogs are a nightmare. :/

I'd like to do anything we can to simplify the configuration of the plugin, so ideas are more than welcome!

Please sign in to comment.