API:Mergehistory

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki action API documentation.
MediaWiki APIsAPI:Main page

MediaWiki action API

v · d · e

Token[edit]

To merge a page, an edit token is required.

Merging pages[edit]

Pages can be merged with action=mergehistory.

Parameters[edit]

  • from: Title of the page from which history will be merged. Cannot be used together with fromid.
  • fromid: Page ID of the page from which history will be merged. Cannot be used together with from.
  • to: Title of the page to which history will be merged. Cannot be used together with toid.
  • toid: Page ID of the page to which history will be merged. Cannot be used together with to.
  • timestamp: Timestamp up to which revisions will be moved from the source page's history to the destination page's history. If omitted, the entire page history of the source page will be merged into the destination page.
  • reason: Reason for the history merge (optional).
  • token: A csrf token.

Example[edit]

Note: In this example, all parameters are passed in a GET request just for the sake of simplicity. However, action=mergehistory requires POST requests; GET requests will cause an error.

Merge the entire history of Oldpage into Newpage.

Merge the page revisions of Oldpage dating up to 2015-12-31T04:37:41Z into Newpage.

Possible errors[edit]

All errors are formatted as:

<error code="code" info="info">




action=mergehistory

(main | mergehistory)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: MediaWiki
  • License: GPL-2.0+

Merge page histories.

Parameters:
from

Title of the page from which history will be merged. Cannot be used together with fromid.

fromid

Page ID of the page from which history will be merged. Cannot be used together with from.

Type: integer
to

Title of the page to which history will be merged. Cannot be used together with toid.

toid

Page ID of the page to which history will be merged. Cannot be used together with to.

Type: integer
timestamp

Timestamp up to which revisions will be moved from the source page's history to the destination page's history. If omitted, the entire page history of the source page will be merged into the destination page.

Type: timestamp (allowed formats)
reason

Reason for the history merge.

Default: (empty)
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.