680 if opts['text']: |
680 if opts['text']: |
681 ui.warn("Warning: -t and --text is deprecated," |
681 ui.warn("Warning: -t and --text is deprecated," |
682 " please use -m or --message instead.\n") |
682 " please use -m or --message instead.\n") |
683 message = opts['message'] or opts['text'] |
683 message = opts['message'] or opts['text'] |
684 logfile = opts['logfile'] |
684 logfile = opts['logfile'] |
|
685 |
|
686 if message and logfile: |
|
687 raise util.Abort('options --message and --logfile are mutually ' |
|
688 'exclusive') |
685 if not message and logfile: |
689 if not message and logfile: |
686 try: |
690 try: |
687 if logfile == '-': |
691 if logfile == '-': |
688 message = sys.stdin.read() |
692 message = sys.stdin.read() |
689 else: |
693 else: |
690 message = open(logfile).read() |
694 message = open(logfile).read() |
691 except IOError, why: |
695 except IOError, inst: |
692 ui.warn("Can't read commit message %s: %s\n" % (logfile, why)) |
696 raise util.Abort("can't read commit message '%s': %s" % |
|
697 (logfile, inst.strerror)) |
693 |
698 |
694 if opts['addremove']: |
699 if opts['addremove']: |
695 addremove(ui, repo, *pats, **opts) |
700 addremove(ui, repo, *pats, **opts) |
696 cwd = repo.getcwd() |
701 cwd = repo.getcwd() |
697 if not pats and cwd: |
702 if not pats and cwd: |