lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1469966 - in /lucene/dev/trunk: ./ dev-tools/ dev-tools/scripts/smokeTestRelease.py
Date Fri, 19 Apr 2013 17:38:47 GMT
Author: mikemccand
Date: Fri Apr 19 17:38:46 2013
New Revision: 1469966

URL: http://svn.apache.org/r1469966
Log:
LUCENE-4944: smoke tester detects duplicate sections in changes.html

Modified:
    lucene/dev/trunk/   (props changed)
    lucene/dev/trunk/dev-tools/   (props changed)
    lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py

Modified: lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py?rev=1469966&r1=1469965&r2=1469966&view=diff
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py (original)
+++ lucene/dev/trunk/dev-tools/scripts/smokeTestRelease.py Fri Apr 19 17:38:46 2013
@@ -420,7 +420,9 @@ def testChangesText(dir, version, projec
       fullPath = '%s/CHANGES.txt' % root
       #print 'CHECK %s' % fullPath
       checkChangesContent(open(fullPath, encoding='UTF-8').read(), version, fullPath, project,
False)
-      
+
+reChangesSectionHREF = re.compile('<a id="(.*?)".*?>(.*?)</a>', re.IGNORECASE)
+
 def checkChangesContent(s, version, name, project, isHTML):
 
   if isHTML and s.find('Release %s' % version) == -1:
@@ -440,6 +442,23 @@ def checkChangesContent(s, version, name
       if name.find('/benchmark/') == -1:
         raise RuntimeError('did not see "%s" in %s' % (sub, name))
 
+  if isHTML:
+    # Make sure a section only appears once under each release:
+    seenIDs = set()
+    seenText = set()
+
+    release = None
+    for id, text in reChangesSectionHREF.findall(s):
+      if text.lower().startswith('release '):
+        release = text[8:].strip()
+        seenText.clear()
+      if id in seenIDs:
+        raise RuntimeError('%s has duplicate section "%s" under release "%s"' % (name, text,
release))
+      seenIDs.add(id)
+      if text in seenText:
+        raise RuntimeError('%s has duplicate section "%s" under release "%s"' % (name, text,
release))
+      seenText.add(text)
+
 reUnixPath = re.compile(r'\b[a-zA-Z_]+=(?:"(?:\\"|[^"])*"' + '|(?:\\\\.|[^"\'\\s])*' + r"|'(?:\\'|[^'])*')"
\
                         + r'|(/(?:\\.|[^"\'\s])*)' \
                         + r'|("/(?:\\.|[^"])*")'   \



Mime
View raw message