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
F14839835: D7818.diff
Sat, Feb 1, 1:19 AM
Unknown Object (File)
Wed, Jan 29, 10:53 PM
Unknown Object (File)
Tue, Jan 28, 6:46 AM
Unknown Object (File)
Sat, Jan 25, 5:21 PM
Unknown Object (File)
Mon, Jan 20, 2:14 PM
Unknown Object (File)
Fri, Jan 17, 2:21 PM
Unknown Object (File)
Wed, Jan 8, 2:13 PM
Unknown Object (File)
Dec 23 2024, 5:57 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