diff hgext/commitextras.py @ 33606:806351695c6a stable

commitextras: make sure keys are not empty Thanks to Yuya for catching this.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 30 Jul 2017 12:19:46 +0530
parents 27fbca750b4d
children 901a18b03e00
line wrap: on
line diff
--- a/hgext/commitextras.py	Sat Jul 29 19:12:48 2017 -0700
+++ b/hgext/commitextras.py	Sun Jul 30 12:19:46 2017 +0530
@@ -54,6 +54,9 @@
                                 "KEY=VALUE format")
                         raise error.Abort(msg % raw)
                     k, v = raw.split('=', 1)
+                    if not k:
+                        msg = _("unable to parse '%s', keys can't be empty")
+                        raise error.Abort(msg % raw)
                     if re.search('[^\w-]', k):
                         msg = _("keys can only contain ascii letters, digits,"
                                 " '_' and '-'")