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: Created April 1, 2017, 12:23 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
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):
Vasily Kuznetsov 2017/04/03 09:55:08 Perhaps add a default value 'default' in case some
Jon Sonesen 2017/04/03 10:10:59 It is not used anywhere else, as verified by grep
Sebastian Noack 2017/04/03 10:18:49 That is the same conclusion to which I came. When
Vasily Kuznetsov 2017/04/03 10:33:02 I was thinking about possible future uses, but it'
+ 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):

Powered by Google App Engine
This is Rietveld