Bug 5001 - histedit defaultrev config no longer respects revsetalias entries
Summary: histedit defaultrev config no longer respects revsetalias entries
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: histedit (show other bugs)
Version: default branch
Hardware: All All
: urgent bug
Assignee: Bugzilla
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-12-14 19:20 UTC by Augie Fackler
Modified: 2016-01-08 00:00 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Augie Fackler 2015-12-14 19:20 UTC
I have had the following configured for some time:

histedit.defaultrev=only(.) and canmutate
revsetalias.canmutate=not (public() or upstream())

and today I noticed it's broken. I've bisected it down to:

The first bad revision is:
changeset:   27262:3d0feb2f978b
user:        Gregory Szorc <gregory.szorc@gmail.com>
date:        Sat Oct 24 19:56:39 2015 +0100
summary:     histedit: pick an appropriate base changeset by default (BC)

I'm not immediately sure what the problem is, and I'm in the midst of a big refactoring, so I'm afraid I have to file a bug and move on.
Comment 1 Gregory Szorc 2015-12-14 19:58 UTC
Something something repo.revs() doesn't honor revsetalias or something.
Comment 2 Matt Mackall 2015-12-15 13:42 UTC
Whenever revsetaliases don't work, this is the problem:

Internal revsets do not respect revsetaliases so that users don't break internal algorithms with name collisions.

Therefore, if you use the internal-facing APIs like repo.revs() to evaluate a user-provided revset, revset aliases will not exist.

Also, the arg to repo.revs is NOT a revset, it's a format string, so now a user-provided % will asplode it. Probably not a security crisis like sprintf(userstr), but conceptually similar.
Comment 3 Gregory Szorc 2015-12-20 13:33 UTC
Submitted patch to list.
Comment 4 HG Bot 2015-12-31 04:00 UTC
Fixed by https://selenic.com/repo/hg/rev/d13bcc9fd656
Gregory Szorc <gregory.szorc@gmail.com>
destutil: use scmutil.revrange for desthistedit (issue5001)

This allows user aliases to be expanded. It also prevents the
user-provided revset from being treated as a revset expression.

(please test the fix)
Comment 5 Bugzilla 2016-01-08 00:00 UTC
Bug was set to TESTING for 7 days, resolving