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
F18563878: D7818.diff
Tue, Sep 9, 8:42 AM
F18446633: D7818.id.diff
Sun, Aug 31, 10:05 PM
F18427808: D7818.diff
Sun, Aug 31, 12:36 AM
F18025593: D7818.id17694.diff
Aug 2 2025, 9:47 PM
F17880641: D7818.id.diff
Jul 28 2025, 9:36 PM
F17851162: D7818.diff
Jul 27 2025, 10:57 AM
Unknown Object (File)
May 10 2025, 10:28 AM
Unknown Object (File)
Apr 25 2025, 10:50 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

Branch
hook1
Lint
Lint Passed
Unit
Tests Passed