HomePhorge

Make `repository pull` install hooks the first time

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

Provenance
epriestleyAuthored on Dec 23 2013, 10:43 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP6daa2b6c2efa: Fix a commit hook issue with the initial commit to Mercurial repositories
Branches
Unknown
Tags
Unknown

Event Timeline