Page MenuHomePhabricator

D18307.diff
No OneTemporary

D18307.diff

diff --git a/scripts/repository/commit_hook.php b/scripts/repository/commit_hook.php
--- a/scripts/repository/commit_hook.php
+++ b/scripts/repository/commit_hook.php
@@ -48,8 +48,13 @@
}
if (!$repository->isHosted()) {
- // This should be redundant, but double check just in case.
- throw new Exception(pht('Repository "%s" is not hosted!', $argv[1]));
+ // In Mercurial, the "pretxnchangegroup" hook fires for both pulls and
+ // pushes. Normally we only install the hook for hosted repositories, but
+ // if a hosted repository is later converted into an observed repository we
+ // can end up with an observed repository that has the hook installed.
+ // If we're running hooks from an observed repository, just exit without
+ // taking action. For more discussion, see PHI24.
+ return 0;
}
$engine->setRepository($repository);

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 12:47 PM (15 h, 32 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6921277
Default Alt Text
D18307.diff (850 B)

Event Timeline