jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/335759 )
Change subject: Update items after merging ......................................................................
Update items after merging
Change-Id: I7d11d4b7e1937750d83aa91073f0804f93e379f4 --- M pywikibot/page.py 1 file changed, 8 insertions(+), 2 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/page.py b/pywikibot/page.py index c83e1bd..f03fb0e 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -4175,9 +4175,15 @@ Merge the item into another item.
@param item: The item to merge into - @type item: pywikibot.ItemPage + @type item: ItemPage """ - self.repo.mergeItems(fromItem=self, toItem=item, **kwargs) + data = self.repo.mergeItems(fromItem=self, toItem=item, **kwargs) + if not data.get('success', 0): + return + self.latest_revision_id = data['from']['lastrevid'] + item.latest_revision_id = data['to']['lastrevid'] + if data.get('redirected', 0): + self._isredir = True
def set_redirect_target(self, target_page, create=False, force=False, keep_section=False, save=True, **kwargs):
pywikibot-commits@lists.wikimedia.org