Page MenuHomePhabricator

Support SVN pre-commit hoooks
ClosedPublic

Authored by epriestley on Dec 2 2013, 10:32 PM.
Tags
None
Referenced Files
F15583589: D7683.id17348.diff
Wed, May 7, 10:33 PM
F15573989: D7683.id17348.diff
Mon, May 5, 10:58 PM
F15534787: D7683.id17347.diff
Thu, Apr 24, 2:07 AM
F15516924: D7683.id.diff
Fri, Apr 18, 10:13 PM
F15515343: D7683.id.diff
Fri, Apr 18, 9:49 AM
F15515340: D7683.id17348.diff
Fri, Apr 18, 9:45 AM
F15515339: D7683.id17347.diff
Fri, Apr 18, 9:45 AM
F15515338: D7683.id17352.diff
Fri, Apr 18, 9:45 AM
Subscribers

Details

Summary

Ref T4189. This adds SVN support, which was a little more messy than I though. Principally, we can not use PHABRICATOR_USER for Subversion, because it strips away the entire environment for "security reasons".

Instead, use --tunnel-user plus svnlook author to figure out the author.

Also fix "ssh://" clone URIs, which needs to be "svn+ssh://".

Test Plan
  • Made SVN commits through the hook.
  • Made Git commits, too, to make sure I didn't break anything.

Diff Detail

Branch
hooks2
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/diffusion/engine/DiffusionCommitHookEngine.php:71XHP16TODO Comment
Unit
Tests Passed

Event Timeline

epriestley updated this revision to Unknown Object (????).Dec 2 2013, 10:33 PM
  • Fix argument order in an exception message.

cool, just an inline about how it works

scripts/repository/commit_hook.php
27–32

so when does this check get done now?

scripts/repository/commit_hook.php
27–32

We'll never get here if the user doesn't have PUSH -- they'll be rejected as early as possible, before they send any data (in the case of SVN, before they send more than a few frames of data).

(I'll probably put this check back into the HookEngine just to be extra safe, though.)