Jump to content


Xml validation trigger

Trigger

  • Please log in to reply
1 reply to this topic

#1 etcriss

etcriss

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 27 July 2018 - 07:38 PM

I'm trying to set up a p4 trigger to run and validate xml files on submit to prevent simple invalid xml problems.

I'm trying to figure out what p4 commands need to be run by the trigger by testing them out in console before writing code. I have a simple changelist, 12345, that contains a text file with a single line change. I would like to be able to print the entire fie to a string and then convert it to xml for validation.

My problem is that, at least running in console, the command p4 print file.txt@12345, p4 print file.txt@=12345, etc. all appear to be printing the committed file in the depot, not what is in the pending changelist.

Maybe this will change depending on the trigger type I implement, but I would really like to figure this out before writing code.

Has anyone else attempted this? How can I get these commands to look at the changelist instead of the depot?

Thank you.

#2 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 273 posts

Posted 20 August 2018 - 07:01 PM

Triggers only work on the server, and the server cannot access the workspace.  Therefore, you will have to use "p4 shelve" to shelve the file in your workspace and place the file on the server.  Then you can run
p4 print //depot/main/release1/perl_proj/oakland.txt@=12345





Also tagged with one or more of these keywords: Trigger

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users