StoreSourceCodeManager.st
author vrany
Tue, 27 Sep 2011 18:05:13 +0200
changeset 2526 885e44dc1e4a
parent 2381 e0f4fbc2bf59
child 2553 4c63ae4885b9
permissions -rw-r--r--
When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 eXept Software AG
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
AbstractSourceCodeManager subclass:#StoreSourceCodeManager
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    16
	classVariableNames:'Verbose Connection DefaultDBInfo DBInfoPerModule'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-SourceCodeManagement'
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    21
Object subclass:#DBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    22
	instanceVariableNames:'hostName dbName userName password'
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    23
	classVariableNames:''
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    24
	poolDictionaries:''
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    25
	privateIn:StoreSourceCodeManager
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    26
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    27
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!StoreSourceCodeManager class methodsFor:'documentation'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
copyright
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 COPYRIGHT (c) 2006 eXept Software AG
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
              All Rights Reserved
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    WARNING:
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        this class is incomplete and provided as a sceletton
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        if CVS is not to be used as a SourceCodeManager.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        We highly recommend to use CVS.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    SourceCodeManager which accesses sourcecode through a Store Database.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    This class is part of ongoing development and not yet released for public use.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    56
!StoreSourceCodeManager class methodsFor:'initialization'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    57
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    58
connectToDatabase
1734
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    59
    |session dbInfo|
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    60
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    61
    dbInfo := self defaultDBInfo.
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    62
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    63
    SQL::SQLError handle:[:ex |
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    64
        self warn:('Failed to connect to Database:\\' withCRs,ex description).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    65
        ^ self.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    66
    ] do:[
1734
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    67
        session := self tryToConnectToDatabase:dbInfo.
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    68
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    69
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    70
    session isNil ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    71
        self warn:'OOPS - Failed to connect to Database'.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    72
        ^ self
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    73
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    74
    Connection := session.
1734
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    75
    Transcript showCR:('Connected to Store-DB: ',dbInfo hostAndDBName).
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    76
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    77
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    78
tryToConnectToDatabase:dbInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    79
    |session|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    80
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    81
    session := SQL::ODBCSession new.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    82
    session 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    83
        connectWithUsername:(dbInfo userName) 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    84
        password:(dbInfo password) 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    85
        dbname:(dbInfo dbName).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    86
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    87
    (session isConnected) ifFalse:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    88
        ^ nil.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    89
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    90
    ^ session
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    91
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    92
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
!StoreSourceCodeManager class methodsFor:'accessing'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    95
dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    96
    ^ self defaultDBInfo dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    97
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    98
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    99
dbName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   100
    self defaultDBInfo dbName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   101
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   102
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   103
defaultDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   104
    DefaultDBInfo isNil ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   105
        DefaultDBInfo := DBInfo new
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   106
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   107
    ^ DefaultDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   108
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   109
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   110
hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   111
    ^ self defaultDBInfo hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   112
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   113
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   114
hostAndDBName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   115
    self defaultDBInfo hostAndDBName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   116
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   117
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   118
hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   119
    ^ self defaultDBInfo hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   120
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   121
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   122
hostName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   123
    self defaultDBInfo hostName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   124
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   125
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   126
newDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   127
    ^ DBInfo new
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   128
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   129
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   130
password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   131
    ^ self defaultDBInfo password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   132
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   133
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   134
password:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   135
    self defaultDBInfo password:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   136
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   137
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   138
repositoryInfoPerModule
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   139
    ^ DBInfoPerModule ? #()
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   140
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   141
    "Created: / 16-08-2006 / 11:06:09 / cg"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   142
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   143
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   144
repositoryInfoPerModule:aCollectionOfDBinfos
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   145
    DBInfoPerModule := aCollectionOfDBinfos
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   146
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   147
    "Created: / 16-08-2006 / 11:06:09 / cg"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   148
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   149
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   150
userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   151
    ^ self defaultDBInfo userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   152
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   153
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   154
userName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   155
    self defaultDBInfo userName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   156
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   157
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   158
!StoreSourceCodeManager class methodsFor:'queries'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   159
2198
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   160
isExperimental
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   161
    ^ OperatingSystem getLoginName ~= 'cg'.
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   162
    ^ true
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   163
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   164
    "Created: / 16-08-2006 / 11:23:09 / cg"
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   165
!
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   166
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
managerTypeName
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    ^ 'Store DB'
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    "Created: / 16-08-2006 / 11:06:09 / cg"
2139
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   171
!
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   172
2198
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   173
nameOfVersionMethodForExtensions
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   174
    ^ #'extensionsVersion_STORE'
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   175
!
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   176
2139
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   177
nameOfVersionMethodInClasses
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   178
    ^ #'version_STORE'
2346
a207c0ff7a16 added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
   179
!
a207c0ff7a16 added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
   180
a207c0ff7a16 added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
   181
settingsApplicationClass
2352
28840a6d762f added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2346
diff changeset
   182
    "link to my settings application (needed for the settings dialog"
28840a6d762f added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2346
diff changeset
   183
2346
a207c0ff7a16 added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
   184
    ^ StoreSourceCodeManagementSettingsAppl
a207c0ff7a16 added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
   185
a207c0ff7a16 added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2328
diff changeset
   186
    "Created: / 19-04-2011 / 12:44:26 / cg"
2352
28840a6d762f added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2346
diff changeset
   187
    "Modified: / 19-04-2011 / 13:52:34 / cg"
2526
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   188
!
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   189
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   190
versionMethodKeyword
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   191
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   192
    "Answers the keyword used by the version management system to
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   193
     expand a current version in a file (_without_ dollars). For
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   194
     CVS it is 'Header', for SVN 'Id', others may use different
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   195
     keywords. If nil is returned, then the version management does
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   196
     not use any keyword."
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   197
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   198
    ^nil
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   199
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   200
    "Created: / 27-09-2011 / 16:47:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   203
!StoreSourceCodeManager class methodsFor:'saving'!
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   204
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   205
savePreferencesOn:aStream
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   206
    aStream nextPutLine:'  StoreSourceCodeManager notNil ifTrue:['.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   207
    aStream nextPutLine:'    StoreSourceCodeManager repositoryInfoPerModule:' , self repositoryInfoPerModule storeString , '.'.
2328
4620ff63e9b2 comment/format in: #savePreferencesOn:
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   208
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   209
    (Smalltalk at:#SourceCodeManager) == StoreSourceCodeManager ifTrue:[
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   210
        aStream nextPutLine:'    Smalltalk at:#SourceCodeManager put: StoreSourceCodeManager.'.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   211
        aStream nextPutLine:'    StoreSourceCodeManager hostAndDBName:' , self hostAndDBName storeString , '.'.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   212
        aStream nextPutLine:'    StoreSourceCodeManager dbName:' , self dbName storeString , '.'.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   213
        aStream nextPutLine:'    StoreSourceCodeManager userName:' , self userName storeString , '.'.
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   214
    ].
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   215
    aStream nextPutLine:'  ].'.
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   216
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   217
    "Created: / 09-11-2006 / 15:10:25 / cg"
2328
4620ff63e9b2 comment/format in: #savePreferencesOn:
Claus Gittinger <cg@exept.de>
parents: 2309
diff changeset
   218
    "Modified: / 18-04-2011 / 17:15:12 / cg"
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   219
! !
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   220
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
!StoreSourceCodeManager class methodsFor:'testing'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
isStore
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    ^ true
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    "Created: / 16-08-2006 / 10:59:06 / cg"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   229
!StoreSourceCodeManager::DBInfo methodsFor:'accessing'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   230
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   231
dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   232
    ^ dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   233
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   234
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   235
dbName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   236
    dbName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   237
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   238
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   239
hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   240
    hostName isEmptyOrNil ifTrue:[ ^ dbName ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   241
    ^ dbName,'@',hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   242
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   243
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   244
hostAndDBName: aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   245
    |idx|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   246
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   247
    idx := aString indexOf:$@.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   248
    idx == 0 ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   249
        dbName := aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   250
        hostName := nil.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   251
    ] ifFalse:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   252
        dbName := aString copyTo:idx-1.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   253
        hostName := (aString copyFrom:idx+1).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   254
    ]
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   255
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   256
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   257
hostAndDBName:hostAndDBNameArg userName:userNameArg password:passwordArg 
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   258
    self hostAndDBName:hostAndDBNameArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   259
    userName := userNameArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   260
    password := passwordArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   261
