Merge "take care of books with sources in subdirectories"

This commit is contained in:
Jenkins 2013-08-15 14:31:20 +00:00 committed by Gerrit Code Review
commit 4e57235d2e
1 changed files with 24 additions and 19 deletions

View File

@ -226,11 +226,16 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
modified_files = map(lambda x: os.path.abspath(x), modified_files)
affected_books = []
books = []
book_root = rootdir
for root, dirs, files in os.walk(rootdir):
if ("pom.xml" in files and
os.path.basename(root) not in book_exceptions):
if os.path.basename(root) in book_exceptions:
break
elif "pom.xml" in files:
books.append(root)
book_root = root
os.chdir(root)
for f in files:
if (f.endswith('.xml') and
f != 'pom.xml' and
@ -243,9 +248,9 @@ def build_affected_books(rootdir, book_exceptions, file_exceptions, force):
if (href.endswith('.xml') and
f not in file_exceptions and
os.path.abspath(href) in modified_files):
affected_books.append(root)
affected_books.append(book_root)
break
if root in affected_books:
if book_root in affected_books:
break
if not force and affected_books: