diff mercurial/cmdutil.py @ 14635:217b7d83afc3

cmdutil, logmessage: use ui.fin when reading from '-'
author Idan Kamara <idankk86@gmail.com>
date Wed, 08 Jun 2011 14:54:52 +0300
parents a67e866f46f9
children 5e9d691229d5
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Jun 15 17:04:06 2011 -0300
+++ b/mercurial/cmdutil.py	Wed Jun 08 14:54:52 2011 +0300
@@ -76,7 +76,7 @@
     if modified or added or removed or deleted:
         raise util.Abort(_("outstanding uncommitted changes"))
 
-def logmessage(opts):
+def logmessage(ui, opts):
     """ get the log message according to -m and -l option """
     message = opts.get('message')
     logfile = opts.get('logfile')
@@ -87,7 +87,7 @@
     if not message and logfile:
         try:
             if logfile == '-':
-                message = sys.stdin.read()
+                message = ui.fin.read()
             else:
                 message = '\n'.join(util.readfile(logfile).splitlines())
         except IOError, inst:
@@ -1163,7 +1163,7 @@
     date = opts.get('date')
     if date:
         opts['date'] = util.parsedate(date)
-    message = logmessage(opts)
+    message = logmessage(ui, opts)
 
     # extract addremove carefully -- this function can be called from a command
     # that doesn't support addremove