Closed Bug 676508 Opened 14 years ago Closed 14 years ago

Fix misleading comment - hooks are run in the order in which they are seen

Categories

(Developer Services :: Mercurial: hg.mozilla.org, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: jwatt)

Details

Attachments

(1 file)

The comment in hgcustom/hghooks/example-hgrc is totally wrong and misleading. It may have been true at some point that hg hooks were run in alphabetical order, but that is definitely no longer the case. Hooks are run in the order in which they are seen during parsing of the hg config files. Not only is it not possible to reorder hooks in a given file purely by changing the names of the hooks, it's also not possible to stop hooks defined in the user's ~/.hgrc from running before the same type of hooks in the repo .hg/hgrc (since the former file is parsed before the latter). Of course I'm assuming here that we haven't hacked the mercurial installs we have to make hooks run in alphabetical order, but I don't see anything in https://hg.mozilla.org/hgcustom/ to suggest that we have.
Attached patch patchSplinter Review
Assignee: nobody → jwatt
Status: NEW → ASSIGNED
Attachment #550653 - Flags: review?(ted.mielczarek)
It was true in a previous version of hg, FWIW.
Attachment #550653 - Flags: review?(ted.mielczarek) → review+
Yeah, they changed the ordering system at some point, and we've been having problems with it ever since...
It's a two or so line patch to add support to hg for a config flag that would cause the hooks to be sorted before calling them. If that would be useful to us I'd be happy to propose that patch to the hg guys.
Benjamin, is that worth doing?
I believe they have rejected that in the past, take a look through the mercurial list archives.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Product: Release Engineering → Developer Services
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: