jimbo1999 Posted June 20, 2014 Report Share Posted June 20, 2014 Hello, I'm currently setting up Plastic to replace our existing Jedi VCS repository and have a question about linked file extensions. In Delphi, certain files need to be checked in or out at the same time. The main ones are .dfm and .pas files (forms and their code). JediVCS will automatically checkout the .dfm if you check out the .pas and vice-versa. Is it possible to set up Plastic to do the same thing? There are a few other "file groups" which we would also need to link. The same principle applies in ASP.net with .aspx, .aspx.cs and .aspx.designer.cs files in Visual Studio so I thought this might be a feature already. I've had a play with triggers and can see that it would be possible to write a small exe to do this for me, but it seems like a lot of effort for such a small feature. I've tried searching the docs and forum but can't seem to see anything. Sorry if I'm being blind. Thanks, James Link to comment Share on other sites More sharing options...
calbzam Posted June 20, 2014 Report Share Posted June 20, 2014 Hi, The correct path is to create a trigger. We have a sample in this blog post: http://codicesoftware.blogspot.com/2013/02/unity.html In this case, the Unity users need to checkin a linked .meta file always they perform changes in a regular file. This trigger doesn´t allow to checkin a file if the .meta linked one is commited too. You can check the code or create a new one in your favorite language to implement a similar workflow for the checkout or checkin operations. Regards, Carlos Link to comment Share on other sites More sharing options...
jimbo1999 Posted June 23, 2014 Author Report Share Posted June 23, 2014 Thanks Carlos, looks like exactly what we need. I'll have a play with the code and adjust it for Delphi files. Link to comment Share on other sites More sharing options...
jimbo1999 Posted June 23, 2014 Author Report Share Posted June 23, 2014 Carlos, Thanks for that, the code has worked a treat (with some heavy modifications) and the "linked" files now check out together when any one is checked out. Unfortunately I can't seem to get the same to work with check-ins. I have the triggers defined as below but the exe just doesn't seem to fire when I check in code. Any clues why? I have debugging code which will start writing to a log file as soon as the exe is run and it's not firing at all. It's strange as the trigger is identical except for the parameter passed to the application. Also, which trigger is activated when a checkout is undone? I can't seem to see one in the trigger reference guide or when running "cm showtriggertypes". Thanks, James C:\Windows\system32>cm listtriggers 1 AfterCheckin E:\Plastic\Triggers\PlasticTrigger.exe /I DevReleaseAdmin after-clientcheckin 1 AfterCheckout E:\Plastic\Triggers\PlasticTrigger.exe /O DevReleaseAdmin after-clientcheckout Link to comment Share on other sites More sharing options...
manu Posted June 24, 2014 Report Share Posted June 24, 2014 Hi, is the server at the same machine as the client? If not you will need to create a before-checkin trigger on the server. I think you need to create a "before" trigger to be able to cancel the checkin op... Make sure the trigger exe path is accesible by the server. Link to comment Share on other sites More sharing options...
jimbo1999 Posted June 25, 2014 Author Report Share Posted June 25, 2014 Thanks Manu, The server and client are different machines, but the trigger application is at the same place on both so should fire in one place or the other. I've tried your suggestion (see trigger list below) but am getting the same issue with the triggers not firing on both of them. I've even tried to remove the trigger application to see if I got a "file not found" error but still nothing. It's as if the trigger isn't even firing at all. Are there any logs I can look at to see it trying to set off the trigger? Thanks, James C:\Documents and Settings\XPMUser>cm listtriggers 1 BeforeCheckOut E:\Plastic\Triggers\PlasticTrigger.exe /O DevReleaseAdmin before-checkout 1 BeforeCheckIn E:\Plastic\Triggers\PlasticTrigger.exe /I DevReleaseAdmin before-checkin Link to comment Share on other sites More sharing options...
jimbo1999 Posted June 25, 2014 Author Report Share Posted June 25, 2014 Further to my post above I've now set up triggers on all possible before/after checkin/out combinations and it seems the only ones to fire are: before-clientcheckout after-clientcheckout before-client checkin All others (including after-clientcheckin) refuse to start the exe. I'm also getting the following error when I try to call the checkin from the trigger process (cm ci "<path to file>") Error: Item has already been added. Key in dictionary: 'plastic_server' Key being added: 'plastic_server' Any ideas? Thanks, James Link to comment Share on other sites More sharing options...
manu Posted June 26, 2014 Report Share Posted June 26, 2014 Ummm that's weird. Do you think we can get connected to review it? Link to comment Share on other sites More sharing options...
jimbo1999 Posted June 27, 2014 Author Report Share Posted June 27, 2014 Certainly, what's the process to do this? Link to comment Share on other sites More sharing options...
manu Posted June 27, 2014 Report Share Posted June 27, 2014 Tell us when are you available and timezone, we'll schedule a GoToMeeting connection for next Monday (if you are available). We can continue by email mlucio at codicesoftware dot com and calba at the same Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.