This is an archive of the discontinued Mercurial Phabricator instance.

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

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

Details

Summary

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

if revs:

UnboundLocalError: local variable 'revs' referenced before assignment

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

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.