Page MenuHomePhabricator

Add diff method for revisions
Closed, ResolvedPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/patches/447/
Reported by: Anonymous user
Created on: 2010-05-27 03:19:29
Subject: rvdiffto parameter implementation
Original description:
No revisions diff text loading function is implemented in the framework. Here is one:

Changelog:
Modified site.loadrevisions\(\) method to support rvdiffto parameter.
Added a Page.Revision.Diff class for storing the diff text and revto id.
Modified api.update\_page\(\) to save the new diff information.

A method from Page.py is still missing to get diffs just like you get a revision now. But you can get the diff text from page.\_revision\[id\].diff.text directly for now.


Version: unspecified
Severity: enhancement
See Also:
https://sourceforge.net/p/pywikipediabot/patches/447
https://bugzilla.wikimedia.org/show_bug.cgi?id=58819

Details

Reference
bz54573

Related Objects

StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:12 AM
bzimport set Reference to bz54573.
bzimport added a subscriber: Unknown Object (????).
Legoktm created this task.Sep 24 2013, 10:36 PM

rvdiffto parameter implementation

Sorry for the slow slow slow sloooow response.

I think diffs are a useful thing to have, but I'm not quite sure what the goal here is - what is the advantage of using rvdiffto instead of getting both revisions and comparing them with a python diff function?

I can see the use case for, for instance, an antivandalism bot, but I'm not quite sure how you would use it with this.

Then on the implementation - I can imagine it makes sense to store diffs for a certain revision, but I'd expect, for instance, a dict with revid's such that

page, revid=10001
diffs = \{10000: <diff object between 10000 and 10001>, 9000: <diff object between 9000 and 10001>\}, and storing e.g. revision.prev = 10000.

housekeeper's note:the patch does not apply cleanly to r10035

I do not think we should go with this.

Since the patch is really old and lots of changes made to base repo, the whole patch needs to be rewritten. Personally I think it's cool to have something like this

jayvdb added a comment.Nov 1 2014, 6:55 AM

Any idea who created this patch. sf.net just says 'Anonymous' ;-(

Related: we now have a module pywikibot.diff which could be used to do the diff client site.

jayvdb closed this task as Resolved.Jun 3 2015, 3:22 AM
jayvdb edited projects, added Pywikibot; removed Pywikibot-General.
jayvdb set Security to None.