jenkins-bot has submitted this change and it was merged. Change subject: Allow specifying a specific revision for roundtrip-test.js. ......................................................................
Allow specifying a specific revision for roundtrip-test.js. Change-Id: I25768ce0eca778e7c2756da5440bdae824851571 --- M bin/roundtrip-test.js 1 file changed, 16 insertions(+), 3 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js index 4dbb068..ce55e48 100755 --- a/bin/roundtrip-test.js +++ b/bin/roundtrip-test.js @@ -490,6 +490,9 @@ }; } else { // wt2html uri += 'wikitext/to/pagebundle/' + options.title; + if (options.oldid) { + uri += '/' + options.oldid; + } httpOptions.headers = { Accept: apiUtils.pagebundleContentType(null, options.contentVersion), }; @@ -602,14 +605,18 @@ var data = {}; return Promise[err ? 'reject' : 'resolve'](err).then(function() { + var uri2 = parsoidOptions.uri + 'page/wikitext/' + parsoidOptions.title; + if (options.oldid) { + uri2 += '/' + options.oldid; + } return Util.retryingHTTPRequest(10, { method: 'GET', - uri: parsoidOptions.uri + 'page/wikitext/' + parsoidOptions.title, + uri: uri2, }); }).spread(function(res, body) { profile.start = Date.now(); - // We were redirected to the latest revision. Record the oldid for - // later use in selser. + // We may have been redirected to the latest revision. Record the + // oldid for later use in selser. data.oldid = res.request.path.replace(/^(.*)\//, ''); data.oldWt = body; // First, fetch the HTML for the requested page's wikitext @@ -706,6 +713,12 @@ boolean: false, default: '', // Add a default when `prefix` is removed. }, + oldid: { + description: 'Optional oldid of the given page. If not given,' + + ' will use the latest revision.', + boolean: false, + default: null, + }, parsoidURL: { description: 'The URL for the Parsoid API', boolean: false, -- To view, visit https://gerrit.wikimedia.org/r/308293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I25768ce0eca778e7c2756da5440bdae824851571 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org> Gerrit-Reviewer: Arlolra <abrea...@wikimedia.org> Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits