Page MenuHomePhabricator

histedit: crashing with a more useful error message on empty defaultrev

Authored by rdamazio on Jan 9 2019, 11:05 PM.



Before this, hg --config histedit.defaultrev= histedit would crash with
File "", line 385, in desthistedit

if revs:

UnboundLocalError: local variable 'revs' referenced before assignment

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rdamazio created this revision.Jan 9 2019, 11:05 PM

(and btw I'd be happier with '' meaning the default, but the original author went through the trouble of checking both cases explicitly, so I kept that)

yuja added a subscriber: yuja.Jan 10 2019, 6:23 AM

Queued for stable, thanks.

+ else:
+ raise error.Abort('config option histedit.defaultrev can\'t be empty')

Wrapped the message with _().

This revision was automatically updated to reflect the committed changes.