Merge "Remove publish_www and simplify www_touched"
This commit is contained in:
commit
851a4f8206
|
@ -298,12 +298,8 @@ def error_message(error_log):
|
|||
return "\n".join(errs)
|
||||
|
||||
|
||||
def www_touched(check_only_www):
|
||||
"""Check whether files in www directory are touched.
|
||||
|
||||
If check_only_www is True: Check that only files in www are touched.
|
||||
Otherwise check that files in www are touched.
|
||||
"""
|
||||
def www_touched():
|
||||
"""Check whether files in www directory are touched."""
|
||||
|
||||
try:
|
||||
git_args = ["git", "diff", "--name-only", "HEAD~1", "HEAD"]
|
||||
|
@ -320,9 +316,7 @@ def www_touched(check_only_www):
|
|||
else:
|
||||
other_changed = True
|
||||
|
||||
if check_only_www:
|
||||
return www_changed and not other_changed
|
||||
return www_changed
|
||||
return www_changed and not other_changed
|
||||
|
||||
|
||||
def check_modified_affects_all(rootdir):
|
||||
|
@ -700,17 +694,6 @@ def get_publish_path():
|
|||
return os.path.join(get_gitroot(), 'publish-docs')
|
||||
|
||||
|
||||
def publish_www():
|
||||
"""Copy www files."""
|
||||
|
||||
publish_path = get_publish_path()
|
||||
www_path = os.path.join(publish_path, 'www')
|
||||
shutil.rmtree(www_path, ignore_errors=True)
|
||||
|
||||
source = os.path.join(get_gitroot(), 'www')
|
||||
shutil.copytree(source, www_path)
|
||||
|
||||
|
||||
def ignore_for_publishing(_, names):
|
||||
"""Return list of files that should be ignored for publishing."""
|
||||
|
||||
|
@ -1453,13 +1436,7 @@ def doctest():
|
|||
elif not CONF.api_site:
|
||||
doc_path = os.path.join(doc_path, 'doc')
|
||||
|
||||
# Do not publish www directory if we build for external
|
||||
# publishing
|
||||
if (CONF.check_build and
|
||||
(www_touched(False) and not CONF.publish)):
|
||||
publish_www()
|
||||
|
||||
if not CONF.force and www_touched(True):
|
||||
if not CONF.force and www_touched():
|
||||
print("Only files in www directory changed, nothing to do.\n")
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue