Skip to content

Instantly share code, notes, and snippets.

@zbeekman
Created April 29, 2011 15:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zbeekman/948481 to your computer and use it in GitHub Desktop.
Save zbeekman/948481 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import os
import string
MERGE = "emacs"
QFLAG = "-Q"
EVAL = "--eval"
EVALFUNC = ["ediff-merge-files-with-ancestor"]
# Order of arguments returned by Subversion
(base,theirs,mine,working) = tuple(['"' + e + '"' for e in sys.argv[1:5]])
# Order needed by Emacs Ediff
funcargs = [theirs,mine,base,"nil",working]
evalfuncstr = EVALFUNC.extend(funcargs)
evalfuncstr = "(" + string.join(EVALFUNC) + ")"
cmd = [MERGE,QFLAG,EVAL,evalfuncstr]
os.execvp(cmd[0],cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment