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

Unified Diff: cms/sources.py

Issue 29400555: Issue 4992 - Adds optional revision arg to generate_static_pages (Closed) Base URL: https://hg.adblockplus.org/cms
Patch Set: add test coverage for static generation without the optional argument '-r/--rev' Created April 3, 2017, 10:11 a.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 | « cms/bin/generate_static_pages.py ('k') | tests/conftest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/sources.py
===================================================================
--- a/cms/sources.py
+++ b/cms/sources.py
@@ -203,23 +203,23 @@
def has_include(self, include, format):
return self.has_file(self.include_filename(include, format))
def read_include(self, include, format):
return self.read_file(self.include_filename(include, format))
class MercurialSource(Source):
- def __init__(self, repo):
- command = ['hg', '-R', repo, 'archive', '-r', 'default',
+ def __init__(self, repo, revision):
+ command = ['hg', '-R', repo, 'archive', '-r', revision,
'-t', 'uzip', '-p', 'root', '-']
data = subprocess.check_output(command)
self._archive = zipfile.ZipFile(StringIO(data), mode='r')
- command = ['hg', '-R', repo, 'id', '-n', '-r', 'default']
+ command = ['hg', '-R', repo, 'id', '-n', '-r', revision]
self.version = subprocess.check_output(command).strip()
self._name = os.path.basename(repo.rstrip(os.path.sep))
def __enter__(self):
return self
def __exit__(self, type, value, traceback):
« no previous file with comments | « cms/bin/generate_static_pages.py ('k') | tests/conftest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld