Author: smerten Date: 2010-11-13 16:26:09 +0100 (Sat, 13 Nov 2010) New Revision: 6481 Added: trunk/sandbox/rstdiff/MANIFEST.in trunk/sandbox/rstdiff/README trunk/sandbox/rstdiff/rstdiff.pod trunk/sandbox/rstdiff/setup.py trunk/sandbox/rstdiff/tests/simpleNoSource/expected/section.xml trunk/sandbox/rstdiff/tests/simpleNoSource/input/section.new.rst trunk/sandbox/rstdiff/tests/simpleNoSource/input/section.old.rst trunk/sandbox/rstdiff/version.py Modified: trunk/sandbox/rstdiff/ trunk/sandbox/rstdiff/global.log trunk/sandbox/rstdiff/rstdiff.py trunk/sandbox/rstdiff/tag.log trunk/sandbox/rstdiff/tests/ trunk/sandbox/rstdiff/tests/html/expected/contents.html trunk/sandbox/rstdiff/tests/html/expected/footnote.html trunk/sandbox/rstdiff/tests/html/expected/reference.html trunk/sandbox/rstdiff/tests/html/expected/textDifferent.html trunk/sandbox/rstdiff/tests/html/filterunit.cfg trunk/sandbox/rstdiff/tests/simple/expected/attributes.xml trunk/sandbox/rstdiff/tests/simple/expected/inlineStyles.xml trunk/sandbox/rstdiff/tests/simple/expected/section.xml trunk/sandbox/rstdiff/tests/simple/expected/textDifferent.xml trunk/sandbox/rstdiff/tests/simple/expected/textEqual.xml trunk/sandbox/rstdiff/tests/simple/expected/textOnly.xml trunk/sandbox/rstdiff/tests/simple/filterunit.cfg trunk/sandbox/rstdiff/tests/simple/source/section.rst trunk/sandbox/rstdiff/tests/simpleHtml/expected/attributes.html trunk/sandbox/rstdiff/tests/simpleHtml/expected/inlineStyles.html trunk/sandbox/rstdiff/tests/simpleHtml/expected/section.html trunk/sandbox/rstdiff/tests/simpleHtml/expected/textDifferent.html trunk/sandbox/rstdiff/tests/simpleHtml/expected/textEqual.html trunk/sandbox/rstdiff/tests/simpleHtml/expected/textOnly.html trunk/sandbox/rstdiff/tests/simpleHtml/filterunit.cfg trunk/sandbox/rstdiff/tests/simpleNoSource/expected/attributesNoSource.xml trunk/sandbox/rstdiff/tests/simpleNoSource/expected/onceOnly.xml trunk/sandbox/rstdiff/tests/simpleNoSource/expected/pcdataOnly.xml trunk/sandbox/rstdiff/tests/simpleNoSource/expected/references.xml trunk/sandbox/rstdiff/tests/simpleNoSource/filterunit.cfg trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.new.rst trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.old.rst Log: Some elements which may not be doubled by a replacement because they must be single by definition propagate a replacement up if their siblings also could propagate a replacement up. This way for instance sections which are complete replacements are recognized and marked up properly. Added README and man page `rstdiff.pod`. Upgraded tests to filterunit V0.7.1. Adapted expected test output to Docutils 0.8. Property changes on: trunk/sandbox/rstdiff ___________________________________________________________________ Modified: svn:ignore - CVS Makefile *.gmk + rstdiff.html tests.tgz .dist.ok dist version.gmk .tests.ok .build.ok .cvsignore .svnignore build MANIFEST .*.gmk Makefile CVS Added: trunk/sandbox/rstdiff/MANIFEST.in =================================================================== --- trunk/sandbox/rstdiff/MANIFEST.in (rev 0) +++ trunk/sandbox/rstdiff/MANIFEST.in 2010-11-13 15:26:09 UTC (rev 6481) @@ -0,0 +1,2 @@ +include tests.tgz +include version.py Added: trunk/sandbox/rstdiff/README =================================================================== --- trunk/sandbox/rstdiff/README (rev 0) +++ trunk/sandbox/rstdiff/README 2010-11-13 15:26:09 UTC (rev 6481) @@ -0,0 +1,3 @@ +`rstdiff.py` generates a structural diff from two reStructuredText +input documents and produces an annotated result. Use the `--writer` +option to select a writer for the result. Modified: trunk/sandbox/rstdiff/global.log =================================================================== --- trunk/sandbox/rstdiff/global.log 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/global.log 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,4 +1,486 @@ ************************************** +Date: Sat Nov 13 16:08:34 CET 2010 +Author: stefan +Tag: rstdiff_1_90 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Added Files: + README + +-------------------------------------- +Log Message: +Added README. +************************************** +Date: Sat Nov 13 16:03:42 CET 2010 +Author: stefan +Tag: rstdiff_1_89 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + rstdiff.py + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple +In directory rosalu:/home/stefan/free/rstdiff/tests/simple + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple/input +In directory rosalu:/home/stefan/free/rstdiff/tests/simple/input + +Modified Files: + section.new.rst section.old.rst + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple/source +In directory rosalu:/home/stefan/free/rstdiff/tests/simple/source + +Modified Files: + section.rst + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleHtml +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleHtml + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleNoSource +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleNoSource + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleNoSource/expected +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleNoSource/expected + +Modified Files: + onceOnly.xml +Added Files: + section.xml + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleNoSource/input +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleNoSource/input + +Modified Files: + onceOnly.new.rst onceOnly.old.rst +Added Files: + section.new.rst section.old.rst + +-------------------------------------- +Log Message: +Adapted tests to run again. +************************************** +Date: Sat Nov 13 15:17:18 CET 2010 +Author: stefan +Tag: rstdiff_1_88 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + rstdiff.py + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleNoSource +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleNoSource + +Modified Files: + filterunit.cfg + +-------------------------------------- +Log Message: +Implemented up propagation for replacement of elements which may +propagate up if their siblings also may propagate a replacement up. +Tests need to be considered. +************************************** +Date: Sat Nov 13 14:13:48 CET 2010 +Author: stefan +Tag: rstdiff_1_87 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + rstdiff.py + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple/input +In directory rosalu:/home/stefan/free/rstdiff/tests/simple/input + +Modified Files: + section.new.rst section.old.rst + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple/source +In directory rosalu:/home/stefan/free/rstdiff/tests/simple/source + +Modified Files: + section.rst + +-------------------------------------- +Log Message: +One more step for proper replacement of complex elements. Expected +tests fail. +************************************** +Date: Sat Nov 13 11:17:24 CET 2010 +Author: stefan +Tag: rstdiff_1_86 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + rstdiff.py + +-------------------------------------- +Log Message: +Refactoring: Prepared code for up-propagation for handling +section/title. +************************************** +Date: Sun Nov 7 20:10:28 CET 2010 +Author: stefan +Tag: rstdiff_1_85 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/html +In directory rosalu:/home/stefan/free/rstdiff/tests/html + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret +In directory rosalu:/home/stefan/free/rstdiff/tests/secret + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml +In directory rosalu:/home/stefan/free/rstdiff/tests/secretHtml + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple +In directory rosalu:/home/stefan/free/rstdiff/tests/simple + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleHtml +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleHtml + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleNoSource +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleNoSource + +Modified Files: + filterunit.cfg + +-------------------------------------- +Log Message: +Upgraded tests to filterunit V0.7.1. +************************************** +Date: Mon Nov 1 19:33:50 CET 2010 +Author: stefan +Tag: rstdiff_1_84 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + Makefile +Added Files: + rstdiff.pod + +-------------------------------------- +Log Message: +Added man page. +************************************** +Date: Sun Oct 31 20:53:50 CET 2010 +Author: stefan +Tag: rstdiff_1_83 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/studies +In directory rosalu:/home/stefan/free/rstdiff/studies + +Added Files: + .cvsignore + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/html +In directory rosalu:/home/stefan/free/rstdiff/tests/html + +Added Files: + .cvsignore + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple +In directory rosalu:/home/stefan/free/rstdiff/tests/simple + +Added Files: + .cvsignore + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleHtml +In directory rosalu:/home/stefan/free/rstdiff/tests/simpleHtml + +Added Files: + .cvsignore + +-------------------------------------- +Log Message: +Removed created `.cvsignore`. +************************************** +Date: Mon Oct 18 12:30:28 CEST 2010 +Author: stefan +Tag: rstdiff_1_82 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory theowa:/home/stefan/free/rstdiff + +Added Files: + setup.py + +-------------------------------------- +Log Message: +Added `setup.py`. +************************************** +Date: Mon Oct 18 12:14:54 CEST 2010 +Author: stefan +Tag: rstdiff_1_81 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory theowa:/home/stefan/free/rstdiff + +Modified Files: + Makefile + +-------------------------------------- +Log Message: +Added library sources. +************************************** +Date: Mon Oct 18 12:02:16 CEST 2010 +Author: stefan +Tag: rstdiff_1_80 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory theowa:/home/stefan/free/rstdiff + +Modified Files: + Makefile + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret +In directory theowa:/home/stefan/free/rstdiff/tests/secret + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml +In directory theowa:/home/stefan/free/rstdiff/tests/secretHtml + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml/expected +In directory theowa:/home/stefan/free/rstdiff/tests/secretHtml/expected + +Modified Files: + transaktionsbehandlung.html + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simple +In directory theowa:/home/stefan/free/rstdiff/tests/simple + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleHtml +In directory theowa:/home/stefan/free/rstdiff/tests/simpleHtml + +Modified Files: + filterunit.cfg + +-------------------------------------- +Log Message: +Added tags to some tests. + +Adapted expected output to Docutils 0.8. +************************************** +Date: Mon Oct 11 10:48:34 CEST 2010 +Author: stefan +Tag: rstdiff_1_79 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret/expected +In directory theowa:/home/stefan/free/rstdiff/tests/secret/expected + +Modified Files: + transaktionsbehandlung.xml + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/simpleNoSource/expected +In directory theowa:/home/stefan/free/rstdiff/tests/simpleNoSource/expected + +Modified Files: + attributesNoSource.xml onceOnly.xml pcdataOnly.xml + references.xml + +-------------------------------------- +Log Message: +Adapted comments in tests to newer docutils version. +************************************** +Date: Sun Oct 10 16:41:51 CEST 2010 +Author: stefan +Tag: rstdiff_1_78 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + Makefile + +-------------------------------------- +Log Message: +Switched to using `packageSupport`. +************************************** +Date: Sun Aug 22 14:24:03 CEST 2010 +Author: stefan +Tag: rstdiff_1_77 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret +In directory rosalu:/home/stefan/free/rstdiff/tests/secret + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret/expected +In directory rosalu:/home/stefan/free/rstdiff/tests/secret/expected + +Modified Files: + transaktionsbehandlung.xml + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret/input +In directory rosalu:/home/stefan/free/rstdiff/tests/secret/input + +Added Files: + transaktionsbehandlung.opt + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml +In directory rosalu:/home/stefan/free/rstdiff/tests/secretHtml + +Modified Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml/expected +In directory rosalu:/home/stefan/free/rstdiff/tests/secretHtml/expected + +Modified Files: + transaktionsbehandlung.html + +-------------------------------------- +Log Message: +Corrected expected results. +************************************** +Date: Sun Aug 22 13:43:23 CEST 2010 +Author: stefan +Tag: rstdiff_1_76 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff +In directory rosalu:/home/stefan/free/rstdiff + +Modified Files: + rstdiff.py + +-------------------------------------- +Log Message: +Debugging. + +Moved debug flag to a parameter. + +Removed some debugging code again. +************************************** +Date: Fri Aug 13 10:43:23 CEST 2010 +Author: stefan +Tag: rstdiff_1_75 + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret +In directory theowa:/home/stefan/free/rstdiff/tests/secret + +Added Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret/expected +In directory theowa:/home/stefan/free/rstdiff/tests/secret/expected + +Added Files: + transaktionsbehandlung.xml + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secret/input +In directory theowa:/home/stefan/free/rstdiff/tests/secret/input + +Added Files: + transaktionsbehandlung.new.rst transaktionsbehandlung.old.rst + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml +In directory theowa:/home/stefan/free/rstdiff/tests/secretHtml + +Added Files: + filterunit.cfg + +-------------------------------------- +Update of /home/stefan/vault/sm/rstdiff/tests/secretHtml/expected +In directory theowa:/home/stefan/free/rstdiff/tests/secretHtml/expected + +Added Files: + transaktionsbehandlung.html + +-------------------------------------- +Log Message: +Added directories for tests with secret input files. Added test for +new bug. +************************************** Date: Sun Aug 8 14:23:27 CEST 2010 Author: stefan Tag: rstdiff_1_74 Added: trunk/sandbox/rstdiff/rstdiff.pod =================================================================== --- trunk/sandbox/rstdiff/rstdiff.pod (rev 0) +++ trunk/sandbox/rstdiff/rstdiff.pod 2010-11-13 15:26:09 UTC (rev 6481) @@ -0,0 +1,44 @@ +=head1 NAME + +rstdiff - Generate a diff from two reStructuredText input files + +=head1 SYNOPSIS + +B<rstdiff.py> [I<options>]... I<old-reST> [I<new-reST> [I<diff-output>]] + +=head1 DESCRIPTION + +Generates a structural diff from two reStructuredText input documents +and produces an annotated result. + +=head1 OPTIONS + +Try + + rstdiff.py --help + +for an explanation of all options. + +=head1 SEE ALSO + +=over 4 + +=item Docutils + +http://docutils.sourceforge.net/ + +=item reStructuredText + +http://docutils.sourceforge.net/rst.html + +=back + +=head1 AVAILABILITY + +B<rstdiff> is available from + +http://www.merten-home.de/FreeSoftware/rstdiff/ + +and the Docutils sandbox + +svn://svn.berlios.de/docutils/trunk/sandbox/rstdiff Modified: trunk/sandbox/rstdiff/rstdiff.py =================================================================== --- trunk/sandbox/rstdiff/rstdiff.py 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/rstdiff.py 2010-11-13 15:26:09 UTC (rev 6481) @@ -280,8 +280,8 @@ class Words2TextVisitor(nodes.SparseNodeVisitor): - def visit_Word(self, word): - parent = word.parent + def visit_Text(self, text): + parent = text.parent # Find this node and the first node of the sequence it belongs to first = None for i in range(len(parent)): @@ -289,13 +289,13 @@ first = None elif first is None: first = i - # ``parent.index(word)`` uses value equality - can not be - # used here to find `word` - if id(parent[i]) == id(word): + # ``parent.index(text)`` uses value equality - can not be + # used here to find `text` + if id(parent[i]) == id(text): end = i + 1 break else: - raise IndexError("Can not find %r in its parent" % ( word, )) + raise IndexError("Can not find %r in its parent" % ( text, )) if (len(parent) > end and isinstance(parent[end], nodes.Text)): @@ -303,12 +303,14 @@ # deleted - so work for last node of a sequence return - text = nodes.Text(reduce(lambda s, node: s + node.astext(), + texts = nodes.Text(reduce(lambda s, node: s + node.astext(), parent[first:end], "")) - parent[first:end] = ( text, ) + parent[first:end] = ( texts, ) - visit_White = visit_Word + visit_White = visit_Text + visit_Word = visit_Text + ############################################################################### ############################################################################### # Hashable @@ -486,8 +488,8 @@ elif command == Opcode.Replace: # TODO Replacement doubles elements. This needs to be # reflected by creation of unique @ids for replaced - # elements. This needs to be reflected in referring @refid - # and @backrefs. + # elements. This needs also to be reflected in referring + # @refid and @backrefs. for newChild in self.copyRange(oldRoot, oldRange, self.NewReplaced): self.addChild(diffRoot, newChild) @@ -818,8 +820,8 @@ dispatcher.mergeChildren(diffRoot, oldRoot, newRoot, command, oldRange, newRange) -# A change in certain elements must not be propagated up since they -# may occur only once +# A replacement in certain elements must not be propagated up since +# they may occur only once and replacement would double them replaceNotUp = ( nodes.title, nodes.subtitle, nodes.term, nodes.field_name, nodes.attribution, nodes.caption, # (%text.model) nodes.header, nodes.footer, nodes.definition, @@ -830,9 +832,31 @@ nodes.tbody, # different content model ) +# A replacement in certain elements normally not subject to up +# propagation and contained in certain elements may propagate up if +# all their siblings are also replacements and would propagate up +replaceUpSiblings = ( + ( nodes.title, nodes.section, ), + ( nodes.subtitle, nodes.section, ), + ( nodes.term, nodes.definition_list_item, ), + ( nodes.field_name, nodes.field, ), + ( nodes.attribution, nodes.block_quote, ), + ( nodes.caption, nodes.figure, ), + ( nodes.definition, nodes.definition_list_item, ), + ( nodes.field_body, nodes.field, ), + ( nodes.description, nodes.option_list_item, ), + ( nodes.legend, nodes.figure, ), + ( nodes.option_group, nodes.option_list_item, ), + ) + +# TODO If much text is replaced in a text element the whole element +# should be replaced. This makes more sense to people than two large +# replaced/replacement blocks where the only equality is in words like +# "the". The exact meaning of "much" should be an option. def cleanOpcodes(opcodes, dispatcher, oldList, newList): """Replace some nasty results in `opcodes` by cleaner versions. Opcodes create `newList` from `oldList`.""" + mightReplaceUpSiblings = [ ] for i in range(len(opcodes)): opcode = Opcode(opcodes[i]) ( command, oldRange, newRange, subOpcodes, @@ -864,39 +888,55 @@ opcode.setSubOpcodes(subOpcodes) if len(subOpcodes) == 1: subOpcode = Opcode(subOpcodes[0]) - if (subOpcode.getCommand() != Opcode.Replace - or not reduce(lambda last, cls: - last or isinstance(oldNode, cls), - replaceNotUp, False)): - # TODO If a section/title would propagate up the - # propagation needs to be done if all siblings would - # propagate, too; this way a section replacement - # should work again - # - # This applies to section/title, section/subtitle, - # definition_list_item/term, field/field_name, - # block_quote/attribution, figure/caption, - # definition_list_item/definition, field/field_body, - # option_list_item/description, figure/legend, - # option_list_item/option_group - if subOpcode.getCommand() != Opcode.Descend: - # Propagate 1-element sequences up - opcode.setCommand(subOpcode.getCommand()) + if subOpcode.getCommand() == Opcode.Descend: + propagateUp = False + elif subOpcode.getCommand() == Opcode.Replace: + if any([ isinstance(oldNode, cls) + for cls in replaceNotUp ]): + propagateUp = False + # TODO FIXME `container` must be considered + if any([ isinstance(oldNode, cls) + for ( cls, container, ) in replaceUpSiblings ]): + # If for instance a section/title would + # propagate a replacement up the propagation + # needs to be done if all siblings would + # also propagate a replacement up + mightReplaceUpSiblings.append(i) + else: + propagateUp = True + else: + propagateUp = True + if propagateUp: + # Propagate 1-element sequences up + opcode.setCommand(subOpcode.getCommand()) opcodes[i] = opcode.asTuple() -def createDiff(oldTree, newTree): + if mightReplaceUpSiblings: + # There are entries which might propagate a replace up if all + # siblings could do as well + if all([ i in mightReplaceUpSiblings + or Opcode(opcodes[i]).getCommand() == Opcode.Replace + for i in range(len(opcodes)) ]): + # All entries are replacements which may propagate up - + # actually propagate elements which may propagate + for i in mightReplaceUpSiblings: + opcode = Opcode(opcodes[i]) + opcode.setCommand(Opcode.Replace) + opcodes[i] = opcode.asTuple() + +def createDiff(oldTree, newTree, debug=False): """Create and return a diff document from `oldTree` to `newTree`.""" dispatcher = DocutilsDispatcher() - #dispatcher.debug = True + dispatcher.debug = debug opcodes = doDiff(dispatcher, oldTree, newTree) - if dispatcher.debug: + if debug: from pprint import pprint print(oldTree.asdom().toprettyxml()) print(newTree.asdom().toprettyxml()) pprint(opcodes, sys.stdout, 2, 40, None) print("^^^ Before cleaning vvv After cleaning") cleanOpcodes(opcodes, dispatcher, [ oldTree ], [ newTree ]) - if dispatcher.debug: + if debug: from pprint import pprint pprint(opcodes, sys.stdout, 2, 40, None) if len(opcodes) != 1: Added: trunk/sandbox/rstdiff/setup.py =================================================================== --- trunk/sandbox/rstdiff/setup.py (rev 0) +++ trunk/sandbox/rstdiff/setup.py 2010-11-13 15:26:09 UTC (rev 6481) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from distutils.core import setup + +from version import version + +setup(name='rstdiff', + version=version, + description='Tool for creating a diff highlighting changes from two reStructuredText input files', + author='Stefan Merten', + author_email='sm...@oe...', + url='http://docutils.sourceforge.net/sandbox/rstdiff/', + license='GPL 2', + requires=[ 'docutils' ], + scripts=[ 'rstdiff.py' ], + packages=[ 'treediff' ], + ) Property changes on: trunk/sandbox/rstdiff/setup.py ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/sandbox/rstdiff/tag.log =================================================================== --- trunk/sandbox/rstdiff/tag.log 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tag.log 2010-11-13 15:26:09 UTC (rev 6481) @@ -1 +1 @@ -rstdiff_1_74 +rstdiff_1_90 Property changes on: trunk/sandbox/rstdiff/tests ___________________________________________________________________ Modified: svn:ignore - CVS Makefile *.gmk + secret* CVS Makefile *.gmk Modified: trunk/sandbox/rstdiff/tests/html/expected/contents.html =================================================================== --- trunk/sandbox/rstdiff/tests/html/expected/contents.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/html/expected/contents.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/html/expected/footnote.html =================================================================== --- trunk/sandbox/rstdiff/tests/html/expected/footnote.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/html/expected/footnote.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/html/expected/reference.html =================================================================== --- trunk/sandbox/rstdiff/tests/html/expected/reference.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/html/expected/reference.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/html/expected/textDifferent.html =================================================================== --- trunk/sandbox/rstdiff/tests/html/expected/textDifferent.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/html/expected/textDifferent.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/html/filterunit.cfg =================================================================== --- trunk/sandbox/rstdiff/tests/html/filterunit.cfg 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/html/filterunit.cfg 2010-11-13 15:26:09 UTC (rev 6481) @@ -7,4 +7,5 @@ inputCount = 2 expectedExtension = .html -options = --writer=html --no-doc-title $1< $2< +options = --writer=html --no-doc-title +arguments = $1< $2< Modified: trunk/sandbox/rstdiff/tests/simple/expected/attributes.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simple/expected/attributes.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/expected/attributes.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/attributes.old.rst => input/attributes.new.rst"> <paragraph> Some attributes must be treated special. Modified: trunk/sandbox/rstdiff/tests/simple/expected/inlineStyles.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simple/expected/inlineStyles.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/expected/inlineStyles.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/inlineStyles.old.rst => input/inlineStyles.new.rst"> <paragraph> Here is Modified: trunk/sandbox/rstdiff/tests/simple/expected/section.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simple/expected/section.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/expected/section.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/section.old.rst => input/section.new.rst"> <section ids="first-section" names="first\ section"> <title> Modified: trunk/sandbox/rstdiff/tests/simple/expected/textDifferent.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simple/expected/textDifferent.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/expected/textDifferent.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/textDifferent.old.rst => input/textDifferent.new.rst"> <paragraph> <inline classes="change-replaced"> Modified: trunk/sandbox/rstdiff/tests/simple/expected/textEqual.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simple/expected/textEqual.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/expected/textEqual.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/textEqual.old.rst => input/textEqual.new.rst"> <paragraph> An eternal line. Modified: trunk/sandbox/rstdiff/tests/simple/expected/textOnly.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simple/expected/textOnly.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/expected/textOnly.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/textOnly.old.rst => input/textOnly.new.rst"> <paragraph classes="change-added"> An important addition. Modified: trunk/sandbox/rstdiff/tests/simple/filterunit.cfg =================================================================== --- trunk/sandbox/rstdiff/tests/simple/filterunit.cfg 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/filterunit.cfg 2010-11-13 15:26:09 UTC (rev 6481) @@ -5,4 +5,5 @@ inputCount = 2 expectedExtension = .xml -options = --writer=xml --indents --no-doctype $1< $2< +options = --writer=xml --indents --no-doctype +arguments = $1< $2< Modified: trunk/sandbox/rstdiff/tests/simple/source/section.rst =================================================================== --- trunk/sandbox/rstdiff/tests/simple/source/section.rst 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simple/source/section.rst 2010-11-13 15:26:09 UTC (rev 6481) @@ -45,4 +45,3 @@ =================== Text replacement. - Modified: trunk/sandbox/rstdiff/tests/simpleHtml/expected/attributes.html =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/expected/attributes.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/expected/attributes.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> /* :Author: David Goodger (go...@py...) -:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $ +:Id: $Id: html4css1.css 6387 2010-08-13 12:23:41Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/simpleHtml/expected/inlineStyles.html =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/expected/inlineStyles.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/expected/inlineStyles.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> /* :Author: David Goodger (go...@py...) -:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $ +:Id: $Id: html4css1.css 6387 2010-08-13 12:23:41Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } @@ -310,8 +320,8 @@ <p>Here is <em class="change-replaced">some</em><strong class="change-replacement">some</strong> inline markup which <strong class="change-replaced">ends up</strong><em class="change-replacement">ends up</em> in different rendering styles.</p> <p>Inline <span class="change-replaced">markup</span><strong class="change-replacement">markup</strong> for references is not included here.</p> -<p>Basically this consists of <span class="change-replaced">two</span><tt class="change-replacement docutils literal"><span class="pre">two</span></tt> forms of emphasis and of <tt class="change-replaced docutils literal"><span class="pre">literal</span> -<span class="pre">text</span></tt><span class="change-replaced">.</span><span class="change-replacement">literal +<p>Basically this consists of <span class="change-replaced">two</span><tt class="change-replacement docutils literal">two</tt> forms of emphasis and of <tt class="change-replaced docutils literal">literal +text</tt><span class="change-replaced">.</span><span class="change-replacement">literal text.</span></p> </div> </body> Modified: trunk/sandbox/rstdiff/tests/simpleHtml/expected/section.html =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/expected/section.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/expected/section.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> /* :Author: David Goodger (go...@py...) -:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $ +:Id: $Id: html4css1.css 6387 2010-08-13 12:23:41Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/simpleHtml/expected/textDifferent.html =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/expected/textDifferent.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/expected/textDifferent.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> /* :Author: David Goodger (go...@py...) -:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $ +:Id: $Id: html4css1.css 6387 2010-08-13 12:23:41Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/simpleHtml/expected/textEqual.html =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/expected/textEqual.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/expected/textEqual.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> /* :Author: David Goodger (go...@py...) -:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $ +:Id: $Id: html4css1.css 6387 2010-08-13 12:23:41Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/simpleHtml/expected/textOnly.html =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/expected/textOnly.html 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/expected/textOnly.html 2010-11-13 15:26:09 UTC (rev 6481) @@ -3,13 +3,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" /> <title></title> <style type="text/css"> /* :Author: David Goodger (go...@py...) -:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $ +:Id: $Id: html4css1.css 6387 2010-08-13 12:23:41Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -47,6 +47,10 @@ dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -157,16 +161,22 @@ hr.docutils { width: 75% } -img.align-left, .figure.align-left{ +img.align-left, .figure.align-left, object.align-left { clear: left ; float: left ; margin-right: 1em } -img.align-right, .figure.align-right { +img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em } +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left } Modified: trunk/sandbox/rstdiff/tests/simpleHtml/filterunit.cfg =================================================================== --- trunk/sandbox/rstdiff/tests/simpleHtml/filterunit.cfg 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleHtml/filterunit.cfg 2010-11-13 15:26:09 UTC (rev 6481) @@ -8,4 +8,5 @@ inputCount = 2 expectedExtension = .html -options = --writer=html --no-doc-title $1< $2< +options = --writer=html --no-doc-title +arguments = $1< $2< Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/expected/attributesNoSource.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/expected/attributesNoSource.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/expected/attributesNoSource.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/attributesNoSource.old.rst => input/attributesNoSource.new.rst"> <paragraph> Some attributes must be treated special and there is no source Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/expected/onceOnly.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/expected/onceOnly.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/expected/onceOnly.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/onceOnly.old.rst => input/onceOnly.new.rst"> <title> <inline classes="change-replaced"> @@ -272,6 +272,24 @@ <option_list> <option_list_item> <option_group> + <option> + <option_string> + --same + </option_string> + </option> + </option_group> + <description> + <paragraph classes="change-replaced"> + Some old description - still description may +appear only once + </paragraph> + <paragraph classes="change-replacement"> + A NEW DESCRIPTION + </paragraph> + </description> + </option_list_item> + <option_list_item> + <option_group> <option classes="change-replaced"> <option_string> --option @@ -289,35 +307,41 @@ </paragraph> </description> </option_list_item> - <option_list_item> + <option_list_item classes="change-replaced"> <option_group> - <option classes="change-replaced"> + <option> <option_string> -o </option_string> </option> - <option classes="change-replaced"> + <option> <option_string> --option_group </option_string> </option> - <option classes="change-replacement"> + </option_group> + <description> + <paragraph> + The option_group and the description may also appear +only once + </paragraph> + </description> + </option_list_item> + <option_list_item classes="change-replacement"> + <option_group> + <option> <option_string> -g </option_string> </option> - <option classes="change-replacement"> + <option> <option_string> --group </option_string> </option> </option_group> <description> - <paragraph classes="change-replaced"> - The option_group and the description may also appear -only once - </paragraph> - <paragraph classes="change-replacement"> + <paragraph> THE DESCRIPTION AS WELL AS THE OPTION_GROUP MUST BE SINGLE. </paragraph> </description> Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/expected/pcdataOnly.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/expected/pcdataOnly.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/expected/pcdataOnly.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/pcdataOnly.old.rst => input/pcdataOnly.new.rst"> <paragraph> Some elements may contain only #PCDATA. They need to propagate changes Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/expected/references.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/expected/references.xml 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/expected/references.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generated by Docutils 0.6 --> +<!-- Generated by Docutils 0.8 --> <document source="input/references.old.rst => input/references.new.rst"> <title> Header Added: trunk/sandbox/rstdiff/tests/simpleNoSource/expected/section.xml =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/expected/section.xml (rev 0) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/expected/section.xml 2010-11-13 15:26:09 UTC (rev 6481) @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generated by Docutils 0.8 --> +<document source="input/section.old.rst => input/section.new.rst"> + <section ids="replaceable-title" names="replaceable\ title"> + <title> + <inline classes="change-replaced"> + Replaceable title + </inline> + <inline classes="change-replacement"> + Title replacement + </inline> + </title> + <paragraph> + Same text. + </paragraph> + </section> + <section ids="anchor" names="anchor"> + <title> + Anchor + </title> + <paragraph> + Don't reuse words! + </paragraph> + </section> + <section classes="change-replaced" ids="replacable-section" names="replacable\ section"> + <title> + Replacable section + </title> + <paragraph> + Replacable text. + </paragraph> + </section> + <section classes="change-replacement" ids="section-replacement" names="section\ replacement"> + <title> + Section replacement + </title> + <paragraph> + Text replacement. + </paragraph> + </section> +</document> Property changes on: trunk/sandbox/rstdiff/tests/simpleNoSource/expected/section.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/filterunit.cfg =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/filterunit.cfg 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/filterunit.cfg 2010-11-13 15:26:09 UTC (rev 6481) @@ -5,4 +5,5 @@ inputCount = 2 expectedExtension = .xml -options = --writer=xml --indents --no-doctype $1< $2< +options = --writer=xml --indents --no-doctype +arguments = $1< $2< Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.new.rst =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.new.rst 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.new.rst 2010-11-13 15:26:09 UTC (rev 6481) @@ -76,6 +76,8 @@ Some elements are of both types. +--same A NEW DESCRIPTION + --changed A changing option_string must propagate to option -g, --group THE DESCRIPTION AS WELL AS THE OPTION_GROUP MUST BE SINGLE. Modified: trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.old.rst =================================================================== --- trunk/sandbox/rstdiff/tests/simpleNoSource/input/onceOnly.old.rst 2010-11-12 19:22:41 UTC (rev 6480) +++ trunk/sandbox/rstdiff/tests/simpleNoSource/... [truncated message content] |