I was wondering if I can find, in mercurial, a changeset using a part of a commit message
for example I have some commits with following messages: "Test-254 modified some files" "Test-256 added logs"
And I want to find the changeset which has a commit containing Test-254 or Test-256
Mercurial supports advanced selection language called revset
. You can access the help with hg help revset
.
It supports both predicates and operators.
Predicates are for example all()
to match all revision or desc(string)
to match revisions containing string in their message.
Operators are x:y
for selecting a range or or
for an or condition.
By combining both, you can select the right commits you want:
hg log -r "desc('Test-254')"
will matches all revision that includes Test-254
in their message.
hg log -r "desc('Test-256')"
will matches all revision that includes Test-256
in their message.
hg log -r "desc('Test-254') or desc('Test-256')"
will matches all revision that includes either Test-254
or Test-256
in their message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With