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
F15541108: D7818.id17694.diff
Fri, Apr 25, 10:50 AM
F15506873: D7818.diff
Tue, Apr 15, 2:41 PM
F15481338: D7818.id17694.diff
Apr 8 2025, 8:10 PM
F15475654: D7818.id.diff
Apr 6 2025, 9:18 PM
F15472079: D7818.diff
Apr 5 2025, 10:50 AM
F15464620: D7818.id.diff
Apr 2 2025, 11:24 AM
F15458538: D7818.diff
Mar 31 2025, 4:31 AM
F15415259: D7818.id.diff
Mar 20 2025, 5:05 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