| import os, sys, subprocess |
| from optparse import OptionParser, OptionGroup |
| parser = OptionParser("usage: %prog [options] <repo> <revision>") |
| parser.add_option("", "--dump-section-data", dest="dumpSectionData", |
| help="Dump the contents of sections", |
| action="store_true", default=False) |
| (opts, args) = parser.parse_args() |
| parser.error("invalid number of arguments") |
| parser.error("invalid revision argument (not an integer)") |
| p = subprocess.Popen(['git', 'rev-list', 'git-svn', '--pretty'], |
| bestRev = bestCommit = None |
| if ln.startswith('commit '): |
| lastCommit = ln.split(' ',2)[1] |
| elif ln.startswith(' git-svn-id: '): |
| _,repo,_ = ln.strip().split(' ') |
| _,lrev = repo.rsplit('@',1) |
| if bestRev is None or lrev>bestRev: |
| if bestCommit is not None: |