Mercurial > public > mercurial-scm > hg
comparison mercurial/destutil.py @ 27559:d13bcc9fd656
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.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 24 Dec 2015 10:16:30 -0800 |
parents | 2c60b4b2a0de |
children | 72072cfc7e91 |
comparison
equal
deleted
inserted
replaced
27558:b5b54825de6b | 27559:d13bcc9fd656 |
---|---|
203 | 203 |
204 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())' | 204 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())' |
205 | 205 |
206 def desthistedit(ui, repo): | 206 def desthistedit(ui, repo): |
207 """Default base revision to edit for `hg histedit`.""" | 207 """Default base revision to edit for `hg histedit`.""" |
208 # Avoid cycle: scmutil -> revset -> destutil | |
209 from . import scmutil | |
210 | |
208 default = ui.config('histedit', 'defaultrev', histeditdefaultrevset) | 211 default = ui.config('histedit', 'defaultrev', histeditdefaultrevset) |
209 if default: | 212 if default: |
210 revs = repo.revs(default) | 213 revs = scmutil.revrange(repo, [default]) |
211 if revs: | 214 if revs: |
212 # The revset supplied by the user may not be in ascending order nor | 215 # The revset supplied by the user may not be in ascending order nor |
213 # take the first revision. So do this manually. | 216 # take the first revision. So do this manually. |
214 revs.sort() | 217 revs.sort() |
215 return revs.first() | 218 return revs.first() |