Page MenuHomePhabricator

Make `repository pull` install hooks the first time
ClosedPublic

Authored by epriestley on Dec 23 2013, 5:33 PM.
Tags
None
Referenced Files
F19817445: D7818.diff
Thu, Mar 5, 1:10 PM
F19765545: D7818.id17694.diff
Thu, Feb 19, 3:53 AM
F19756766: D7818.diff
Tue, Feb 17, 7:20 PM
F19705851: D7818.id17691.diff
Wed, Feb 11, 8:23 AM
F19705847: D7818.id17691.diff
Wed, Feb 11, 8:23 AM
F19543839: D7818.diff
Jan 22 2026, 11:49 PM
F19417155: D7818.id17694.diff
Dec 27 2025, 10:05 PM
F19269742: D7818.id.diff
Dec 22 2025, 9:49 PM
Subscribers

Details

Summary

Ref T4257. Currently, the pull logic looks like this:

if (new) {
  create();
} else {
  if (hosted) {
    install_hooks();
  } else {
    update();
  }
}

This means that the first time you run repository pull, hooks aren't installed, which makes debugging trickier. Instead, reorganize the logic:

if (new) {
  create();
} else {
  if (!hosted) {
    update();
  }
}

if (hosted) {
  install_hooks();
}
Test Plan

Ran bin/repository pull on a new hg repo and got hooks installed immediately.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped