comparison mercurial/cmdutil.py @ 37815:32a75a8a5b0f stable

import: fix crash on --exact check of empty commit (issue5702)
author Yuya Nishihara <yuya@tcha.org>
date Tue, 24 Apr 2018 21:29:00 +0900
parents f10cb49951e1
children 853001c84114 79c54e7c0c52
comparison
equal deleted inserted replaced
37814:265c122b69aa 37815:32a75a8a5b0f
1535 store.close() 1535 store.close()
1536 if opts.get('exact') and nocommit: 1536 if opts.get('exact') and nocommit:
1537 # --exact with --no-commit is still useful in that it does merge 1537 # --exact with --no-commit is still useful in that it does merge
1538 # and branch bits 1538 # and branch bits
1539 ui.warn(_("warning: can't check exact import with --no-commit\n")) 1539 ui.warn(_("warning: can't check exact import with --no-commit\n"))
1540 elif opts.get('exact') and hex(n) != nodeid: 1540 elif opts.get('exact') and (not n or hex(n) != nodeid):
1541 raise error.Abort(_('patch is damaged or loses information')) 1541 raise error.Abort(_('patch is damaged or loses information'))
1542 msg = _('applied to working directory') 1542 msg = _('applied to working directory')
1543 if n: 1543 if n:
1544 # i18n: refers to a short changeset id 1544 # i18n: refers to a short changeset id
1545 msg = _('created %s') % short(n) 1545 msg = _('created %s') % short(n)