Customizing Perforce RCS Keyword Output

I would like to filter files using the RCS keyword extension so that instances of $Change$ are translated to 1745 rather than the default behavior of $Change: 1745 $ . I understand that this will prevent future extensions, but it is acceptable for these purposes.

Other ways to insert the change list number into the file are also welcome. This is the only method I saw with Perforce that works during presentation - it is just that I would like to clear it so that it can be cleanly inserted into version numbers. Can this also be done with triggers?

+4
source share
1 answer

What you are asking for cannot be triggered. The only triggers that are active during submit are change-submit , change-content and change-commit . You can only get the contents of the file for the last two, but with the change-content trigger the change-content list number has not yet been fixed, and with the change-commit trigger the contents of the file have already been completed and cannot be changed. However, the worse is that you did not have There would be a way to send the modified contents of the file back to the server from your trigger.

The RCS keyword extension works because it is executed by the server itself and because Perforce updates after sending, that is, the client updates all the transferred change files from the Perforce server, thereby receiving content with RCS extended keywords.

+1
source

Source: https://habr.com/ru/post/1340919/


All Articles