mediawiki-extensions-Visual.../modules
Roan Kattouw 6772f92e70 Get rid of 'reversed' flag on transactions
The way we implemented undoing transactions was horrible. We'd process
the original transaction, but with a reversed=true flag. That meant we
had to keep track of the 'reversed' flag everywhere, and use ternaries
like insert = reversed ? op.remove : op.insert; all over the place to
access transaction operations. Redo then worked by reapplying the
transaction. We would verify that this was OK by tracking whether the
transaction was in an applied state or an undone state.

This commit makes it so every transaction can only be applied once. To
undo, you obtain a mirror image of the transaction with tx.reverse(),
then apply that. To redo, you clone the original transaction with
tx.clone() and apply that. All the code that had to use ternaries to
check whether the transaction was being applied in reverse or not is
gone now, because you can only apply a given transaction forwards,
never in reverse.

Bonus:
* Make ve.dm.Document's .completeHistory a simple array of
  transactions, rather than transaction/boolean pairs
* In the protection of double application test, clone the example
  document properly; it modified ve.dm.example.data, which was "fine"
  because it ran .commit() and .rollback() the same number of times

Change-Id: I3050c5430be4a12510f22e20853560b92acebb67
2013-10-02 19:37:08 -07:00
..
jquery jquery.client: Update to upstream from 92f06b4a in mediawiki/core.git 2013-07-10 23:23:11 +02:00
jquery.uls Language Inspector UI 2013-07-29 00:38:59 -04:00
oojs oojs: Update to upstream v1.0.2 2013-07-25 17:57:41 +00:00
qunit
rangy Convert from DOS line endings (CRLF) to Unix ones (LF) 2013-05-25 23:51:21 +02:00
unicodejs Fix typo (was comma instead of semicolon) 2013-08-28 11:51:52 -07:00
ve Get rid of 'reversed' flag on transactions 2013-10-02 19:37:08 -07:00
ve-mw refactor to use Scenario Outline and REUSE_BROWSER env var 2013-09-27 11:36:53 -07:00