jenkins-bot has submitted this change and it was merged.
Change subject: Update revId upon claim change ......................................................................
Update revId upon claim change
changeTarget, removeSources: Prevents edit conflicts addSources: No need to set every time through the loop
Conflicts: pywikibot/page.py
Change-Id: I2d8b69a3894aaf6d58a62ecba48f5dc584617e82 (manually cherry picked from 38ae920a24be3) --- M pywikibot/page.py 1 file changed, 4 insertions(+), 2 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved Lokal Profil: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 5be034b..313bd56 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -4115,6 +4115,7 @@ **kwargs) # TODO: Re-create the entire item from JSON, not just id self.snak = data['claim']['id'] + self.on_item.lastrevid = data['pageinfo']['lastrevid']
def getTarget(self): """ @@ -4194,10 +4195,10 @@ @type claims: list of pywikibot.Claim """ data = self.repo.editSource(self, claims, new=True, **kwargs) + self.on_item.lastrevid = data['pageinfo']['lastrevid'] source = defaultdict(list) for claim in claims: claim.hash = data['reference']['hash'] - self.on_item.lastrevid = data['pageinfo']['lastrevid'] source[claim.getID()].append(claim) self.sources.append(source)
@@ -4217,7 +4218,8 @@ @param sources: the sources to remove @type sources: list of pywikibot.Claim """ - self.repo.removeSources(self, sources, **kwargs) + data = self.repo.removeSources(self, sources, **kwargs) + self.on_item.lastrevid = data['pageinfo']['lastrevid'] for source in sources: source_dict = defaultdict(list) source_dict[source.getID()].append(source)
pywikibot-commits@lists.wikimedia.org