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)
Fri, Jan 17, 2:21 PM
Unknown Object (File)
Wed, Jan 8, 2:13 PM
Unknown Object (File)
Mon, Dec 23, 5:57 PM
Unknown Object (File)
Dec 16 2024, 1:45 PM
Unknown Object (File)
Dec 10 2024, 5:20 AM
Unknown Object (File)
Nov 28 2024, 5:52 AM
Unknown Object (File)
Nov 28 2024, 5:44 AM
Unknown Object (File)
Nov 28 2024, 5:44 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