[PATCH] Use text rather than binary mode for editing commit messages
Stephen Darnell
stephen at darnell.plus.com
Thu May 4 15:00:01 CDT 2006
Use text mode for editing commit strings.
This clearly has no effect on Unix, but allows standard Windows editors to
work correctly (e.g. notepad).
Regards,
Stephen
# HG changeset patch
# User Stephen Darnell <stephen at darnell.plus.com>
# Node ID 7308b2d5c7db4b00b92053eece234013dcaca29a
# Parent 118ff5ae417e2355988d22b54a337b0c68c2eefc
Use text rather than binary mode for editing commit messages
diff -r 118ff5ae417e -r 7308b2d5c7db mercurial/ui.py
--- a/mercurial/ui.py Thu May 04 14:12:38 2006 +0100
+++ b/mercurial/ui.py Thu May 04 14:23:44 2006 +0100
@@ -242,7 +242,7 @@ class ui(object):
def debug(self, *msg):
if self.debugflag: self.write(*msg)
def edit(self, text, user):
- (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt")
+ (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt",
text=True)
try:
f = os.fdopen(fd, "w")
f.write(text)
More information about the Mercurial
mailing list