Mercurial > public > mercurial-scm > hg
comparison mercurial/destutil.py @ 41146:fbd168455b26 stable
histedit: crashing with a more useful error message on empty defaultrev
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
Differential Revision: https://phab.mercurial-scm.org/D5543
author | rdamazio@google.com |
---|---|
date | Wed, 09 Jan 2019 20:00:35 -0800 |
parents | 92213f6745ed |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
41128:f467c353298c | 41146:fbd168455b26 |
---|---|
379 | 379 |
380 if default is None: | 380 if default is None: |
381 revs = stack.getstack(repo) | 381 revs = stack.getstack(repo) |
382 elif default: | 382 elif default: |
383 revs = scmutil.revrange(repo, [default]) | 383 revs = scmutil.revrange(repo, [default]) |
384 else: | |
385 raise error.Abort(_("config option histedit.defaultrev can't be empty")) | |
384 | 386 |
385 if revs: | 387 if revs: |
386 # Take the first revision of the revset as the root | 388 # Take the first revision of the revset as the root |
387 return revs.min() | 389 return revs.min() |
388 | 390 |