Skip to content

@hawkowl /twistedDocSearch.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
twistedDocSearch.py
# 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
Something went wrong with that request. Please try again.