Skip to content

Instantly share code, notes, and snippets.

@bittner
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bittner/4f1067ccd68009933854 to your computer and use it in GitHub Desktop.
Save bittner/4f1067ccd68009933854 to your computer and use it in GitHub Desktop.
Add merge command to PyCharm again (including PEP8 corrections), see comments in https://www.jetbrains.com/pycharm/help/running-pycharm-as-a-diff-or-merge-command-line-tool.html
17,21c17,22
< if arg == '-h' or arg == '-?' or arg == '--help':
< print(('Usage:\n' + \
< ' {0} -h |-? | --help\n' + \
< ' {0} [-l|--line line] file[:line]\n' + \
< ' {0} diff file1 file2').format(sys.argv[0]))
---
> if arg in ['-h', '-?', '--help']:
> print('Usage:\n'
> ' {0} -h |-? | --help\n'
> ' {0} [-l|--line line] file[:line]\n'
> ' {0} diff file1 file2\n'
> ' {0} merge local remote base merged'.format(sys.argv[0]))
23c24
< elif arg == 'diff' and i == 0:
---
> elif arg in ['diff', 'merge'] and i == 0:
25c26
< elif arg == '-l' or arg == '--line':
---
> elif arg in ['-l', '--line']:
35,37c36,38
< args.append('-l')
< args.append(line_number)
< args.append(os.path.abspath(file_path))
---
> args.append('-l')
> args.append(line_number)
> args.append(os.path.abspath(file_path))
39c40
< args.append(os.path.abspath(arg))
---
> args.append(os.path.abspath(arg))
42a44
>
86c88,89
< if launch_with_port(port): exit()
---
> if launch_with_port(port):
> exit()
88c91,92
< if launch_with_port(port): exit()
---
> if launch_with_port(port):
> exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment