Homec4science

Make `repository pull` install hooks the first time

Authored by epriestley <git@epriestley.com> on Dec 23 2013, 19:43.

Description

Make repository pull install hooks the first time

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.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4257

Differential Revision: https://secure.phabricator.com/D7818

Details

Committed
epriestley <git@epriestley.com>Dec 23 2013, 19:43
Pushed
aubortJan 31 2017, 17:16
Parents
rPH6daa2b6c2efa: Fix a commit hook issue with the initial commit to Mercurial repositories
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH81dcf6378d81: Make `repository pull` install hooks the first time (authored by epriestley <git@epriestley.com>).Dec 23 2013, 19:43