!
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   262
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   263
hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   264
    ^ hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   265
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   266
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   267
hostName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   268
    hostName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   269
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   270
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   271
hostName:hostNameArg dbName:dbNameArg userName:userNameArg password:passwordArg 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   272
    "set instance variables (automatically generated)"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   273
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   274
    hostName := hostNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   275
    dbName := dbNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   276
    userName := userNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   277
    password := passwordArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   278
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   279
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   280
password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   281
    ^ password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   282
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   283
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   284
password:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   285
    password := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   286
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   287
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   288
userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   289
    ^ userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   290
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   291
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   292
userName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   293
    userName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   294
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   295
2309
d01e36094bf9 category
Claus Gittinger <cg@exept.de>
parents: 2198
diff changeset
   296
!StoreSourceCodeManager::DBInfo methodsFor:'printing & storing'!
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   297
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   298
storeOn:aStream
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   299
    aStream 
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   300
        nextPutAll:'(';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   301
        nextPutAll:self class name;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   302
        nextPutAll:' basicNew';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   303
        nextPutAll:' hostAndDBName:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   304
        store: self hostAndDBName;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   305
        nextPutAll:' userName:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   306
        store: self userName;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   307
        nextPutAll:' password:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   308
        store: self password;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   309
        nextPutAll:')'.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   310
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   311
    "
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   312
     self readFrom:(self basicNew hostAndDBName:'a' userName:'b' password:'c') storeString
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   313
     self readFrom:(self basicNew hostAndDBName:'a@h' userName:'b' password:'c') storeString
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   314
    "
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   315
! !
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   316
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
!StoreSourceCodeManager class methodsFor:'documentation'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
2198
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   319
version_CVS
2526
885e44dc1e4a When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2381
diff changeset
   320
    ^ '$Header: /cvs/stx/stx/libbasic3/StoreSourceCodeManager.st,v 1.16 2011-09-27 16:05:13 vrany Exp $'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
! !