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
F18877648: D7818.diff
Nov 6 2025, 11:11 AM
F18821175: D7818.id17694.diff
Oct 22 2025, 8:01 PM
F18772376: D7818.diff
Oct 9 2025, 2:08 AM
F18758367: D7818.id.diff
Oct 5 2025, 10:05 PM
F18751335: D7818.diff
Oct 4 2025, 10:35 AM
F18679265: D7818.id.diff
Sep 26 2025, 12:39 AM
F18620868: D7818.id17691.diff
Sep 15 2025, 6:28 AM
F18600297: D7818.diff
Sep 13 2025, 9:27 AM
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