| 64 | |
| 65 | |
| 66 | def _launch_editor(fp, repo): |
| 67 | try: |
| 68 | editor = repo.config['core.editor'] |
| 69 | except KeyError: |
| 70 | editor = os.environ['EDITOR'] if 'EDITOR' in os.environ else 'vim' |
| 71 | |
| 72 | cmd = shlex.split(editor) |
| 73 | cmd.append(fp) |
| 74 | |
| 75 | try: |
| 76 | ret = subprocess.call(cmd) |
| 77 | if ret != 0: |
| 78 | pprint.err('Call to editor {0} failed'.format(editor)) |
| 79 | except OSError: |
| 80 | pprint.err('Couldn\'t launch editor {0}'.format(editor)) |
| 81 | pprint.err_exp('change the value of git\'s core.editor setting') |
| 82 | |
| 83 | |
| 84 | def _extract_msg(repo): |