mercurial/commands.py
changeset 899 aa5b726e9619
parent 898 3616c0d7ab88
child 904 969647d5100a
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -522,7 +522,10 @@ def commit(ui, repo, *pats, **opts):
     logfile = opts['logfile']
     if not message and logfile:
         try:
-            message = open(logfile).read()
+            if logfile == '-':
+                message = sys.stdin.read()
+            else:
+                message = open(logfile).read()
         except IOError, why:
             ui.warn("Can't read commit message %s: %s\n" % (logfile, why))