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
F13185021: D7818.diff
Sat, May 11, 2:30 AM
Unknown Object (File)
Tue, May 7, 5:08 AM
Unknown Object (File)
Fri, May 3, 2:32 AM
Unknown Object (File)
Mon, Apr 29, 2:01 PM
Unknown Object (File)
Wed, Apr 24, 9:54 PM
Unknown Object (File)
Mon, Apr 22, 11:52 AM
Unknown Object (File)
Sun, Apr 21, 4:12 PM
Unknown Object (File)
Wed, Apr 17, 3:17 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