jenkins-bot has submitted this change and it was merged.
Change subject: Performance improvement
......................................................................
Performance improvement
It is not necessary to load the whole version history to restore
the last one. total=2 is enough to do the job.
Change-Id: Id739b8765aa90d89c66bde351dcfa9fb28820c27
---
M scripts/revertbot.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Alex S.H. Lin: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index c8900fd..e23dfee 100644
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -69,8 +69,8 @@
return 'top' in item
def revert(self, item):
- if len(pywikibot.Page(pywikibot.Site(),
item['title']).fullVersionHistory()) > 1:
- rev = pywikibot.Page(pywikibot.Site(),
item['title']).fullVersionHistory()[1]
+ if len(pywikibot.Page(pywikibot.Site(),
item['title']).fullVersionHistory(total=2)) > 1:
+ rev = pywikibot.Page(pywikibot.Site(),
item['title']).fullVersionHistory(total=2)[1]
else:
return False
--
To view, visit
https://gerrit.wikimedia.org/r/129097
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id739b8765aa90d89c66bde351dcfa9fb28820c27
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Alex S.H. Lin <alexsh(a)mail2000.com.tw>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>