Fix mentions of svn.python.org and remove unneeded files.

This commit is contained in:
Georg Brandl 2011-03-24 09:10:55 +01:00
parent f0ab8f27df
commit ff344ee971
6 changed files with 6 additions and 83 deletions

View File

@ -1,2 +0,0 @@
[.]
docutils -r5461 svn://svn.berlios.de/docutils/trunk/docutils/docutils

View File

@ -29,7 +29,7 @@ clean:
-rm *.html
update:
svn update
hg pull --update http://hg.python.org/peps
propcheck:
$(PYTHON) propcheck.py

View File

@ -17,13 +17,13 @@ Created: 13-Jul-2000
intro = u"""
The PEP contains the index of all Python Enhancement Proposals,
known as PEPs. PEP numbers are assigned by the PEP Editor, and
once assigned are never changed. The SVN history[1] of the PEP
texts represent their historical record.
once assigned are never changed. The Mercurial history[1] of
the PEP texts represent their historical record.
"""
references = u"""
[1] View PEP history online
http://svn.python.org/projects/peps/trunk/
http://hg.python.org/peps/
"""
footer = u"""

View File

@ -49,7 +49,7 @@ REQUIRES = {'python': '2.2',
PROGRAM = sys.argv[0]
RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html'
PEPURL = 'pep-%04d.html'
PEPCVSURL = ('http://svn.python.org/view/peps/trunk/pep-%04d.txt')
PEPCVSURL = ('http://hg.python.org/peps/file/tip/pep-%04d.txt')
PEPDIRRUL = 'http://www.python.org/peps/'

View File

@ -43,7 +43,7 @@ PROGRAM = sys.argv[0]
SERVER_DEST_DIR_BASE = (
'/data/ftp.python.org/pub/beta.python.org/build/data/dev/peps')
RFCURL = 'http://www.faqs.org/rfcs/rfc%d.html'
PEPCVSURL = 'http://svn.python.org/view/*checkout*/peps/trunk/pep-%04d.txt'
PEPCVSURL = 'http://hg.python.org/peps/file/tip/pep-%04d.txt'
PEPDIRURL = '/dev/peps/'
PEPURL = PEPDIRURL + 'pep-%04d'
PEPANCHOR = '<a href="' + PEPURL + '">%i</a>'

View File

@ -1,75 +0,0 @@
#!/usr/bin/env python
"""Perform an integrity check upon all PEPs to make sure the needed svn
properties are set."""
import glob
import pdb
import subprocess
from xml.etree import ElementTree
PROPS = {'svn:eol-style': "native", 'svn:keywords': "Author Date Id Revision"}
def get_props():
"""Return the properties set on pep-*.txt files as an ElementTree instance.
Files with no properties set will not be contained in the returned data.
"""
cmd = 'svn proplist --xml pep-*.txt'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
xml_results = proc.communicate()[0]
if proc.returncode:
raise subprocess.CalledProcessError("%s returned %d" %
(cmd, proc.returncode))
return ElementTree.fromstring(xml_results)
def missing_props(props):
"""Figure out what properties are missing on what PEPs, returning a sequence
of (path, [missing_props]) pairs.
For the set properties (as calculated by get_props()), see which PEPs are
lacking any properties. For the PEPs that are not even listed in the set
properties, assume they are missing all needed properties.
"""
problems = []
missing_files = set(glob.glob('pep-*.txt'))
missing_files.remove('pep-0000.txt')
for target in props:
assert target.tag == 'target'
needs = PROPS.keys()
path = target.attrib['path']
missing_files.remove(path)
for property in target.getchildren():
assert property.tag == 'property'
try:
needs.remove(property.attrib['name'])
except ValueError:
pass
if needs:
problems.append([path, needs])
for path in missing_files:
problems.append([path, PROPS.keys()])
return problems
def fix_props(missing_props):
"""Fix the missing properties."""
for path, missing in missing_props:
print "For %s, setting %s" % (path, missing)
for problem in missing:
cmd = 'svn propset %s "%s" %s' % (problem, PROPS[problem], path)
subprocess.check_call(cmd, shell=True)
def main():
props = get_props()
need_fixing = missing_props(props)
fix_props(need_fixing)
if __name__ == '__main__':
main()