I can see the problem....

Inside PerforceScm the env are set.

@Override
public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
super.buildEnvVars(build, env);

TagAction tagAction = build.getAction(TagAction.class);
if (tagAction != null) {

// Set P4_CHANGELIST value
if (tagAction.getBuildChange() != null) { String change = getChangeNumber(tagAction); env.put("P4_CHANGELIST", change); }

// Set P4_CLIENT workspace value
if (tagAction.getClient() != null) { String client = tagAction.getClient(); env.put("P4_CLIENT", client); }
}
}

this calls

private String getChangeNumber(TagAction tagAction) {
Object buildChange = tagAction.getBuildChange();

which calls

public Object getBuildChange() { return buildChange; }

And the buildChange gets set with:

// Add tagging action to build, enabling label support.
TagAction tag = new TagAction(build);
tag.setClient(ws.getFullName());
tag.setCredential(credential);
tag.setBuildChange(task.getBuildChange());
build.addAction(tag)

and then CheckoutTask has
public Object getBuildChange() {
if (status == CheckoutStatus.SHELVED) { return review; }
return buildChange;
}

so if we have a shelved CL the the P4_CHANGELIST is set to the CL of the shelved files no the buildChange

P4_CHANGELIST needs to be set to the synced files, NOT the shelved CL
The shelved CL should be exposed via a different variable

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to