Last active
December 10, 2015 10:19
-
-
Save nielsmadan/4420243 to your computer and use it in GitHub Desktop.
Small python script to call hg status in a mercurial repo, get the names of all modified files and open the diff for each one using gvimdiff. Similar to how git behaves. .hgdiff needs to be configured for this to work (see comment at bottom of file). See here for more verbose explanation: http://www.pushingbits.net/posts/hg-diff-with-gvimdiff/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
output = subprocess.check_output(["hg", "status", "-m"]) | |
files = [line.split(' ', 1)[1] for line in output.split('\n') if line != ''] | |
for f in files: | |
subprocess.call(["hg", "d", f]) | |
# add this to hgrc | |
#[extensions] | |
#hgext.extdiff = | |
# | |
#[extdiff] | |
#cmd.d = gvimdiff | |
#opts.d = --nofork |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment