# HG changeset patch # User Mateusz Kwapich # Date 1454980639 28800 # Node ID abc87a62ff51efcc3f71ba835e08b2fdb3f30b3c # Parent a17d8874a09937d7a5fe3efb986135e21906c8e0 maps: remove python2.7ism from dynamic author mapping diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py --- a/hgsubversion/maps.py +++ b/hgsubversion/maps.py @@ -103,8 +103,14 @@ class AuthorMap(dict): if search_author in self: result = self.super.__getitem__(search_author) elif self.meta.mapauthorscmd: - self[author] = result = subprocess.check_output ( - self.meta.mapauthorscmd % author, shell = True).strip() + cmd = self.meta.mapauthorscmd % author + process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) + output, err = process.communicate() + retcode = process.poll() + if retcode: + msg = 'map author command "%s" exited with error' + raise hgutil.Abort(msg % cmd) + self[author] = result = output.strip() if not result: if self.meta.defaultauthors: self[author] = result = '%s%s' % (author, self.defaulthost)