# HG changeset patch # User mark.williamson@cl.cam.ac.uk # Date 2005-08-14 20:30:01 # Node ID aa5b726e96194336f5f40f439bfc153540e8ea3c # Parent 3616c0d7ab88a1cd28fe658819a9e2777b49f89f Add '-' support to the commit logfile option to read message from stdin. diff --git a/mercurial/commands.py b/mercurial/commands.py --- 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))