Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/commands.py @ 899:aa5b726e9619
Add '-' support to the commit logfile option to read message from stdin.
author | mark.williamson@cl.cam.ac.uk |
---|---|
date | Sun, 14 Aug 2005 12:30:01 -0800 |
parents | 3616c0d7ab88 |
children | 969647d5100a |
comparison
equal
deleted
inserted
replaced
898:3616c0d7ab88 | 899:aa5b726e9619 |
---|---|
520 " please use -m or --message instead.\n") | 520 " please use -m or --message instead.\n") |
521 message = opts['message'] or opts['text'] | 521 message = opts['message'] or opts['text'] |
522 logfile = opts['logfile'] | 522 logfile = opts['logfile'] |
523 if not message and logfile: | 523 if not message and logfile: |
524 try: | 524 try: |
525 message = open(logfile).read() | 525 if logfile == '-': |
526 message = sys.stdin.read() | |
527 else: | |
528 message = open(logfile).read() | |
526 except IOError, why: | 529 except IOError, why: |
527 ui.warn("Can't read commit message %s: %s\n" % (logfile, why)) | 530 ui.warn("Can't read commit message %s: %s\n" % (logfile, why)) |
528 | 531 |
529 if opts['addremove']: | 532 if opts['addremove']: |
530 addremove(ui, repo, *pats, **opts) | 533 addremove(ui, repo, *pats, **opts) |