Show More
@@ -442,6 +442,7 b' class localrepository(object):' | |||
|
442 | 442 | new = new.keys() |
|
443 | 443 | new.sort() |
|
444 | 444 | |
|
445 | user = user or self.ui.username() | |
|
445 | 446 | if not text: |
|
446 | 447 | edittext = [""] |
|
447 | 448 | if p2 != nullid: |
@@ -454,13 +455,12 b' class localrepository(object):' | |||
|
454 | 455 | # run editor in the repository root |
|
455 | 456 | olddir = os.getcwd() |
|
456 | 457 | os.chdir(self.root) |
|
457 | edittext = self.ui.edit("\n".join(edittext)) | |
|
458 | edittext = self.ui.edit("\n".join(edittext), user) | |
|
458 | 459 | os.chdir(olddir) |
|
459 | 460 | if not edittext.rstrip(): |
|
460 | 461 | return None |
|
461 | 462 | text = edittext |
|
462 | 463 | |
|
463 | user = user or self.ui.username() | |
|
464 | 464 | n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date) |
|
465 | 465 | self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |
|
466 | 466 | parent2=xp2) |
@@ -194,7 +194,7 b' class ui(object):' | |||
|
194 | 194 | if self.verbose: self.write(*msg) |
|
195 | 195 | def debug(self, *msg): |
|
196 | 196 | if self.debugflag: self.write(*msg) |
|
197 | def edit(self, text): | |
|
197 | def edit(self, text, user): | |
|
198 | 198 | import tempfile |
|
199 | 199 | (fd, name) = tempfile.mkstemp("hg") |
|
200 | 200 | f = os.fdopen(fd, "w") |
@@ -205,9 +205,8 b' class ui(object):' | |||
|
205 | 205 | self.config("ui", "editor") or |
|
206 | 206 | os.environ.get("EDITOR", "vi")) |
|
207 | 207 | |
|
208 | os.environ["HGUSER"] = self.username() | |
|
209 | 208 | util.system("%s \"%s\"" % (editor, name), |
|
210 |
environ={'HGUSER': |
|
|
209 | environ={'HGUSER': user}, | |
|
211 | 210 | onerr=util.Abort, errprefix=_("edit failed")) |
|
212 | 211 | |
|
213 | 212 | t = open(name).read() |
General Comments 0
You need to be logged in to leave comments.
Login now