Add '-' support to the commit logfile option to read message from stdin.
authormark.williamson@cl.cam.ac.uk
Sun, 14 Aug 2005 12:30:01 -0800
changeset 899 aa5b726e9619
parent 898 3616c0d7ab88
child 900 ba8cf1f2210c
Add '-' support to the commit logfile option to read message from stdin.
mercurial/commands.py
--- a/mercurial/commands.py	Sun Aug 14 12:23:45 2005 -0800
+++ b/mercurial/commands.py	Sun Aug 14 12:30:01 2005 -0800
@@ -522,7 +522,10 @@
     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))