Commit dbcc28b3 authored by Michal Čihař's avatar Michal Čihař

Correctly handle empty values in Mercurial settings

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 6249c140
...@@ -566,9 +566,14 @@ class HgRepository(Repository): ...@@ -566,9 +566,14 @@ class HgRepository(Repository):
""" """
Reads entry from configuration. Reads entry from configuration.
""" """
return self.execute( try:
['config', '{0}.{1}'.format(section, key)] return self.execute(
).strip().decode('utf-8') ['config', '{0}.{1}'.format(section, key)]
).strip().decode('utf-8')
except RepositoryException as error:
if error.retcode == 1:
return ''
raise
def set_config(self, section, key, value): def set_config(self, section, key, value):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment