Created
February 2, 2014 16:39
-
-
Save hawkowl/8771120 to your computer and use it in GitHub Desktop.
twistedDocSearch.py
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
# THIS IS A HAWKOWL SCRIPT | |
# HERE BE SPIDERS | |
# (C) HAWKOWL 2014, ORIGINAL CHARACT^W SCRIPT DO NOT STEAL | |
# (actually it's MIT) | |
# TO USE (you need a git repo): | |
# $ cd Twisted | |
# $ svn ls svn://svn.twistedmatrix.com/svn/Twisted/branches/ > branches.txt | |
# $ python twistedDocSearch.py branches.txt 2> /dev/null | sort | uniq > changedfiles.txt | |
import subprocess, sys | |
f = open(sys.argv[1]) | |
for _branchname in f: | |
branchname = _branchname[:-2] | |
try: | |
diffSearch = "trunk..origin/{0}".format(branchname) | |
logCmd = ["git", "log", diffSearch, "--pretty=oneline"] | |
output = subprocess.check_output(logCmd) | |
splitOutput = output.splitlines() | |
hashes = [] | |
for item in splitOutput: | |
tmp = item.split(" ") | |
hashes.append(tmp[0]) | |
diffCmd = ["git", "diff", hashes[0], hashes[-1], "--name-only"] | |
diffOutput = subprocess.check_output(diffCmd) | |
splitDiffOutput = diffOutput.splitlines() | |
for line in splitDiffOutput: | |
if line.startswith("doc"): | |
print line | |
except Exception, e: | |
#print "branch {0} failed".format(branchname) | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment