This is an archive of the discontinued Mercurial Phabricator instance.

notify: don't produce errors if a revision is not found
ClosedPublic

Authored by av6 on Feb 7 2022, 1:40 AM.

Details

Summary

Notify extension has a way to only subscribe to a specific revset, such as
"branch(foo)". Before this patch, when there was no branch with that name, it
would produce a traceback saying "unknown revision: foo". With this patch it
would no longer do that, and instead it'll assume there are no revisions that
match this revset. I think this patch is an improvement in general, but there's
a reason I'm sending it now.

test-notify.t has a test case where it obsoletes the only revision on a branch,
and previously that wouldn't produce any complications, because head
computation wasn't obsolescence-aware. Now if the only revision on a branch is
obsolete, repo should not see that branch at all.

That branch will still be present in branchcache (with an empty list of
revisions) until the next patch.

Diff Detail

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

Event Timeline

av6 created this revision.Feb 7 2022, 1:40 AM
Alphare accepted this revision.Feb 7 2022, 8:38 AM
This revision is now accepted and ready to land.Feb 7 2022, 8:38 AM
This revision was automatically updated to reflect the committed changes.