This is an archive of the discontinued Mercurial Phabricator instance.

treemanifest: fix non-tree repos when treemanifest is loaded
ClosedPublic

Authored by durham on Aug 30 2017, 12:45 PM.
Tags
None
Subscribers

Details

Summary

If the treemanifest is loaded, but not enabled for a repo, it was still
executing tree code for that repo, which would break. This adds checks to
prevent tree code from running in non-tree repositories.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durham created this revision.Aug 30 2017, 12:45 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 30 2017, 12:45 PM
durham updated this revision to Diff 1442.Aug 30 2017, 12:46 PM
simonfar added inline comments.
treemanifest/__init__.py
134–136

When would this return True? Surely if the extension is not loaded, this code never runs?

durham added inline comments.Aug 31 2017, 12:23 PM
treemanifest/__init__.py
134–136

I'm not sure I understand the question. This returns True in the vast majority of cases because the extension is loaded and enabled. This returns False when the extension is loaded in python, but not enabled in the current repository. For instance, if I hg pull from one local repo to another local repo, we'll load the extensions for both, but the extensions may only be enabled in one.

simonfar accepted this revision.Aug 31 2017, 1:22 PM
simonfar added inline comments.
treemanifest/__init__.py
134–136

You answered the question I meant to ask (what makes it return False). :)

This revision is now accepted and ready to land.Aug 31 2017, 1:22 PM
This revision was automatically updated to reflect the committed changes.