TDScriptLeafNode{#name:'postUpgrade330SortedCollectionSortBlocks',#contents:'[ :topez :objIn :tokens :command :commandNode | 
  | opts args |
  \"for help: ./postUpgrade330SortedCollectionSortBlocks -h\"
  command
    getOptsMixedLongShort:
      {#(\'help\' $h #\'none\').
      #(\'sourceVersion\' nil #\'required\')}
    optionsAndArguments: [ :options :operands | 
      opts := options.
      args := operands ].
  opts
    at: \'help\'
    ifAbsent: [ 
      | gsTool sourceStoneVersion currentStoneVersion userId co allClasses instances instanceCount sbCls |
      gsTool := topez toolInstanceFor: \'gs\'.
      currentStoneVersion := ((gsTool gsversion: #\'stone\') at: \'gsVersion\')
        asMetacelloVersionNumber.
      opts
        at: \'sourceVersion\'
        ifPresent: [ :sourceVersionString | sourceStoneVersion := sourceVersionString asMetacelloVersionNumber ]
        ifAbsent: [ self error: \'Required option --sourceVersion not present\' ].
      userId := GsCurrentSession currentSession userProfile userId.
      Transcript
        cr;
        show: \'Recompiling Sort Blocks using \' , command command printString;
        cr;
        show: \'-----------------------\';
        cr;
        show: \'Finding sorted collections...\'.
      System commit.
      co := ClassOrganizer newWithRoot: SortedCollection forUserId: userId.
      allClasses := co allSubclassesOf: SortedCollection.
      allClasses add: SortedCollection.
      instances := SystemRepository fastListInstances: allClasses asArray.
      instanceCount := 0.
      instances do: [ :ar | instanceCount := instanceCount + ar size ].
      Transcript
        cr;
        show:
            \'Recompiling sort blocks for \' , instances size printString
                , \' sorted collections...\'.
      sbCls := Globals
        at: #\'SimpleBlock\'
        ifAbsent: [ (Globals at: #\'ObsoleteClasses\') at: #\'SimpleBlock\' ].
      instances
        do: [ :ar | 
          ar
            do: [ :sc | 
              | aBlock cls |
              aBlock := sc sortBlock.
              cls := aBlock class.
              cls
                ifNil: [ self error: \'cannot find class of sortBlock\' ]
                ifNotNil: [ 
                  | needsRecompile |
                  needsRecompile := true.
                  (cls _subclassOf: ExecBlock)
                    ifTrue: [ needsRecompile := aBlock method needsRecompile ].
                  needsRecompile
                    ifTrue: [ 
                      | str val |
                      str := aBlock _sourceString.
                      val := str evaluate.
                      val
                        ifNotNil: [ sc _sortBlock: val ]
                        ifNil: [ self error: \'Could not recompile sortBlock \' , aBlock asOop printString ] ] ].
              System commit ] ].
      Transcript
        cr;
        show: \'Finished recompiling sort block for \'.
      \'Recompiled sort block for \' , instances size printString
        , \' sorted collections\' ]
    ifPresent: [ :ignored | 
      TDManPage
        viewManPage:
          \'NAME
  postUpgrade330SortedCollectionSortBlocks - Post-upgrade recompile sortBlocks for SortedCollections
SYNOPSIS
  postUpgrade330SortedCollectionSortBlocks [-h|--help] --sourceVersion=<source-gemstone-version>

DESCRIPTION
  Recompile sortBlocks for SortedCollections.

  The environment variable $upgradeLogDir is expected to be set -- normally set by 
  $GS_HOME/bin/upgradeStone.

  3.3.0 variant, where we don\'\'t use the SortedCollection helper methods.

EXAMPLES
  ./postUpgrade330SortedCollectionSortBlocks -h

  ./postUpgrade330SortedCollectionSortBlocks --sourceVersion=3.2.9 
\'
        topez: topez ] ]',#creationTime:DateAndTime['2016-05-23T10:31:54.3779799938201-07:00'],#modificationTime:DateAndTime['2016-06-07T14:51:31.06256008148193-07:00']}