Mercurial > hg
diff mercurial/ui.py @ 1983:ae12a81549a7
Pass correct username as $HGUSER to hgeditor if "commit -u" is used.
And only use the new util.system parameter to set the environment.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 21 Mar 2006 12:45:27 +0100 |
parents | 696230e52e4d |
children | df7436f439a0 |
line wrap: on
line diff
--- a/mercurial/ui.py Tue Mar 21 12:15:25 2006 +0100 +++ b/mercurial/ui.py Tue Mar 21 12:45:27 2006 +0100 @@ -194,7 +194,7 @@ if self.verbose: self.write(*msg) def debug(self, *msg): if self.debugflag: self.write(*msg) - def edit(self, text): + def edit(self, text, user): import tempfile (fd, name) = tempfile.mkstemp("hg") f = os.fdopen(fd, "w") @@ -205,9 +205,8 @@ self.config("ui", "editor") or os.environ.get("EDITOR", "vi")) - os.environ["HGUSER"] = self.username() util.system("%s \"%s\"" % (editor, name), - environ={'HGUSER': self.username()}, + environ={'HGUSER': user}, onerr=util.Abort, errprefix=_("edit failed")) t = open(name).read()