* @param data the new data for that version
     * @param mergeSharedVersions if true merge all versions sharing the
     * same text in the original to the replacement text
     */
    private void revise( Graph original, short version, char[] data,
        boolean mergeSharedVersions ) throws Exception
    {
        char[] base = getVersion( version );
        Diff[] diffs = Matrix.computeBasicDiffs( data, base );
        TreeMap<SpecialArc,Graph> specials =
			new TreeMap<SpecialArc,Graph>(new SpecialComparator());
        Graph[] miniGraphs = new Graph[diffs.length];
        Node n = original.getStart();
        for ( int pos=0,i=0;i<diffs.length;i++ )
        {
            miniGraphs[i] = original.getMiniGraph( diffs[i], version, pos, n );
            pos = diffs[i].oldOff()+diffs[i].oldLen();
            n = miniGraphs[i].getEnd();
        }
        for ( int i=0;i<miniGraphs.length;i++ )
        {
            Graph g = miniGraphs[i];
            BitSet shared = g.getSharedVersions(version);
            g.removeVersions( shared );
			char[] diffData = new char[diffs[i].newLen()];
			int offset = diffs[i].newOff();
			for ( int j=0;j<diffData.length;j++ )
				diffData[j] = data[offset+j];
            SpecialArc special = g.addSpecialArc( diffData, shared, offset );
			if ( g.getStart().cardinality() > 1 )
			{
				MUM bestMUM = computeBestMUM( g, special );
				if ( bestMUM != null )
					mergeSpecial( g, bestMUM );
			}
			g.adopt( version );
        }
    }