--- a/SVNSourceCodeManager.st Tue Aug 09 03:35:30 2016 +0000
+++ b/SVNSourceCodeManager.st Fri Nov 18 16:14:26 2016 +0100
@@ -25,6 +25,8 @@
"
"{ Package: 'stx:libsvn' }"
+"{ NameSpace: Smalltalk }"
+
AbstractSourceCodeManager subclass:#SVNSourceCodeManager
instanceVariableNames:''
classVariableNames:'LoadInProgressQuery'
@@ -32,6 +34,13 @@
category:'System-SourceCodeManagement'
!
+VersionInfo subclass:#SVNVersionInfo
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:SVNSourceCodeManager
+!
+
SourceCodeManagerUtilities subclass:#Utilities
instanceVariableNames:''
classVariableNames:''
@@ -698,6 +707,147 @@
^ true
! !
+!SVNSourceCodeManager::SVNVersionInfo class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2011 by eXept Software AG
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
+!
+
+documentation
+"
+ In ancient times, Class used to return a Dictionary when asked for versionInfo.
+ This has been replaced by instances of VersionInfo and subclasses.
+
+ SVNVersionInfo adds some SVN specific data.
+
+ [author:]
+ cg (cg@AQUA-DUO)
+"
+!
+
+version
+ ^ '$Header$'
+!
+
+version_CVS
+ ^ '$Header$'
+!
+
+version_SVN
+ ^ '$Id$'
+! !
+
+!SVNSourceCodeManager::SVNVersionInfo class methodsFor:'instance creation'!
+
+fromSVNString:aString
+ "{ Pragma: +optSpace }"
+
+ "I know how to parse SVN version id strings.
+ Return an instance filled with revision info which is
+ extracted from aString. This must be in SVN format.
+ Return nil for non-SVN strings"
+
+ |words firstWord info s fn revString user |
+
+ s := aString readStream.
+ s skipSeparators.
+ firstWord := s through:$:.
+
+ info := self new.
+
+ "/
+ "/ supported formats:
+ "/
+ "/ $ Id: baseFileName rev-int date time user $
+ "/
+ ((firstWord = '$Id:')
+ or:[ (firstWord = '$ Id:')
+ or:[ (firstWord = '§Id:')
+ or:[ (firstWord = '§ Id:')]]]
+ ) ifTrue:[
+ "/Skip next : it might be SVN's fixed-width keyword"
+ s peek == $: ifTrue:[s next].
+
+ words := s upToEnd asCollectionOfWords readStream.
+ (words peek = '$') ifTrue:[
+ "/ empty fixed-width version method - '$Id$'
+ ^nil
+ ].
+ info fileName:(fn := words next).
+ (fn endsWith:',v') ifTrue:[
+ "/ not an SVN version
+ ^ nil
+ ].
+ info revision:(revString := words next).
+ "/ do not use matchesRegex: here (regex is an optional package)
+ (revString conform:[:c | c isDigit]) ifFalse:[
+ "/ not an SVN version
+ ^ nil
+ ].
+ info date:(words next).
+ info time:(words next).
+ user := words next.
+ (user includesAny:'$§') ifTrue:[
+ info user: (user copyTo: (user indexOfAny:'$§') - 1)
+ ] ifFalse:[
+ info user: user.
+ ( '$§' includes:words next first) ifFalse:[
+ "/ not an SVN version
+ ^ nil
+ ]
+ ].
+ words atEnd ifFalse:[
+ ^ nil
+ ].
+ ^ info
+ ].
+
+ ^ nil
+
+ "
+ SVNVersionInfo fromSVNString:('$' , 'Revision: 1.122 $')
+ SVNVersionInfo fromSVNString:(SourceCodeManager version)
+ SVNVersionInfo fromSVNString:(ApplicationDefinition version_SVN)
+ SVNVersionInfo fromSVNString:(ApplicationDefinition version_CVS)
+ CVSVersionInfo fromRCSString:(ApplicationDefinition version_SVN)
+ CVSVersionInfo fromRCSString:(ApplicationDefinition version_CVS)
+ "
+
+ "Created: / 29-09-2011 / 17:14:56 / cg"
+ "Modified: / 31-03-2012 / 01:12:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SVNSourceCodeManager::SVNVersionInfo methodsFor:'accessing'!
+
+keysAndValuesDo:aBlock
+
+ super keysAndValuesDo:aBlock.
+ "JV@2011-11-25: Fake repositoryPathName, as other tools
+ requires this. Returning nil should be fine, but then,
+ SourceCodeManagerUtilities constructs names as they are
+ in CVS, sigh"
+ aBlock value: #repositoryPathName value: self repositoryPathName
+
+ "Created: / 25-11-2011 / 18:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+repositoryPathName
+
+ ^fileName
+
+ "Created: / 25-11-2011 / 18:57:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
!SVNSourceCodeManager::Utilities methodsFor:'utilities-cvs'!
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass usingManager:aManagerOrNil