Skip to content

Commit

Permalink
Merge "Update items after merging"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Feb 4, 2017
2 parents c7154e8 + 242e690 commit 5798597
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pywikibot/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4175,9 +4175,15 @@ def mergeInto(self, item, **kwargs):
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):
Expand Down

0 comments on commit 5798597

Please sign in to comment.