BrightLight / RepoCop

RepoCop is a repository hook framework written in C#
3 stars 2 forks source link

Add support for checking client capabilities #21

Closed BrightLight closed 12 months ago

BrightLight commented 5 years ago

Since Subversion 1.5, the "start-commit" hook batch gets a third argument "CAPABILITIES". This is already processed by RepoCop, but it doesn't actually perform any checks right now for "start-commit" event. It should be possible to write conditions that check for certain capabilities of the client and if not present deny the commit.

BrightLight commented 12 months ago

It is now possible to check client capabilities in the "start commit" hook, like this:

<CapabilityCondition Capability="MergeInfo" />

Full example (we now need to check within the instruction not only the HookType, but also the capability):

<!-- Start-Commit instructions -->
<Instructions>
  <Conditions>
    <HookTypeCondition HookType="StartCommit" />
    <CapabilityCondition Capability="MergeInfo" />
  </Conditions>
</Instructions>
BrightLight commented 12 months ago

btw, I have at the moment no idea which capabilities are reported by a subversion client. Will update here when I know that.