Nullzero has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/169311/1

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: newchange
Gerrit-Change-Id: I288c9badb7824dc2bc8db300e7fa6c322b338640
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Nullzero <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to