This is an archive of the discontinued Mercurial Phabricator instance.

revsetlang: add utility function to return hash like symbols from the tree
ClosedPublic

Authored by pulkit on Dec 19 2017, 7:09 AM.

Details

Summary

Functionalities like unhiding changesets whose rev/hash is passed by the user
required the knowledge of rev/hashes in the user provided specs. This patch adds
functions which can parse tree object and return a list of such values.

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

pulkit created this revision.Dec 19 2017, 7:09 AM
yuja requested changes to this revision.Dec 19 2017, 9:09 AM
yuja added a subscriber: yuja.
yuja added inline comments.
mercurial/revsetlang.py
665

Nit: _hashre to mark it a private.

674

Nit: could be a doctest.

679

My two cents, test if _ishashlikesymbol(s) here and early-return
[tree[1]].

The last [s for s ...] doesn't make sense.

This revision now requires changes to proceed.Dec 19 2017, 9:09 AM
pulkit updated this revision to Diff 4583.Dec 22 2017, 12:56 PM
yuja requested changes to this revision.Dec 25 2017, 8:06 AM
yuja added inline comments.
mercurial/revsetlang.py
665

Oops, one more thing. Needs $ to match whole word.

Test something like ('symbol', 'abe3ffZ').

691

Nit: this comment should be removed.

This revision now requires changes to proceed.Dec 25 2017, 8:06 AM
pulkit updated this revision to Diff 4608.Dec 25 2017, 10:08 AM
yuja accepted this revision.Dec 26 2017, 8:43 AM
This revision is now accepted and ready to land.Dec 26 2017, 8:43 AM
This revision was automatically updated to reflect the committed changes.