Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/bin/generate_static_pages.py

Issue 29827639: Issue 6728 - Remove dead hg revision argument (Closed)
Patch Set: Created July 11, 2018, 5:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cms/sources.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/bin/generate_static_pages.py
===================================================================
--- a/cms/bin/generate_static_pages.py
+++ b/cms/bin/generate_static_pages.py
@@ -22,17 +22,17 @@
from argparse import ArgumentParser
from cms.utils import get_page_params, process_page
from cms.sources import create_source
MIN_TRANSLATED = 0.3
-def generate_pages(repo, output_dir, revision):
+def generate_pages(repo, output_dir):
known_files = set()
def write_file(path_parts, contents, binary=False):
encoding = None if binary else 'utf-8'
outfile = os.path.join(output_dir, *path_parts)
if outfile in known_files:
logging.warning('File %s has multiple sources', outfile)
return
@@ -47,17 +47,17 @@
os.makedirs(os.path.dirname(outfile))
except OSError as e:
if e.errno != errno.EEXIST:
raise
with codecs.open(outfile, 'wb', encoding=encoding) as handle:
handle.write(contents)
- with create_source(repo, cached=True, revision=revision) as source:
+ with create_source(repo, cached=True) as source:
config = source.read_config()
defaultlocale = config.get('general', 'defaultlocale')
locales = list(source.list_locales())
if defaultlocale not in locales:
locales.append(defaultlocale)
# First pass: compile the list of pages with given translation level
def get_locale_file(page):
@@ -120,16 +120,12 @@
remove_unknown(path)
if not os.listdir(path):
os.rmdir(path)
remove_unknown(output_dir)
if __name__ == '__main__':
parser = ArgumentParser('Convert website source to static website')
- parser.add_argument('-r', '--rev',
- help='Specify which revision to generate from. '
- 'See "hg help revisions" for details.',
- default='default')
parser.add_argument('source', help="Path to website's repository")
parser.add_argument('output', help='Path to desired output directory')
args = parser.parse_args()
- generate_pages(args.source, args.output, args.rev)
+ generate_pages(args.source, args.output)
« no previous file with comments | « no previous file | cms/sources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld