# HG changeset patch # User fm # Date 1253724810 -7200 # Node ID 61343482b6c7dfb2a873da73535757dadd8061b8 # Parent e2b07b2791a314948697b7c5f88b83c13672e2fc *** empty log message *** diff -r e2b07b2791a3 -r 61343482b6c7 extensions.st --- a/extensions.st Wed Sep 23 18:53:27 2009 +0200 +++ b/extensions.st Wed Sep 23 18:53:30 2009 +0200 @@ -0,0 +1,1710 @@ +"{ Package: 'cvut:stx/goodies/libsvn' }" +! + +!ApplicationDefinition class methodsFor:'file templates'! + +make_dot_proto + +^ +'# $','Header','$ +# +# -------------- no need to change anything below ---------- +# +# This makefile generates some standalone demo applications +# +# make +# generates %(APPLICATION) +# + +TOP=%(TOP) +INCLUDE_TOP=$(TOP)/.. + +PACKAGE=%(APPLICATION_PACKAGE) +SUBDIRS= +SUPPRESS_LOCAL_ABBREVS="yes" +NOAUTOLOAD=1 +NOSUBAUTOLOAD=1 + +LOCALINCLUDES=-I$(INCLUDE_TOP)/stx/libbasic %(LOCAL_INCLUDES) +LOCALDEFINES=%(LOCAL_DEFINES) +GLOBALDEFINES=%(GLOBAL_DEFINES) +MAIN_DEFINES=%(MAIN_DEFINES) + +RCSSOURCES=Make.proto *.st +LINKSOURCES=Make.proto *.st + +DELIVERBINARIES= + +target: %(BUILD_TARGET) + +all:: prereq exe + +exe: %(APPLICATION) $(REQUIRED_SUPPORT_DIRS) + +LIBNAME=%(LIBRARY_NAME) +STCLOCALOPT=''-package=$(PACKAGE)'' -I. -H. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) %(HEADEROUTPUTARG) %(COMMONSYMFLAG) -varPrefix=$(LIBNAME) + + +# ********** OPTIONAL: MODIFY the next line *** +# additional C-libraries that should be pre-linked with the class-objects +LD_OBJ_LIBS=%(ADDITIONAL_LINK_LIBRARIES) +LOCAL_SHARED_LIBS=%(ADDITIONAL_SHARED_LINK_LIBRARIES) + + +# ********** OPTIONAL: MODIFY the next line *** +# additional C targets or libraries should be added below +LOCAL_EXTRA_TARGETS= + +OBJS= $(COMMON_OBJS) $(UNIX_OBJS) + +%(ADDITIONAL_DEFINITIONS) + +%(ADDITIONAL_DEFINITIONS_SVN) + +LIBLIST = $(REQUIRED_LIBS) + +# required libs: +# + +REQUIRED_LIBS=%(REQUIRED_LIBS) + +REQUIRED_LIBOBJS=%(REQUIRED_LIBOBJS) + +REQUIRED_LINK_LIBOBJS=%(REQUIRED_LINK_LIBOBJS) + +REQUIRED_SUPPORT_DIRS=%(REQUIRED_SUPPORT_DIRS) + + +%(APPLICATION): %(STARTUP_CLASSFILENAME).$(O) $(APP_DIRS_TO_MAKE) $(APP_LIBOBJS) $(OBJS) + $(MAKE) %(APPLICATION_TYPE) \ + TARGET=%(APPLICATION) \ + APPLICATION_CLASSES="%(STARTUP_CLASSFILENAME)" \ + APPLICATION_OBJS="$(OBJS)" \ + APPLICATION_LIBLIST="$(REQUIRED_LIBS)" \ + APPLICATION_LIBOBJS="$(REQUIRED_LIBOBJS)" \ + APPLICATION_LINK_LIBOBJS="$(REQUIRED_LINK_LIBOBJS)" \ + STARTUP_CLASS="%(STARTUP_CLASS)" \ + STARTUP_SELECTOR="%(STARTUP_SELECTOR)" \ + MAIN_DEFINES="%(MAIN_DEFINES)" + +# build all prerequisite packages for this package +prereq: +%(MAKE_PREREQUISITES) + +SOURCEFILES: %(APPLICATION)_SOURCES \ + stx_SOURCES + +%(SOURCE_RULES) +%(STX_SOURCE_RULES) + +RESOURCEFILES: %(APPLICATION)_RESOURCES %(APPLICATION)_BITMAPS %(ADDITIONAL_RESOURCE_TARGETS) \ + stx_RESOURCES stx_STYLES stx_BITMAPS + +%(RESOURCE_RULES) +%(STX_RESOURCE_RULES) + +%(PREREQUISITES_LIBS) +%(SUBPROJECTS_LIBS) + +%(ADDITIONAL_RULES) + +%(ADDITIONAL_RULES_SVN) + +clean:: + -rm -f *.so %(APPLICATION).$(O) + +clobber:: clean + -rm -f %(APPLICATION) *.img *.sav + +# BEGINMAKEDEPEND --- do not remove this line; make depend needs it +%(DEPENDENCIES) +# ENDMAKEDEPEND --- do not remove this line +' + + "Modified: / 09-08-2006 / 16:50:23 / fm" + "Created: / 29-09-2006 / 23:47:07 / cg" + "Modified: / 24-06-2009 / 21:40:26 / Jan Vrany " +! ! + +!Change methodsFor:'queries'! + +isForGeneratedSubject + " + Answers true iff subject of this method is somewhat + auto-generated by some tool - just like version methods + are. + " + + ^ false + + "Created: / 08-04-2009 / 09:45:26 / Jan Vrany " + "Modified: / 17-08-2009 / 18:55:20 / Jan Vrany " +! ! + +!Change methodsFor:'queries'! + +isMethodPackageChange + ^ false + + "Created: / 08-04-2009 / 09:00:21 / Jan Vrany " +! ! + +!ChangeSet methodsFor:'queries'! + +changesForPackage:aPackageSymbol + + " + ChangeSet current changesForPackage:#'stx:goodies/libsvn'. + + " + + ^(self select:[:aChange | + |removeThis mClass mthd| + + removeThis := false. + (aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ + mClass := aChange changeClass. + mClass notNil ifTrue:[ + mthd := mClass compiledMethodAt:(aChange selector). + mthd isNil ifTrue:[ + aChange isMethodRemoveChange ifTrue:[ + removeThis := (mClass package = aPackageSymbol) + ]. + ] ifFalse:[ + removeThis := (mthd package = aPackageSymbol) + ] + ]. + ] ifFalse:[ + (aChange isClassChange) ifTrue:[ + (aChange changeClass notNil) ifTrue:[ + removeThis := (aChange changeClass package = aPackageSymbol) + ]. + ]. + ]. + removeThis + ]) + + "Created: / 05-11-2001 / 14:21:17 / cg" + "Modified: / 12-10-2006 / 16:51:27 / cg" + "Modified: / 22-10-2008 / 13:25:02 / Jan Vrany " +! ! + +!ChangeSet methodsFor:'utilities'! + +condenseChanges + + | changesToRemove changesToKeep | + changesToKeep := self class new. + changesToRemove := self class new. + self reverseDo: + [:change| + (changesToKeep anySatisfy:[:each|each isForSameAs: change]) + ifTrue:[changesToRemove add: change] + ifFalse:[changesToKeep add: change] + ]. + self condenseChanges: changesToRemove. + + "Created: / 22-10-2008 / 13:05:13 / Jan Vrany " +! ! + +!ChangeSet methodsFor:'utilities'! + +condenseChangesForPackage2:aPackageSymbol + "remove more changes for aPackageSymbol + This is invoked when a project is checked into the repository." + + |changesToRemove| + + changesToRemove := self select:[:aChange | + |removeThis mClass mthd| + + removeThis := false. + (aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[ + mClass := aChange changeClass. + mClass notNil ifTrue:[ + mthd := mClass compiledMethodAt:(aChange selector). + mthd isNil ifTrue:[ + removeThis := (mClass package = aPackageSymbol) + ] ifFalse:[ + removeThis := (mthd package = aPackageSymbol) + ] + ]. + ] ifFalse:[ + (aChange isClassChange) ifTrue:[ + (aChange changeClass notNil) ifTrue:[ + removeThis := (aChange changeClass package = aPackageSymbol) + ]. + ]. + ]. + removeThis + ]. + + self condenseChanges:changesToRemove + + "Modified: / 12-10-2006 / 16:51:27 / cg" + "Created: / 09-08-2009 / 14:29:17 / Jan Vrany " +! ! + +!ChangeSet methodsFor:'utilities'! + +diffSetsAgainstImage + + |imageChangeSet| + + imageChangeSet := self class new. + self changedClasses do: + [:class| + (class isMetaclass or:[class isPrivate]) ifFalse: + [imageChangeSet addAll: + (self class fromStream: class source asString readStream)]]. + ^self diffSetsAgainst: imageChangeSet + + "Created: / 04-12-2007 / 16:03:28 / janfrog" +! ! + +!ChangeSet class methodsFor:'instance creation'! + +forPackage: package + + ^self forPackage: package ignoreAutoloaded: false. + + "Created: / 20-05-2008 / 17:56:18 / Jan Vrany " + "Modified: / 12-08-2009 / 14:23:15 / Jan Vrany " +! ! + +!ChangeSet class methodsFor:'instance creation'! + +forPackage: package ignoreAutoloaded: ignoreAutoloaded + "build a changeSet for a given package" + + |changeSet packageClasses packageExtensions| + + packageClasses := ProjectDefinition searchForClassesWithProject: package. + packageExtensions := ProjectDefinition searchForExtensionsWithProject: package. + changeSet := self forExistingMethods: packageExtensions. + packageClasses do: + [:cls| + (ignoreAutoloaded not and:[cls isLoaded not]) + ifTrue:[cls autoload]. + cls isLoaded + ifTrue: + [changeSet addAll: + (self + forExistingClass:cls + withExtensions:false + extensionsOnly:false)]]. + ^changeSet + + "Created: / 12-08-2009 / 14:22:44 / Jan Vrany " +! ! + +!Class methodsFor:'accessing'! + +classFilename + "return the name of the file from which the class was compiled. + If the class was loaded via an explicit load (i.e. from the fileBrowser), + this will be an absolute path. Oherwise, it will be a basename only. + See classBaseFilename for a method which always returns the basename." + + |owner info fn| + + (SVN::CompatModeQuery notNil and:[SVN::CompatModeQuery query not]) + ifTrue:[^SVN::Repository containerNameForClass: self]. + + (owner := self owningClass) notNil ifTrue:[^ owner classFilename]. + classFilename notNil + ifTrue:[ ^ classFilename ]. + + (info := self revisionInfo) notNil ifTrue:[ + fn := info fileName. + fn notNil ifTrue:[ + ^ fn + ]. + ]. + ^ (Smalltalk fileNameForClass:self), '.st' + + " + SVN::Repository classFilename + " + + "Modified: / 22-10-2008 / 20:58:21 / cg" + "Modified: / 13-08-2009 / 16:07:07 / Jan Vrany " +! ! + +!Class methodsFor:'fileOut'! + +fileOutAsMethodIn: class selector: selector + + ^self fileOutAsMethodIn: class selector: selector category: 'sources' + + "Created: / 08-04-2009 / 20:58:06 / Jan Vrany " +! ! + +!Class methodsFor:'accessing'! + +svnRepository + + ^SVN::RepositoryManager repositoryForPackage: self package + + "Created: / 19-04-2008 / 18:24:54 / Jan Vrany " +! ! + +!ClassChange methodsFor:'queries'! + +isForMeta + ^ (self className endsWith:' class') +! ! + +!ClassChange methodsFor:'accessing'! + +nonMetaClassName + ^ self isForMeta + ifTrue:[ self className copyTo:(self className size - 6) ] + ifFalse:[ self className ] + + "Created: / 06-11-2008 / 17:26:03 / Jan Vrany " +! ! + +!Filename methodsFor:'reading-directories'! + +directoryContentsAsFilenamesMatching: patternOrCollectionOfThose + + " + Same as directoryContentsAsFilenames, but returns only files + that matches given patterns. This uses String>>matches: + for pattern matching + " + + |names| + + names := self directoryContentsMatching: patternOrCollectionOfThose . + names isNil ifTrue:[^ nil]. + ^ names asOrderedCollection collect:[:entry | self construct:entry]. + + " + '/etc' asFilename + directoryContentsAsFilenamesMatching: 'pass*' + + '/etc' asFilename + directoryContentsAsFilenamesMatching: #('pass*' 'nsswitch.conf') + " + + "Created: / 03-06-2009 / 09:57:45 / Jan Vrany " +! ! + +!Filename methodsFor:'reading-directories'! + +directoryContentsMatching: patternOrCollectionOfThose + + " + Same as directoryContants, but returns only files + that matches given patterns. This uses String>>matches: + for pattern matching + " + + | names patterns | + patterns := patternOrCollectionOfThose isString + ifTrue: [Array with: patternOrCollectionOfThose] + ifFalse:[patternOrCollectionOfThose]. + names := self directoryContents. + names ifNil:[^nil]. + ^names select: + [:e|patterns anySatisfy:[:pattern|e matches: pattern]] + + " + '/etc' asFilename + directoryContentsMatching: 'pass*' + + '/etc' asFilename + directoryContentsMatching: #('pass*' 'nsswitch.conf') + + '/etc' asFilename + directoryContentsMatching: #('does-not-exists.txt') + + " + + "Created: / 03-06-2009 / 09:52:52 / Jan Vrany " +! ! + +!LibraryDefinition class methodsFor:'file templates'! + +make_dot_proto + +^ +'# $','Header','$ +# +# DO NOT EDIT +# automagically generated from the projectDefinition: ',self name,'. +# +# Warning: once you modify this file, do not rerun +# stmkmp or projectDefinition-build again - otherwise, your changes are lost. +# +# The Makefile as generated by this Make.proto supports the following targets: +# make - compile all st-files to a classLib +# make clean - clean all temp files +# make clobber - clean all +# +# This file contains definitions for Unix based platforms. +# It shares common definitions with the win32-make in Make.spec. + +# +# position (of this package) in directory hierarchy: +# (must point to ST/X top directory, for tools and includes) +TOP=%(TOP) +INCLUDE_TOP=$(TOP)/.. + +# subdirectories where targets are to be made: +SUBDIRS=%(SUBDIRECTORIES) + + +# subdirectories where Makefiles are to be made: +# (only define if different from SUBDIRS) +# ALLSUBDIRS= + +REQUIRED_SUPPORT_DIRS=%(REQUIRED_SUPPORT_DIRS) + +# if your embedded C code requires any system includes, +# add the path(es) here:, +# ********** OPTIONAL: MODIFY the next lines *** +# LOCALINCLUDES=-Ifoo -Ibar +LOCALINCLUDES=%(LOCAL_INCLUDES) + + +# if you need any additional defines for embedded C code, +# add them here:, +# ********** OPTIONAL: MODIFY the next lines *** +# LOCALDEFINES=-Dfoo -Dbar -DDEBUG +LOCALDEFINES=%(LOCAL_DEFINES) + +LIBNAME=%(LIBRARY_NAME) +STCLOCALOPT=''-package=$(PACKAGE)'' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) %(HEADEROUTPUTARG) %(COMMONSYMFLAG) -varPrefix=$(LIBNAME) + + +# ********** OPTIONAL: MODIFY the next line *** +# additional C-libraries that should be pre-linked with the class-objects +LD_OBJ_LIBS=%(ADDITIONAL_LINK_LIBRARIES) +LOCAL_SHARED_LIBS=%(ADDITIONAL_SHARED_LINK_LIBRARIES) + + +# ********** OPTIONAL: MODIFY the next line *** +# additional C targets or libraries should be added below +LOCAL_EXTRA_TARGETS= + +OBJS= $(COMMON_OBJS) $(UNIX_OBJS) + +%(ADDITIONAL_DEFINITIONS) + +all:: preMake %(PRIMARY_TARGET) postMake + +pre_objs:: %(ADDITIONAL_TARGETS) %(ADDITIONAL_TARGETS_SVN) + +%(ADDITIONAL_RULES) + +%(ADDITIONAL_RULES_SVN) + +# add more install actions here +install:: + +# add more install actions for aux-files (resources) here +installAux:: + +# add more preMake actions here +preMake:: + +# add more postMake actions here +postMake:: cleanjunk + +prereq: $(REQUIRED_SUPPORT_DIRS) +%(MAKE_PREREQUISITES) + +cleanjunk:: + +clean:: +%(TAB)-rm -f *.o *.H + +clobber:: clean +%(TAB)-rm -f *.so *.dll + +', +" +$(INSTALLBASE):: +%(TAB)@test -d $@ || mkdir $@ + +$(INSTALLBASE)/packages:: $(INSTALLBASE) +%(TAB)@test -d $@ || mkdir $@ + +$(INSTALLBASE)/packages/$(MODULE):: $(INSTALLBASE)/packages +%(TAB)@test -d $@ || mkdir $@ + +$(INSTALLBASE)/packages/$(MODULE)/dapasx:: $(INSTALLBASE)/packages/$(MODULE) +%(TAB)@test -d $@ || mkdir $@ + +$(INSTALLBASE)/packages/$(MODULE)/dapasx/interactiver_editor:: $(INSTALLBASE)/packages/$(MODULE)/dapasx +%(TAB)@test -d $@ || mkdir $@ + +$(INSTALLBASE)/packages/$(MODULE)/$(MODULE_DIR):: $(INSTALLBASE)/packages/$(MODULE) +%(TAB)@test -d $@ || mkdir $@ +" +' +# BEGINMAKEDEPEND --- do not remove this line; make depend needs it +%(DEPENDENCIES) +# ENDMAKEDEPEND --- do not remove this line + +' + + "Created: / 08-08-2006 / 20:45:36 / fm" + "Modified: / 09-08-2006 / 16:50:23 / fm" + "Modified: / 14-09-2006 / 15:48:02 / cg" + "Modified: / 24-06-2009 / 21:39:29 / Jan Vrany " +! ! + +!Method methodsFor:'accessing'! + +makeSourceFileAbsolute + + " + Makes a source file reference absolute. + This is required by SVN, because svn working copy + is in package path, so it's existence may corrupt source + files. + " + + | fileStream | + + "check whether my source is in external file. If not, this is noop" + sourcePosition ifNil:[^nil]. + "already absolute" + source asFilename isAbsolute ifTrue:[^self]. + fileStream := self rawSourceStream. + fileStream isFileStream ifTrue: + [source := fileStream fileName asAbsoluteFilename pathName]. + + " + (Method compiledMethodAt:#mclass:) + makeSourceFileAbsolute + " + + "Created: / 21-08-2009 / 17:24:08 / Jan Vrany " +! ! + +!MethodChange methodsFor:'queries'! + +isForGeneratedSubject + " + Answers true iff subject of this method is somewhat + auto-generated by some tool - just like version methods + are. + " + + ^self isForMeta and: [self selector = #version] + + "Created: / 17-08-2009 / 18:56:59 / Jan Vrany " +! ! + +!MethodChange methodsFor:'printing & storing'! + +printOn:aStream + "append a user printed representation of the receiver to aStream. + The format is suitable for a human - not meant to be read back." + + aStream + nextPutAll:(self className ? 'unnamed'); + nextPutAll:'>>'; + nextPutAll:(selector ? '?'); + nextPutAll:' {'; + nextPutAll:(methodCategory ? '?'); + nextPutAll:'}' + + "Modified: / 04-10-2006 / 16:46:01 / cg" + "Modified: / 07-11-2008 / 08:29:03 / Jan Vrany " +! ! + +!NewLauncher methodsFor:'change & update'! + +infoLineTemplate + "available values: + PACKAGE - the current packageID + PACKAGEOREMPTY - the current packageID or empty if its __NoPackage__ + IMAGE - the current snapshot image + CVS - the CVS source repository or empty + DB - the Store source repository DB or empty + SVN_WORKING_COPY- the SVN working copy dir or empty + NOREPOSITORY - the tring 'No Repository' empty + NS - the default namespace, or empty (if Smalltalk) + PROJECTDIR - the default fileOut directory or empty (if current) + " + + ^ '%(PACKAGEOREMPTY)%(IMAGE) %(CVS)%(DB)%(SVN_WORKING_COPY)' + "/ ^ '%(PACKAGEOREMPTY)%(IMAGE)%(CVS)%(DB)%(NOREPOSITORY)%(NS)' + "/ ^ '%(PACKAGE)%(IMAGE)%(CVS)%(DB)%(NOREPOSITORY)%(NS)%(PROJECTDIR)' + + "Modified: / 30-09-2008 / 12:45:49 / Jan Vrany " +! ! + +!NewLauncher methodsFor:'change & update'! + +updateInfo + "update the infoView from the current project" + + |project projectName projectDir packageName packageNameOrNil defNameSpace projectInfo + cvsRepository storeDB image bindings| + + (Project notNil and:[(project := Project current) notNil]) ifTrue:[ + projectName := project name. + projectDir := project directory. + packageName := packageNameOrNil := project package. + defNameSpace := project defaultNameSpace. + packageNameOrNil = Project noProjectID ifTrue:[ + packageNameOrNil := nil + ]. + ]. + defNameSpace isNil ifTrue:[ + defNameSpace := Smalltalk. + ]. + image := ((ObjectMemory imageName ? 'none') asFilename baseName). + + SourceCodeManager notNil ifTrue:[ + SourceCodeManager isCVS ifTrue:[ + cvsRepository := SourceCodeManager repositoryName. + (cvsRepository notNil and:[cvsRepository startsWith:':pserver:']) ifTrue:[ + cvsRepository := cvsRepository copyFrom:':pserver:'size+1. + ]. + ] ifFalse:[ + SourceCodeManager isStore ifTrue:[ + storeDB := SourceCodeManager hostAndDBName + ] + ] + ]. + + bindings := Dictionary new. + packageName isNil ifTrue:[ + bindings + at:'PACKAGE' + put:''. + ] ifFalse:[ + bindings + at:'PACKAGE' + put:((resources string:'Pkg') allBold,':' + ,(packageName asText colorizeAllWith:(Color blue darkened)),' '). + ]. + packageNameOrNil isNil ifTrue:[ + bindings + at:'PACKAGEOREMPTY' + put:''. + ] ifFalse:[ + bindings + at:'PACKAGEOREMPTY' + put:((resources string:'Pkg') allBold,':' + ,(packageNameOrNil asText colorizeAllWith:(Color blue darkened)),' '). + ]. + + bindings + at:'IMAGE' + put:((resources string:'Img') allBold,':' + ,(image asText colorizeAllWith:(Color blue darkened)),' '). + + cvsRepository isNil ifTrue:[ + bindings + at:'CVS' + put:'' + ] ifFalse:[ + bindings + at:'CVS' + put:((resources string:'CVS') allBold,':' + ,(cvsRepository asText colorizeAllWith:(Color blue darkened)),' '). + ]. + storeDB isNil ifTrue:[ + bindings + at:'DB' + put:''. + ] ifFalse:[ + bindings + at:'DB' + put:((resources string:'DB') allBold,':' + ,(storeDB asText colorizeAllWith:(Color blue darkened)),' '). + ]. + (cvsRepository isNil and:[storeDB isNil]) ifTrue:[ + bindings + at:'NOREPOSITORY' + put:' >','No Repository'allBold,'< '. + ] ifFalse:[ + bindings + at:'NOREPOSITORY' + put:''. + ]. + + bindings + at:'NS' + put:( defNameSpace == Smalltalk ifTrue:'' ifFalse:[ '"',defNameSpace name,'" '] ). + + bindings + at:'PROJECTDIR' + put:((resources string:'Dir') allBold,':' + , (projectDir contractTo: 30)),' '. + + SVN::RepositoryManager enabled + ifTrue: + [bindings + at: 'SVN_WORKING_COPY' + put: ('Working copy' allBold, ': ', + (SVN::RepositoryManager current workingCopyBase asFilename baseName asString colorizeAllWith:(Color blue darkened)))] + ifFalse: + [bindings + at: 'SVN_WORKING_COPY' + put: '']. + + + projectInfo := self infoLineTemplate bindWithArguments:bindings. + self infoLabelHolder value:projectInfo. + ^projectInfo. + + "Modified: / 30-09-2008 / 12:46:01 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'description - compilation'! + +additionalRulesSvn_make_dot_proto + + (self class includesSelector: #svnRevisionNr) ifFalse:[^'']. + + ^ String streamContents: + [:s|s + nextPutLine:'update-svn-revision:'; + tab; nextPutLine: 'sed -i -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"''$(shell svnversion -n)''\"\$$\"/g" \'; + tab; tab; nextPutLine: (self name , '.st'); + nextPutLine: '.PHONY: update-svn-revision'] + + "Created: / 24-06-2009 / 21:33:32 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'description - compilation'! + +additionalTargetsSvn_make_dot_proto + + (self class includesSelector: #svnRevisionNr) ifFalse:[^'']. + + ^ 'update-svn-revision' + + "Created: / 24-06-2009 / 21:35:15 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'private loading'! + +loadAllClassesAsAutoloaded:asAutoloaded + "load (fileIn) classes that should be present - + install as autoloaded classes marked to be autoloaded. + If asAutoloaded == true, all classes will be installed as autoloaded, even if not marked. + + Answer true, if classes have been loaded" + + |classNamesToLoad classNamesToAutoload hasClassesToLoad loadedClasses platformName + classesWhichFailedToLoad| + + platformName := OperatingSystem platformName. + classNamesToLoad := OrderedCollection new. + classNamesToAutoload := OrderedCollection new. + + self classNamesAndAttributesDo:[:eachClassname :eachAttributes | |eachClassnameSym isAutoload cls| + eachClassnameSym := eachClassname asSymbol. + isAutoload := asAutoloaded or:[eachAttributes includes:#autoload]. + + "no need to (re-)load an existing class, but install if should be loaded" + cls := Smalltalk loadedClassNamed:eachClassnameSym. + (cls isNil or:[cls isLoaded not and:[isAutoload not]]) ifTrue:[ + (eachAttributes isEmpty + or:[(eachAttributes size == 1 and:[isAutoload]) + or:[eachAttributes includes:platformName]]) ifTrue:[ + hasClassesToLoad := true. + isAutoload ifTrue:[ + classNamesToAutoload add:eachClassnameSym. + ] ifFalse:[ + classNamesToLoad add:eachClassnameSym. + ]. + ]. + ]. + ]. + + hasClassesToLoad ifTrue:[ + loadedClasses := OrderedCollection new. + + "we need the abbreviations, since sometimes there is no 1-to-1 mapping + of class name to file name" + + Smalltalk recursiveReadAllAbbreviationsFrom:self packageDirectory maxLevels:1. + + "install autoloaded classes first, + some others may depend on them" + + classNamesToAutoload withIndexDo:[:eachClassName :index| + ActivityNotification + raiseRequestWith: ((100 / classNamesToAutoload size ) * index) rounded + errorString: 'Autoloading class ', eachClassName. + + Smalltalk + installAutoloadedClassNamed:eachClassName + category:#autoloaded "FIXME" + package:self package + revision:nil + numClassInstVars:0. "FIXME" + ]. + + classesWhichFailedToLoad := OrderedCollection new. + classNamesToLoad withIndexDo:[:eachClassName :index| + |cls| + ActivityNotification + raiseRequestWith: ((100 / classNamesToLoad size) * index) rounded + errorString: 'Loading class ', eachClassName. + + Error handle:[:ex | + "maybe, fileIn failed, because the load order is wrong. + Work around this by installing the class as autoloaded and + loading it" + + classesWhichFailedToLoad add:eachClassName. + Smalltalk + installAutoloadedClassNamed:eachClassName + category:#autoloaded "FIXME" + package:self package + revision:nil + numClassInstVars:0. "FIXME" + ] do:[ + cls := Smalltalk + fileInClass:eachClassName + package:self package + initialize:false + lazy:false + silent:true. + cls notNil ifTrue:[ + loadedClasses add:cls + ]. + ]. + ]. + + classesWhichFailedToLoad do:[:eachClassName | + (Smalltalk at:eachClassName) autoload. + ]. + + loadedClasses do:[:eachLoadedClass | + "do not initialize, if initialize method is inherited" + (eachLoadedClass theMetaclass implements:#initialize) ifTrue:[ + eachLoadedClass initialize + ]. + ]. + ^ true. + ]. + ^ false. + + "Created: / 17-08-2006 / 01:01:14 / cg" + "Modified: / 26-10-2006 / 12:30:01 / cg" + "Modified: / 16-08-2009 / 13:31:40 / Jan Vrany " + "Modified: / 22-08-2009 / 12:00:54 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'loading'! + +loadAsAutoloaded:asAutoloaded + "load the project. + If asAutoloaded == true, install all new classes as autoloaded. + Answer true, if new classes have been installed for this package, + false if the package's classes have been already present." + + |newStuffHasBeenLoaded| + + self projectIsLoaded ifTrue:[^ false]. + thisContext isRecursive ifTrue:[^ false]. + + newStuffHasBeenLoaded := false. + + (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[ + "/ thisContext fullPrintAll. + Transcript show:'loading '. + asAutoloaded ifTrue:[ + Transcript show:'as autoloaded '. + ]. + Transcript showCR:self name. + ]. + + + self activityNotification:'Executing pre-load action'. + self preLoadAction. + Class withoutUpdatingChangesDo:[ + self activityNotification:'Loading prerequisities'. + self loadPreRequisitesAsAutoloaded:asAutoloaded. + asAutoloaded ifFalse:[ + self loadClassLibrary. + ]. + + self activityNotification:'Loading extensions'. + newStuffHasBeenLoaded := newStuffHasBeenLoaded | self loadExtensions. + self activityNotification:'Loading classes'. + newStuffHasBeenLoaded := newStuffHasBeenLoaded | (self loadAllClassesAsAutoloaded:asAutoloaded). + self activityNotification:'Loading sub projects'. + self loadSubProjectsAsAutoloaded:asAutoloaded. + ]. + self activityNotification:'Executing post-load action'. + self postLoadAction. + self projectIsLoaded:true. + + ^ newStuffHasBeenLoaded + + "Created: / 17-08-2006 / 01:01:41 / cg" + "Modified: / 21-11-2006 / 15:07:09 / cg" + "Modified: / 30-10-2008 / 08:16:21 / Jan Vrany " + "Modified: / 22-08-2009 / 12:02:14 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'mappings'! + +make_dot_proto_mappings + ^ Dictionary new + at: 'TAB' put: ( Character tab asString ); + at: 'TOP' put: ( self pathToTop_unix ); + at: 'LIBRARY_NAME' put: ( self libraryName ); + at: 'SUBDIRECTORIES' put: (self generateSubDirectories); + at: 'LOCAL_INCLUDES' put: (self generateLocalIncludes_unix); + at: 'LOCAL_DEFINES' put: self localDefines_unix; + at: 'GLOBAL_DEFINES' put: self globalDefines_unix; + at: 'COMMONSYMFLAG' put: (self commonSymbolsFlag); + at: 'HEADEROUTPUTARG' put: (self headerFileOutputArg); + at: 'PRIMARY_TARGET' put: (self primaryTarget_make_dot_proto); + at: 'ADDITIONAL_DEFINITIONS' put: (self additionalDefinitions_make_dot_proto); + at: 'ADDITIONAL_RULES' put: (self additionalRules_make_dot_proto); + at: 'ADDITIONAL_RULES_SVN' put: (self additionalRulesSvn_make_dot_proto); + at: 'ADDITIONAL_TARGETS' put: (self additionalTargets_make_dot_proto); + at: 'ADDITIONAL_TARGETS_SVN' put: (self additionalTargetsSvn_make_dot_proto); + at: 'ADDITIONAL_LINK_LIBRARIES' put: (self additionalLinkLibraries_make_dot_proto); + at: 'ADDITIONAL_SHARED_LINK_LIBRARIES' put: (self additionalSharedLinkLibraries_make_dot_proto); + at: 'DEPENDENCIES' put: (self generateDependencies_unix); + at: 'MODULE' put: ( self module ); + at: 'MODULE_DIRECTORY' put: ( self moduleDirectory ); + at: 'MODULE_PATH' put: ( self moduleDirectory ); + at: 'MAKE_PREREQUISITES' put: (self generateRequiredMakePrerequisites_make_dot_proto); + yourself + + "Created: / 09-08-2006 / 11:20:45 / fm" + "Modified: / 09-08-2006 / 16:44:48 / fm" + "Modified: / 14-09-2006 / 18:57:52 / cg" + "Modified: / 24-06-2009 / 21:50:13 / Jan Vrany " + "Modified: / 22-08-2009 / 12:03:25 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'accessing'! + +packageDirectory + + ^Smalltalk packageDirectoryForPackageId: self package + + "Created: / 15-06-2009 / 12:01:18 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'accessing - svn'! + +svnRevision + + " + Answers SVN revision of given package. The revision is computed + as follows: + 1) Look at package directory if there is .svn administration + directory. If so, uses SVN to obtain SVN revision & return + 2) If svnRevisionNr return non-nil, use that as SVN revision & return + 3) If everything fails, compute maximum from all revision of all + classes & extensions + " + | pkgDir revNr | + + "1)" + pkgDir := self packageDirectory. + (pkgDir notNil and: [pkgDir exists and: [(pkgDir / '.svn') exists]]) ifTrue: + [[revNr := (SVN::InfoCommand new + workingCopy: (SVN::WorkingCopy branch: (SVN::Branch new) path: pkgDir); + execute) anyOne revision] + value + "/on: Error do: [revNr := nil] + ]. + revNr ifNotNil:[^SVN::Revision number:revNr]. + "2)" + "We have to explicitly check for existence of svnRevisionNr, + because we don't want to invoke inherited method" + (self class methodDictionary includesKey: #svnRevisionNr) + ifTrue:[revNr := self perform:#svnRevisionNr]. + revNr ifNotNil:[^SVN::Revision number:(revNr asString select:[:e|e isDigit])]. + + "3)" + revNr := (self searchForClassesWithProject: self package) + inject: 0 + into: + [:rev :cls| + rev max: (cls revision ? '0') asNumber]. + ^revNr ~= 0 + ifTrue: [SVN::Revision number:revNr] + ifFalse:[SVN::Revision head] + + " + stx_libbasic svnRevision + stx_goodies_libsvn svnRevision + stx_goodies_libsvn revision + + " + + "Created: / 15-06-2009 / 11:54:33 / Jan Vrany " + "Modified: / 22-08-2009 / 09:06:29 / Jan Vrany " +! ! + +!ProjectDefinition class methodsFor:'code generation'! + +svnRevisionNr_code: revisionNrOrNil + ^ String streamContents:[:s | + s nextPutLine:'svnRevisionNr'. + s nextPutLine:' "Return a SVN revision number of myself.'. + s nextPutLine:' This number is updated after a commit"'. + s cr; + nextPutLine:' ^ "$SVN-Revision:"''', revisionNrOrNil printString , '''"$"'. + ]. + + " + self svnRevisionNr_code + stx_libbasic3 svnRevisionNr_code + " + + "Created: / 16-06-2009 / 12:12:37 / Jan Vrany " + "Modified: / 22-08-2009 / 09:05:05 / Jan Vrany " +! ! + +!Smalltalk class methodsFor:'system management-files'! + +fileNameForClass:aClassOrClassName + "return a actual or expected (or most wanted) filename for aClassOrClassName." + + |cls nonMetaclass nm nm1 nm2 compatQuery| + + + compatQuery := Smalltalk classNamed: 'SVN::CompatModeQuery'. + (compatQuery notNil and: + [compatQuery isLoaded and:[compatQuery query not]]) + ifTrue: + [nm := aClassOrClassName isBehavior + ifTrue:[aClassOrClassName name] + ifFalse:[aClassOrClassName]. + nm := nm copyReplaceAll:$: with:$_. + ^nm]. + + aClassOrClassName isBehavior ifTrue:[ + nonMetaclass := aClassOrClassName theNonMetaclass. + nm := nonMetaclass getClassFilename. + nm notNil ifTrue:[^ nm asFilename withoutSuffix baseName]. + nm1 := nonMetaclass name. + nm2 := nonMetaclass nameWithoutPrefix. + ] ifFalse:[ + cls := Smalltalk classNamed:aClassOrClassName. + cls notNil ifTrue:[ + nonMetaclass := cls theNonMetaclass. + nm := nonMetaclass getClassFilename. + nm notNil ifTrue:[^ nm asFilename withoutSuffix baseName]. + nm1 := nonMetaclass name. + nm2 := nonMetaclass nameWithoutPrefix. + ] ifFalse:[ + nm1 := aClassOrClassName. + nm2 := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1). + ]. + ]. + nm1 := nm1 asSymbol. + nm2 := nm2 asSymbol. + + CachedAbbreviations notNil ifTrue:[ + (CachedAbbreviations includesKey:nm1) ifTrue:[ + ^ (CachedAbbreviations at:nm1) asFilename baseName + ]. + (CachedAbbreviations includesKey:nm2) ifTrue:[ + ^ (CachedAbbreviations at:nm2) asFilename baseName + ]. + ]. + ^ nm1 copyReplaceAll:$: with:$_ + + " + Smalltalk fileNameForClass:#Complex + Smalltalk fileNameForClass:'SmallInteger' + Smalltalk fileNameForClass:'UnixOperatingSystem' + Smalltalk fileNameForClass:'Launcher' + Smalltalk fileNameForClass:'SomeUnknownClass' + Smalltalk fileNameForClass:OSI::FTAMOperation + Smalltalk fileNameForClass:'OSI::Foobar' + Smalltalk fileNameForClass:(Workflow::UnsuccessfulFinishReasons) + Workflow::UnsuccessfulFinishReasons classFilename + " + + "Modified: / 06-10-2006 / 16:16:01 / cg" + "Modified: / 15-07-2009 / 20:18:17 / Jan Vrany " + "Modified: / 22-08-2009 / 11:57:28 / Jan Vrany " +! ! + +!Smalltalk class methodsFor:'system management-packages'! + +loadPackageWithId:aPackageId asAutoloaded:doLoadAsAutoloaded + "make certain, that some particular package is loaded into the system. + Experimental." + + |packageDir| + + packageDir := self packageDirectoryForPackageId:aPackageId. + packageDir isNil ifTrue:[ + (aPackageId includes:$:) ifFalse:[ + "/ assume stx + packageDir := self packageDirectoryForPackageId:('stx:',aPackageId). + ]. + ]. + (packageDir isNil and: [SVN::RepositoryManager notNil]) ifTrue: + [^self loadPackageWithId: aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded]. + + ^ self + loadPackageWithId:aPackageId + fromDirectory:packageDir + asAutoloaded:doLoadAsAutoloaded. + + " + Smalltalk loadPackageWithId:'stx:libbasic' + Smalltalk loadPackageWithId:'stx:goodies/persistency' + Smalltalk loadPackageWithId:'exept:ctypes' + " + + "Modified: / 07-12-2006 / 15:04:39 / cg" + "Modified: / 28-10-2008 / 15:56:15 / Jan Vrany " + "Modified: / 22-08-2009 / 11:58:43 / Jan Vrany " +! ! + +!Smalltalk class methodsFor:'system management-packages'! + +loadPackageWithId:aPackageId fromRepositoryAsAutoloaded:doLoadAsAutoloaded + + self + loadPackageWithId:aPackageId + fromRepositoryAsAutoloaded:doLoadAsAutoloaded + usingRepositoryManager: SVN::RepositoryManager current + + "Created: / 28-10-2008 / 15:53:37 / Jan Vrany " + "Modified: / 09-04-2009 / 17:20:43 / Jan Vrany " +! ! + +!Smalltalk class methodsFor:'system management-packages'! + +loadPackageWithId:aPackageId fromRepositoryAsAutoloaded:doLoadAsAutoloaded usingRepositoryManager: manager + + | retval loadBlock | + loadBlock := + [| repo packageDir | + repo := manager repositoryForPackage: aPackageId. + retval := (repo notNil and:[repo exists]) + ifTrue: + [repo workingCopy checkout. + packageDir := self packageDirectoryForPackageId:aPackageId. + self + loadPackageWithId:aPackageId + fromDirectory:packageDir + asAutoloaded:doLoadAsAutoloaded] + ifFalse: + [false]]. + + (Query query == true) + ifTrue: + [loadBlock value] + ifFalse: + [Query answer: true do: + [SVN::ProgressDialog + openOn: loadBlock + title: ' Loading...' + subtitle: aPackageId asText allItalic]]. + ^retval + + "Created: / 09-04-2009 / 17:20:01 / Jan Vrany " +! ! + +!TimestampChange methodsFor:'applying'! + +apply + "apply the change" + + "Nothing to do" + + "Created: / 06-11-2008 / 08:57:44 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'! + +classMenuSubversionCommit + + | classesPerPackage | + classesPerPackage := Dictionary new. + self selectedClasses value do: + [:class| + (classesPerPackage at: class theNonMetaclass package ifAbsentPut:[Set new]) + add: class theNonMetaclass]. + classesPerPackage keysAndValuesDo: + [:package :classes| | repo | + repo := SVN::RepositoryManager repositoryForPackage:package. + SVN::CommitWizard new + task: (repo workingCopy commitTask + classes: classes; + extensionMethods: #() + yourself); + open] + + "Modified: / 16-06-2009 / 21:05:21 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'! + +classMenuSubversionCompareImageWithRevision + + | cls branch revisionLog revision | + cls := self theSingleSelectedClass theNonMetaclass. + branch := cls theNonMetaclass svnRepository branch. + revisionLog := branch log: cls. + revision := SVN::RevisionSelectionDialog openOn: revisionLog. + self classMenuSubversionCompareImageWithRevision: revision + + "Created: / 19-04-2008 / 18:38:15 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'! + +classMenuSubversionCompareImageWithRevision: revision + + | cls branch diffSet | + revision ifNil:[^self]. + cls := self theSingleSelectedClass theNonMetaclass. + branch := cls theNonMetaclass svnRepository branch. + SVN::ProgressDialog + openOn:[diffSet := branch diffSetForClass: cls betweenImageAndRevision: revision] + title: 'Creating diffset for class ', cls fullName asText allItalic + subtitle: + ('Package: ' , branch package asText allItalic , + ' Revision ' , revision asString). + Tools::SmalltalkDiffTool + openOnDiffSet:diffSet + labelA: 'Image' + labelB: 'r',revision printString + title: 'Differences of ',cls fullName,' between image and revision ',revision printString. + + "Created: / 19-04-2008 / 18:54:52 / Jan Vrany " + "Modified: / 09-08-2009 / 14:14:37 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'! + +classMenuSubversionCompareImageWithRevisionHead + + self classMenuSubversionCompareImageWithRevision: SVN::Revision head + + "Created: / 19-04-2008 / 18:56:08 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'! + +classMenuSubversionUpdate + "automatically generated by UIEditor ..." + + "*** the code below performs no action" + "*** (except for some feedback on the Transcript)" + "*** Please change as required and accept in the browser." + "*** (and replace this comment by something more useful ;-)" + + "action to be added ..." + + Transcript showCR:self class name, ': action for #classMenuSubversionUpdate ...'. +! ! + +!Tools::NewSystemBrowser methodsFor:'menus-dynamic'! + +projectMenuSubversionBranches + + + + | menu repository | + menu := Menu new. + repository := self selectedProjectSubversionRepository. + repository branches do: + [:branch| + menu addItem: + (MenuItem new + label: branch name; + choiceValue: branch; + choice:(repository workingCopy branch); + enabled:(repository workingCopy branch) = branch; + yourself) + ]. + + ^menu + + "Created: / 19-04-2008 / 11:06:15 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionBrowseWorkingCopy + + self selectedProjects value do: + [:package| + | pkg repo | + pkg := self theSingleSelectedProject. + repo := (SVN::RepositoryManager repositoryForPackage: pkg) . + FileBrowserV2 openOn: repo workingCopy path] + + "Created: / 09-04-2009 / 13:19:43 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCommit + + self selectedProjects value do: + [:package| + | repo | + repo := SVN::RepositoryManager repositoryForPackage:package. + SVN::CommitWizard new + task: repo workingCopy commitTask; + open] + + "Created: / 01-04-2008 / 19:02:42 / janfrog" + "Modified: / 16-08-2009 / 19:17:15 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCommitMode + + ^(PluggableAdaptor on: self theSingleSelectedProject) + getBlock: + [:prjHolder| | wc | + wc := SVN::RepositoryManager workingCopyForPackage: self theSingleSelectedProject value. + wc ifNotNil:[wc commitMode] ifNil:[nil]] + putBlock: + [:prjHolder :value| | wc | + wc := SVN::RepositoryManager workingCopyForPackage: self theSingleSelectedProject value. + wc ifNotNil:[wc commitMode:value]] + updateBlock: + [:prjHolder :aspect :value|true]. + + "Created: / 13-08-2009 / 15:05:45 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCompareExtensionsInImageWithRevision + + | pkg branch revisionLog revision | + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + revisionLog := branch log:(branch repository containerNameForExtensions). + revision := SVN::RevisionSelectionDialog openOn: revisionLog. + self projectMenuSubversionCompareExtensionsInImageWithRevision: revision + + "Created: / 19-04-2008 / 19:13:55 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCompareExtensionsInImageWithRevision: revision + + | pkg diffSet branch| + revision ifNil:[^self]. + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + SVN::ProgressDialog + openOn:[diffSet := branch diffSetForExtensionsBetweenImageAndRevision: revision.] + title: 'Creating diffset for extensions' + subtitle: + ('Package: ' , branch package asText allItalic , + ' Revision ' , revision asString). + Tools::SmalltalkDiffTool + openOnDiffSet:diffSet + labelA: 'Image' + labelB: 'r',revision printString + title: 'Differences of extensions for ',pkg,' between image and revision ',revision printString. + + "Created: / 19-04-2008 / 19:13:55 / Jan Vrany " + "Modified: / 09-08-2009 / 14:14:15 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCompareImageWithRevision + + | pkg branch revisionLog revision | + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + revisionLog := branch log:'.'. + revision := SVN::RevisionSelectionDialog openOn: revisionLog. + self projectMenuSubversionCompareImageWithRevision: revision + + "Created: / 20-05-2008 / 18:09:20 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCompareImageWithRevision: revision + + | pkg diffSet branch| + revision ifNil:[^self]. + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + SVN::ProgressDialog + openOn:[diffSet := branch diffSetBetweenImageAndRevision: revision] + title: 'Creating diffset' + subtitle: + ('Package: ' , branch package asText allItalic , + ' Revision ' , revision asString). + + Tools::SmalltalkDiffTool + openOnDiffSet:diffSet + labelA: 'Image' + labelB: 'r',revision printString + title: 'Differences for ',pkg,' between image and revision ',revision printString. + + "Created: / 20-05-2008 / 18:09:52 / Jan Vrany " + "Modified: / 09-08-2009 / 14:14:10 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionCompareImageWithRevisionHEAD + + self projectMenuSubversionCompareImageWithRevision: SVN::Revision head + + "Created: / 20-05-2008 / 18:10:16 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionLoadRevision + + ^self projectMenuSubversionLoadRevision: nil + + "Created: / 22-10-2008 / 11:49:35 / Jan Vrany " + "Modified: / 09-04-2009 / 09:38:17 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionLoadRevision: aRevision + + self selectedProjects value do: + [:package| + | pkg task | + pkg := self theSingleSelectedProject. + task := (SVN::RepositoryManager repositoryForPackage: pkg) updateTask. + task revision: aRevision. + SVN::UpdateWizard openOn: task] + + "Created: / 09-04-2009 / 09:38:55 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionMergeImageWithRevision + + | pkg branch revisionLog revision | + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + revisionLog := branch log:'.'. + revision := SVN::RevisionSelectionDialog openOn: revisionLog. + self projectMenuSubversionMergeImageWithRevision: revision + + "Created: / 20-05-2008 / 23:41:26 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionMergeImageWithRevision: revision + + | pkg diffSet branch| + revision ifNil:[^self]. + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + SVN::ProgressDialog + openOn:[diffSet := branch diffSetBetweenImageAndRevision: revision] + title: 'Creating diffset' + subtitle: + ('Package: ' , branch package asText allItalic , + ' Revision ' , revision asString). + + Tools::SmalltalkMergeTool + openOnDiffSet:diffSet + labelA: 'Image' + labelB: 'r',revision printString + title: 'Merge ',pkg,' revision ',revision printString, ' into image' + + "Created: / 20-05-2008 / 23:44:22 / Jan Vrany " + "Modified: / 09-08-2009 / 14:15:28 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionMergeImageWithRevisionHEAD + + self projectMenuSubversionMergeImageWithRevision: SVN::Revision head + + "Created: / 20-05-2008 / 23:44:46 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionRemoveWorkingCopy + + self selectedProjects value do: + [:package| + | pkg repo | + pkg := self theSingleSelectedProject. + repo := (SVN::RepositoryManager repositoryForPackage: pkg) . + repo workingCopy path asFilename recursiveRemove] + + "Created: / 09-04-2009 / 13:19:08 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionShowRevisionLog + + | pkg branch revisionLog revision | + pkg := self theSingleSelectedProject. + branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch. + revisionLog := branch log:'.'. + revision := SVN::RevisionLogBrowser openOn: revisionLog. + + "Created: / 21-05-2008 / 09:37:51 / Jan Vrany " + "Modified: / 21-10-2008 / 19:52:16 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'! + +projectMenuSubversionUpdate + + ^self projectMenuSubversionLoadRevision: SVN::Revision head + + "Created: / 22-10-2008 / 11:49:35 / Jan Vrany " + "Modified: / 09-04-2009 / 09:38:34 / Jan Vrany " +! ! + +!Tools::NewSystemBrowser methodsFor:'private-helpers'! + +selectedProjectSubversionRepository + + self selectedProjects value size ~= 1 ifTrue:[^nil]. + ^SVN::RepositoryManager repositoryForPackage: self selectedProjects value anyOne. + + "Created: / 19-04-2008 / 11:09:02 / Jan Vrany " +! ! + +!URL methodsFor:'queries'! + +isValidSvnRepositoryUrl + + ^#('file' 'http' 'https' 'svn' 'svn+ssh') + includes: self method + + "Created: / 16-08-2009 / 16:39:38 / Jan Vrany " +! ! + +!URL methodsFor:'printing & storing'! + +printOn: aStream + method notNil ifTrue: [ + aStream nextPutAll: method; nextPut: $: + ]. + aStream nextPutAll: '//'. + host notNil ifTrue: [ + aStream nextPutAll: host + ]. + port notNil ifTrue: [ + aStream nextPut: $:; nextPutAll: port printString + ]. + path notNil ifTrue: [ + aStream nextPutAll: path + ]. + (otherPart notNil and: [self hasPostData not]) ifTrue:[ + self hasFragmentPart ifTrue: [ + aStream nextPut: $# + ] ifFalse:[ + aStream nextPut: $? + ]. + aStream nextPutAll: otherPart + ]. + + "Modified: / 19-08-2009 / 13:14:21 / Jan Vrany " +! ! + +!UserPreferences methodsFor:'accessing - subversion'! + +svnConfigurations + + ^(self at:#'libsvn.configurations' ifAbsent:#()) + collect:[:cfg|cfg decodeAsLiteralArray] + + "Created: / 03-10-2008 / 11:14:14 / Jan Vrany " + "Modified: / 19-08-2009 / 12:08:44 / Jan Vrany " +! ! + +!UserPreferences methodsFor:'accessing - subversion'! + +svnConfigurations: aCollection + + " + UserPreferences current svnConfigurations: #() + " + + SVN::RepositoryManager allInstances do: + [:e|e configurations: aCollection]. + + ^self + at: #'libsvn.configurations' + put: (aCollection asArray collect:[:cfg|cfg literalArrayEncoding]) + + "Created: / 03-10-2008 / 11:14:01 / Jan Vrany " + "Modified: / 19-08-2009 / 12:09:22 / Jan Vrany " +! ! + +!UserPreferences methodsFor:'accessing - subversion'! + +svnEnabled + + ^self at:#svnEnabled ifAbsent:[true] + + "Created: / 03-10-2008 / 11:11:39 / Jan Vrany " +! ! + +!UserPreferences methodsFor:'accessing - subversion'! + +svnEnabled: aBoolean + + ^self at:#svnEnabled put: aBoolean + + "Created: / 03-10-2008 / 11:13:14 / Jan Vrany " +! ! + +!UserPreferences methodsFor:'accessing - subversion'! + +svnVerbose + + ^self at:#svnVerbose ifAbsent: false + + "Created: / 19-03-2009 / 14:00:05 / Jan Vrany " +! ! + +!UserPreferences methodsFor:'accessing - subversion'! + +svnVerbose: aBoolean + + ^self at:#svnVerbose put: aBoolean + + "Created: / 19-03-2009 / 13:59:46 / Jan Vrany " +! ! + +!XML::NodeSet methodsFor:'navigation'! + +@ attributeName + "XPath like processing - if singleton set, answer an value of + atribute named attributeName, error otherwise. + This method is used in libsvn" + + self size = 1 ifTrue:[^self first @ attributeName]. + self error:'More than one element in node set' +! ! +