-
Improvement
-
Resolution: Fixed
-
Minor
-
None
Currently P4_CHANGELIST gives the last sync changeset id for a depot. On depots which containing a single project this will match the last changeset for that project, but when a depot hosts multiple projects the last sync'd changeset can be greater than the last changeset that affected an individual project.
I've tested a quick patch that creates an environment variable P4_LAST_CHANGELIST with the last changeset id related to the current project, which is available here;
https://github.com/namtabmai/perforce-plugin/commit/765dff821abf46a5eace30c28b2a991f294e38fe
I'm not overly happy with that env name but it at least seems to work as expected on the builds I've tested it on.
- is related to
-
JENKINS-15653 Filter changes by viewspec
-
- Open
-
I'm not sure I follow your first paragraph... P4_CHANGELIST is the last changeset id for the workspace, not the entire depot. On depots containing multiple projects, this will only be set to the last change that is synced for that specific project as defined by the workspace view. In this way, it already does exactly what you need it to do.
Are you just requesting that a variable be added that contains the changeset of the previous build?