This is an archive of the discontinued Mercurial Phabricator instance.

bookmarks: introduce a repo._bookmarks.changectx(mark) method and use it
ClosedPublic

Authored by martinvonz on Apr 6 2018, 1:59 PM.

Details

Summary

Many places were doing repo[mark], which usually works, but it's
slightly incorrect: if the bookmark has a name that matches a full hex
nodeid of another node, then the context for the other node will be
returned instead. Also, I'm about to remove support for
repo[<namespace thing>] :)

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

martinvonz created this revision.Apr 6 2018, 1:59 PM
martinvonz updated this revision to Diff 7795.Apr 6 2018, 2:43 PM

How do you feel about changectx instead of ctx? This would seemingly jive with other naming throughout the code base.

How do you feel about changectx instead of ctx? This would seemingly jive with other naming throughout the code base.

I agree, that's better to make it clear that it's not some kind of bookmark context. Will change.

martinvonz retitled this revision from bookmarks: introduce a repo._bookmarks.ctx(mark) method and use it to bookmarks: introduce a repo._bookmarks.changectx(mark) method and use it.Apr 6 2018, 7:42 PM
martinvonz updated this revision to Diff 7818.
indygreg accepted this revision.Apr 7 2018, 1:35 AM
This revision is now accepted and ready to land.Apr 7 2018, 1:35 AM
This revision was automatically updated to reflect the committed changes.