Page MenuHomePhabricator

Diff two pages
Closed, ResolvedPublic

Description

add difftopage option

On the english wikipedia we have long since had the desire to create an easy diff between a Template and its Sandbox page.

At the moment this is pretty hard, because you can only diff two specific revisions if you want to diff between two pages. We currently use a JS to find those revisions and make the diff.

I made a quick patch that adds a difftopage option, to diff between the title= and difftopage=

The following works:

page1: r5 and r4
page2: r50 and r49

http://localhost/index.php?title=page1&difftopage=page2 Creates a diff between the most recent versions of the two pages, page1 left and page2 on the right

http://localhost/index.php?title=page1&difftopage=page2&oldid=4 Creates a diff between rev 4 of page1 and rev 50 of page2 on the right

http://localhost/index.php?title=page1&difftopage=page2&oldid=4&diff=49 Creates a diff between rev 4 of page1 and rev 49 of page2 on the right

The following may be unexpected however by users:
http://localhost/index.php?title=page1&difftopage=page2&diff=49 Creates a diff between rev 50 of page2 and rev 49 of page2 on the right. This is because if diff= specified and oldid is not, it is used as oldid instead, thus title= becomes irrelevant.


Version: 1.17.x
Severity: enhancement

Attached:

Details

Reference
bz23621

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:09 PM
bzimport set Reference to bz23621.
bzimport added a subscriber: Unknown Object (MLST).

I'm not convinced it's the appropiate place to do it. I would create a Special page for page comparing instead of overloading page views.

Some notes:
Use tabs, not spaces http://www.mediawiki.org/wiki/Coding_style
Use DB_SLAVE instead of DB_MASTER

Created attachment 7396
draft of a Special:Diff

Ok, this is a working draft of how to implement it with a Special:Diff page.

Strings still require work, layout may not be perfect yet either.

Attached:

Created attachment 7397
Screenshot of proposed new special page

Attached:

Screen_shot_2010-05-22_at_02.30.54.png (647×960 px, 71 KB)

If we do this, may be worth exposing in the API also...

(In reply to comment #4)

If we do this, may be worth exposing in the API also...

You can already do this with the rvdiffto parameter, with which you can diff any revision to any other arbitrary revision, which doesn't necessarily have to belong to the same page.

What do you think on calling it Special:DiffPages instead of Special:Diff? Do you have a strong preference?

mike.lifeguard+bugs wrote:

(In reply to comment #5)

(In reply to comment #4)

If we do this, may be worth exposing in the API also...

You can already do this with the rvdiffto parameter, with which you can diff
any revision to any other arbitrary revision, which doesn't necessarily have to
belong to the same page.

I think the point is that this would allow you do to it without knowing the revid for the other page. You'd just diff based on page titles, not revids.

(In reply to comment #7)

I think the point is that this would allow you do to it without knowing the
revid for the other page. You'd just diff based on page titles, not revids.

So rvdifftopage?

(In reply to comment #8)

So rvdifftopage?

Yes exactly.

On Special:Diff vs. Special:DiffPages, I have little preference, but Diff is shorter and easier to remember I think.

Added as Special:ComparePages in r68289