david-fgs Posted September 20, 2017 Report Share Posted September 20, 2017 Hi, Given a situation with repo B having a writable xlink to repo A, and with pending changes including files in both A and B, is there any way to prevent committing files to both repos in the same changeset? I'd like programmers to commit changes to A in a separate changeset and am looking for a way to enforce this rule but I haven't found anything. Thanks! Link to comment Share on other sites More sharing options...
manu Posted September 21, 2017 Report Share Posted September 21, 2017 Hello @david-fgs, it's certainly doable using a "before-clientcheckin" trigger. You'll be provided with the paths the developer is about to checkin. You'll only need to check if changes from different repositories are mixed. In order to do check if the file is under an xlink you can use the "cm fileinfo" command like this: cm fileinfo station\core.cs --format={IsUnderXlink} If you find that there're changes out and inside an xlink you can cancel the operation giving a proper error message. It's also doable with a "before-checkin" trigger, but you'll need to provide the trigger a list with the xlink paths so you can determine if the changes are inside or out of them and mixed. The trigger, for example, can read from a file keeping the xlinks root paths. Hope it helps! Link to comment Share on other sites More sharing options...
david-fgs Posted September 21, 2017 Author Report Share Posted September 21, 2017 Hi @manu, This helps for sure. In a distributed environment with every developer having its own local server and using Cloud as the common one, am I right to assume the way to implement this is to have every developer create its own local trigger? Link to comment Share on other sites More sharing options...
manu Posted September 21, 2017 Report Share Posted September 21, 2017 Yes, that's right. Having distributed servers implies moving the triggers to those servers if we want to ensure certain rules. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.