jenkins-bot has submitted this change and it was merged.
Change subject: Remove wrong comment and unused code
......................................................................
Remove wrong comment and unused code
Because we switch to the tokens property, the comment that latestRevision
will be updated is no longer true. We also can't check edit conflict from
this. This patch therefore removes the comment and the code
Change-Id: I288c9badb7824dc2bc8db300e7fa6c322b338640
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 10 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 4efece2..9cadefe 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3728,24 +3728,16 @@
if not recreate:
raise
token = self.tokens['edit']
- # getting token also updates the 'lastrevid' value, which allows us to
- # detect if page has been changed since last time text was retrieved.
-
- # note that the server can still return an 'editconflict' error
- # if the page is updated after the token is retrieved but
- # before the page is saved.
self.lock_page(page)
- if lastrev is not None and page.latestRevision() != lastrev:
- raise EditConflict(page)
params = dict(action="edit",
title=page.title(withSection=False),
text=text, token=token, summary=summary)
if bot:
- params["bot"] = ""
+ params['bot'] = ""
if lastrev is not None:
if lastrev not in page._revisions:
self.loadrevisions(page)
- params["basetimestamp"] = page._revisions[lastrev].timestamp
+ params['basetimestamp'] = page._revisions[lastrev].timestamp
if minor:
params['minor'] = ""
elif notminor:
--
To view, visit
https://gerrit.wikimedia.org/r/169311
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I288c9badb7824dc2bc8db300e7fa6c322b338640
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Nullzero <nullzero.free(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>