ChangeSet.st
changeset 3520 13a17b7c03ba
parent 3518 1b770a65ef66
child 3521 6e43c118d860
equal deleted inserted replaced
3519:007417da21ef 3520:13a17b7c03ba
   760      The block is invoked with the change, a lineNumberOrNil and streamPosition arguments. 
   760      The block is invoked with the change, a lineNumberOrNil and streamPosition arguments. 
   761      The lineNumber is only valid, if the underlying stream 
   761      The lineNumber is only valid, if the underlying stream 
   762      provides line-numbers; otherwise, nil is passed."
   762      provides line-numbers; otherwise, nil is passed."
   763 
   763 
   764     |encodedStream chunk s change currentNameSpace currentPackage
   764     |encodedStream chunk s change currentNameSpace currentPackage
   765      lineNumber pos reader size |
   765      lineNumber pos reader reportProgress size |
   766 
   766 
   767     currentNameSpace := Smalltalk.
   767     currentNameSpace := Smalltalk.
   768     currentPackage := Class packageQuerySignal query.
   768     currentPackage := Class packageQuerySignal query.
   769 
   769 
   770     (reader := aReader) isNil ifTrue:[
   770     (reader := aReader) isNil ifTrue:[
   772     ].
   772     ].
   773 
   773 
   774     encodedStream := aStream isEncodedStream 
   774     encodedStream := aStream isEncodedStream 
   775                         ifTrue:[aStream ]
   775                         ifTrue:[aStream ]
   776                         ifFalse:[EncodedStream decodedStreamFor: aStream ].
   776                         ifFalse:[EncodedStream decodedStreamFor: aStream ].
   777     size := encodedStream stream size.
   777     reportProgress := encodedStream stream isPositionable and:[ ProgressNotification isHandled ].
       
   778     reportProgress ifTrue:[
       
   779         size := encodedStream stream size.
       
   780     ].
   778 
   781 
   779     reader changeSet:aChangeSet.
   782     reader changeSet:aChangeSet.
   780     reader changeAction:aBlock.
   783     reader changeAction:aBlock.
   781     reader inputStream:encodedStream.
   784     reader inputStream:encodedStream.
   782 
   785 
   783     [encodedStream atEnd] whileFalse:[
   786     [encodedStream atEnd] whileFalse:[
   784         encodedStream skipSeparators.
   787         encodedStream skipSeparators.
   785         lineNumber := encodedStream lineNumber.
   788         lineNumber := encodedStream lineNumber.
   786         pos := encodedStream position + 1.
   789 
   787 
   790 
   788         ProgressNotification notify: nil progress:(100 / size) * pos.
   791         reportProgress ifTrue:[
       
   792             pos := encodedStream position + 1.
       
   793             ProgressNotification notify: nil progress:(100 / size) * pos.
       
   794         ].
   789 
   795 
   790         chunk := encodedStream nextChunk.
   796         chunk := encodedStream nextChunk.
   791 
   797 
   792         (chunk notEmptyOrNil) ifTrue:[
   798         (chunk notEmptyOrNil) ifTrue:[
   793             Class nameSpaceQuerySignal handle:[:ex| ex proceedWith:currentNameSpace] do:[
   799             Class nameSpaceQuerySignal handle:[:ex| ex proceedWith:currentNameSpace] do:[
   880      ChangeSet fromStream:(Object source asString readStream)
   886      ChangeSet fromStream:(Object source asString readStream)
   881     "
   887     "
   882 
   888 
   883     "Created: / 16-02-1998 / 12:19:34 / cg"
   889     "Created: / 16-02-1998 / 12:19:34 / cg"
   884     "Modified: / 30-07-2013 / 21:34:16 / cg"
   890     "Modified: / 30-07-2013 / 21:34:16 / cg"
   885     "Modified: / 04-02-2014 / 19:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   891     "Modified: / 13-03-2014 / 23:13:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   886 ! !
   892 ! !
   887 
   893 
   888 !ChangeSet class methodsFor:'queries'!
   894 !ChangeSet class methodsFor:'queries'!
   889 
   895 
   890 current
   896 current
  3946  hereby transferred.
  3952  hereby transferred.
  3947 "
  3953 "
  3948 !
  3954 !
  3949 
  3955 
  3950 version_SVN
  3956 version_SVN
  3951     ^ '$Id: ChangeSet.st,v 1.238 2014-03-06 17:29:27 vrany Exp $'
  3957     ^ '$Id: ChangeSet.st,v 1.239 2014-03-13 23:23:51 vrany Exp $'
  3952 ! !
  3958 ! !
  3953 
  3959 
  3954 !ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'instance creation'!
  3960 !ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'instance creation'!
  3955 
  3961 
  3956 new
  3962 new
  4611 ! !
  4617 ! !
  4612 
  4618 
  4613 !ChangeSet class methodsFor:'documentation'!
  4619 !ChangeSet class methodsFor:'documentation'!
  4614 
  4620 
  4615 version
  4621 version
  4616     ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.238 2014-03-06 17:29:27 vrany Exp $'
  4622     ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.239 2014-03-13 23:23:51 vrany Exp $'
  4617 !
  4623 !
  4618 
  4624 
  4619 version_CVS
  4625 version_CVS
  4620     ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.238 2014-03-06 17:29:27 vrany Exp $'
  4626     ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.239 2014-03-13 23:23:51 vrany Exp $'
  4621 !
  4627 !
  4622 
  4628 
  4623 version_HG
  4629 version_HG
  4624 
  4630 
  4625     ^ '$Changeset: <not expanded> $'
  4631     ^ '$Changeset: <not expanded> $'
  4626 !
  4632 !
  4627 
  4633 
  4628 version_SVN
  4634 version_SVN
  4629     ^ '$Id: ChangeSet.st,v 1.238 2014-03-06 17:29:27 vrany Exp $'
  4635     ^ '$Id: ChangeSet.st,v 1.239 2014-03-13 23:23:51 vrany Exp $'
  4630 ! !
  4636 ! !
  4631 
  4637