Page MenuHomePhabricator

Rollback in revertbot is sometimes ineffective
Closed, ResolvedPublic

Description

When the target user does more than one subsequent edit and the operator specifies -rollback, the edits are skipped and not rolled back.

The reason is the following call:

page = pywikibot.Page(self.site, item['title'])
history = list(page.revisions(total=2))

This caches the two newest revisions.

Then, in APISite.rollbackpage the cached revisions are iterated over, as if they were all the only existing revisions (page._revisions).
If both of them were made by the same user, the method raises "Rollback of {page} aborted; only one user in revision history".

Details

Related Changes in Gerrit:

Event Timeline

Dirty quick solution: raise the limit of cached revisions (e.g., 10, 50, 100...).

Better solution: cache no revisions, avoid this check altogether, let the server handle it.

Dirty quick solution: raise the limit of cached revisions (e.g., 10, 50, 100...).

Better solution: cache no revisions, avoid this check altogether, let the server handle it.

I agree with the later.

Change #1185306 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] IMPR: refactor Site.rollbackpage

https://gerrit.wikimedia.org/r/1185306

Change #1185306 merged by jenkins-bot:

[pywikibot/core@master] IMPR: refactor Site.rollbackpage

https://gerrit.wikimedia.org/r/1185306