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
Unknown Object (File)
May 10 2025, 10:28 AM
Unknown Object (File)
Apr 25 2025, 10:50 AM
Unknown Object (File)
Apr 15 2025, 2:41 PM
Unknown Object (File)
Apr 8 2025, 8:10 PM
Unknown Object (File)
Apr 6 2025, 9:18 PM
Unknown Object (File)
Apr 5 2025, 10:50 AM
Unknown Object (File)
Apr 2 2025, 11:24 AM
Unknown Object (File)
Mar 31 2025, 4:31 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