AbstractSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Fri, 20 Jan 2012 16:48:33 +0100
changeset 2742 bb8d754b8edb
parent 2730 f4685e7b9ee5
child 2743 0539670d18e4
permissions -rw-r--r--
changed: #initialize
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
     3
              All Rights Reserved
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    13
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#AbstractSourceCodeManager
2231
d4c1c8005b69 changed: #initCacheDirPath
Claus Gittinger <cg@exept.de>
parents: 2227
diff changeset
    15
	instanceVariableNames:''
d4c1c8005b69 changed: #initCacheDirPath
Claus Gittinger <cg@exept.de>
parents: 2227
diff changeset
    16
	classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
    17
		WorkTreeDirectoryName ManagerPerModule'
2231
d4c1c8005b69 changed: #initCacheDirPath
Claus Gittinger <cg@exept.de>
parents: 2227
diff changeset
    18
	poolDictionaries:''
d4c1c8005b69 changed: #initCacheDirPath
Claus Gittinger <cg@exept.de>
parents: 2227
diff changeset
    19
	category:'System-SourceCodeManagement'
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
2445
vrany
parents: 2443
diff changeset
    22
Object subclass:#PackageAndManager
vrany
parents: 2443
diff changeset
    23
	instanceVariableNames:'package managerTypeName'
vrany
parents: 2443
diff changeset
    24
	classVariableNames:''
vrany
parents: 2443
diff changeset
    25
	poolDictionaries:''
vrany
parents: 2443
diff changeset
    26
	privateIn:AbstractSourceCodeManager
vrany
parents: 2443
diff changeset
    27
!
vrany
parents: 2443
diff changeset
    28
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    29
!AbstractSourceCodeManager class methodsFor:'documentation'!
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
copyright
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 COPYRIGHT (c) 1995 by Claus Gittinger
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
    34
              All Rights Reserved
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 This software is furnished under a license and may be used
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 only in accordance with the terms of that license and with the
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 inclusion of the above copyright notice.   This software may not
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 be provided or otherwise made available to, or used by, any
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 other person.  No title to or ownership of the software is
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    43
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    44
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    45
documentation
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    46
"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    47
    Abstract superclass for sourceCodeManagers.
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    48
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    49
    Concrete subclasses provide access to a source repository.
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    50
    Most protocol here traps into subclassResponsbility errors.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    51
    Please read more documentation in concrete subclasses 
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    52
    (especially: CVSSourceCodeManager) for how to use this manager and
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    53
    what to redefine in another repository manager if required.
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    54
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    55
    [author:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    56
        Claus Gittinger
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    57
"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
    58
! !
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    60
!AbstractSourceCodeManager class methodsFor:'initialization'!
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    61
2647
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    62
forgetDisabledModules
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    63
    ^ self
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    64
!
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    65
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    66
initCacheDirPath
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    67
    "initialize the name of the cacheDirectory.
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    68
     This is:
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    69
          <tempDir>/stx_sourceCache."
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    70
2231
d4c1c8005b69 changed: #initCacheDirPath
Claus Gittinger <cg@exept.de>
parents: 2227
diff changeset
    71
    CacheDirectoryName := (Filename defaultTempDirectory constructString:'stx_sourceCache').
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    72
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    73
    "
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    74
     self initCacheDirPath
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    75
    "
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    76
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    77
    "Modified: / 12.7.1999 / 10:01:31 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    78
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    79
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    80
initialize
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    81
    "setup for no caching and no workTree"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    82
1930
74929dd929d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
    83
    CachingSources isNil ifTrue:[CachingSources := false].
74929dd929d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
    84
    UseWorkTree    isNil ifTrue:[UseWorkTree := false].
2742
bb8d754b8edb changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
    85
    self initCacheDirPath.
bb8d754b8edb changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
    86
bb8d754b8edb changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
    87
    "Modified: / 20-01-2012 / 16:48:26 / cg"
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    88
! !
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    89
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    90
!AbstractSourceCodeManager class methodsFor:'accessing'!
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    91
1729
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    92
availableManagers
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    93
    ^ AbstractSourceCodeManager allSubclasses 
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    94
        reject:[:cls | (cls isAbstract) or:[cls isExperimental ]].
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    95
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    96
    "
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    97
     self availableManagers   
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    98
    "
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
    99
!
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   100
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   101
cacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   102
    "return the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   103
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   104
     This cache is shared among all ST/X users on a system."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   105
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   106
    ^ CacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   107
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   108
    "Modified: 12.9.1996 / 02:20:45 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   109
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   110
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   111
cacheDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   112
    "set the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   113
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   114
     This cache is shared among all ST/X users on a system.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   115
     The directory is typically set via the launchers setting menu, or
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   116
     from a startup rc-file."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   117
2451
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   118
    CacheDirectoryName := aStringOrFilename.
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   119
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   120
    "HACK, HACK, since ManagerPerModule is lazy-initialize before
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   121
     preferences are read, sigh. We need a better system..."
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   122
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   123
    ManagerPerModule := nil.
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   124
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   125
    "Created: / 16-12-1995 / 15:18:43 / cg"
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   126
    "Modified: / 12-09-1996 / 02:21:35 / cg"
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   127
    "Modified (comment): / 09-07-2011 / 16:02:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   128
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   129
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   130
cachingSources
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   131
    "return true, if source caching is enabled.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   132
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   133
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   134
    ^ CachingSources
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   135
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   136
    "Created: 16.12.1995 / 15:17:50 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   137
    "Modified: 12.9.1996 / 02:22:19 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   138
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   139
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   140
cachingSources:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   141
    "enable/disable the caching of source files.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   142
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   143
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   144
    CachingSources := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   145
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   146
    "Created: 16.12.1995 / 15:18:13 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   147
    "Modified: 12.9.1996 / 02:22:42 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   148
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   149
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   150
defaultManager
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   151
    "return the default sourceCodeManager class"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   152
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   153
    ^ DefaultManager
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   154
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   155
    "Created: 7.12.1995 / 17:14:22 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   156
    "Modified: 12.9.1996 / 02:22:56 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   157
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   158
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   159
managerForMatchingModule:aPackageIDMatchString put:aSourceCodeManagerClass
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   160
    "update the per-module manager definitions, adding a manager class for a matchString"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   161
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   162
    ManagerPerModule isNil ifTrue:[
2446
vrany
parents: 2445
diff changeset
   163
        ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   164
    ].
2445
vrany
parents: 2443
diff changeset
   165
    ManagerPerModule do:[:each |
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   166
        |packageMatch|
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   167
2445
vrany
parents: 2443
diff changeset
   168
        packageMatch := each pattern.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   169
        (packageMatch = aPackageIDMatchString) ifTrue:[
2445
vrany
parents: 2443
diff changeset
   170
            each manager:aSourceCodeManagerClass.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   171
            ^ self
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   172
        ].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   173
    ].
2445
vrany
parents: 2443
diff changeset
   174
    ManagerPerModule add:
vrany
parents: 2443
diff changeset
   175
        (PackageAndManager 
vrany
parents: 2443
diff changeset
   176
            package: aPackageIDMatchString 
vrany
parents: 2443
diff changeset
   177
            manager: aSourceCodeManagerClass)
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   178
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   179
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   180
     self managerForModule:'stx:libbasic2' put:SVNSourceCodeManager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   181
     self managerForModule:'stx:libbasic2' put:CVSSourceCodeManager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   182
     self managerForModule:'stx:libbasic2'
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   183
     self managerForModule:'exept:expecco' 
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   184
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   185
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   186
    "Created: / 18-04-2011 / 19:48:19 / cg"
2446
vrany
parents: 2445
diff changeset
   187
    "Modified: / 09-07-2011 / 15:05:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   188
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   189
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   190
managerForModule:aPackageID
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   191
    "return the sourceCodeManager for a aPackageID, nil if unspecified in the manager per package list"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   192
2557
vrany
parents: 2552
diff changeset
   193
    <resource: #obsolete>
vrany
parents: 2552
diff changeset
   194
vrany
parents: 2552
diff changeset
   195
    "Bad/misleading naming here, better use managerForPackage:"
vrany
parents: 2552
diff changeset
   196
vrany
parents: 2552
diff changeset
   197
    self managerPerMatchingModuleDefinitions do:[:each |
vrany
parents: 2552
diff changeset
   198
        (each match:aPackageID) ifTrue:[^ each manager].
vrany
parents: 2552
diff changeset
   199
    ].
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   200
    ^ DefaultManager
2557
vrany
parents: 2552
diff changeset
   201
vrany
parents: 2552
diff changeset
   202
    "
vrany
parents: 2552
diff changeset
   203
     self managerForModule:'stx:libbasic' 
vrany
parents: 2552
diff changeset
   204
     self managerForModule:'stx:libbasic2'
vrany
parents: 2552
diff changeset
   205
     self managerForModule:'exept:expecco'  
vrany
parents: 2552
diff changeset
   206
    "
vrany
parents: 2552
diff changeset
   207
vrany
parents: 2552
diff changeset
   208
    "Created: / 18-04-2011 / 19:39:19 / cg"
vrany
parents: 2552
diff changeset
   209
    "Modified (comment): / 10-10-2011 / 14:51:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   210
    "Modified: / 19-10-2011 / 16:45:50 / cg"
2557
vrany
parents: 2552
diff changeset
   211
!
vrany
parents: 2552
diff changeset
   212
vrany
parents: 2552
diff changeset
   213
managerForPackage:aPackageID
vrany
parents: 2552
diff changeset
   214
    "return the sourceCodeManager for a aPackageID, nil if unspecified in the manager per package list"
vrany
parents: 2552
diff changeset
   215
2446
vrany
parents: 2445
diff changeset
   216
    self managerPerMatchingModuleDefinitions do:[:each |
vrany
parents: 2445
diff changeset
   217
        (each match:aPackageID) ifTrue:[^ each manager].
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   218
    ].
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   219
    ^ DefaultManager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   220
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   221
    "
2445
vrany
parents: 2443
diff changeset
   222
     self managerForModule:'stx:libbasic' 
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   223
     self managerForModule:'stx:libbasic2'
2445
vrany
parents: 2443
diff changeset
   224
     self managerForModule:'exept:expecco'  
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   225
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   226
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   227
    "Created: / 18-04-2011 / 19:39:19 / cg"
2446
vrany
parents: 2445
diff changeset
   228
    "Modified: / 09-07-2011 / 15:09:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2557
vrany
parents: 2552
diff changeset
   229
    "Created: / 10-10-2011 / 14:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   230
    "Modified: / 19-10-2011 / 16:45:38 / cg"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   231
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   232
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   233
managerPerMatchingModuleDefinitions
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   234
    "return the sourceCodeManager definitions"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   235
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   236
    ManagerPerModule isNil ifTrue:[
2445
vrany
parents: 2443
diff changeset
   237
        ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   238
    ].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   239
    ^ ManagerPerModule
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   240
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   241
    "Created: / 18-04-2011 / 20:09:16 / cg"
2445
vrany
parents: 2443
diff changeset
   242
    "Modified: / 09-07-2011 / 13:36:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   243
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   244
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   245
managerPerMatchingModuleDefinitions:aCollection
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   246
    "set the sourceCodeManager definitions; must be an orderedCollection of packageMatchString -> manager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   247
     associations 
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   248
     (not a dictionary, because order is relevant in the matching process, where the first match counts)"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   249
2445
vrany
parents: 2443
diff changeset
   250
    ManagerPerModule := aCollection.
vrany
parents: 2443
diff changeset
   251
    UserPreferences current managerPerMatchingModuleDefinitions:aCollection
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   252
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   253
    "Created: / 18-04-2011 / 20:09:21 / cg"
2445
vrany
parents: 2443
diff changeset
   254
    "Modified: / 09-07-2011 / 13:36:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
   255
!
vrany
parents: 2443
diff changeset
   256
vrany
parents: 2443
diff changeset
   257
named: managerTypeName
vrany
parents: 2443
diff changeset
   258
vrany
parents: 2443
diff changeset
   259
    ^self availableManagers 
vrany
parents: 2443
diff changeset
   260
        detect:[:each|each managerTypeName = managerTypeName]
vrany
parents: 2443
diff changeset
   261
        ifNone:[nil]
vrany
parents: 2443
diff changeset
   262
vrany
parents: 2443
diff changeset
   263
    "
vrany
parents: 2443
diff changeset
   264
        AbstractSourceCodeManager named: 'CVS'
vrany
parents: 2443
diff changeset
   265
        AbstractSourceCodeManager named: 'Perforce'        
vrany
parents: 2443
diff changeset
   266
    "
vrany
parents: 2443
diff changeset
   267
vrany
parents: 2443
diff changeset
   268
    "Created: / 09-07-2011 / 13:51:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   269
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   270
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   271
repositoryInfoPerModule
2145
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   272
    "return the dictionary, which associates CVSRoots to module names.
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   273
     If no entry is contained in this dictionary for some module,
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   274
     the default cvsRoot (CVSRoot) will be used."
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   275
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   276
    ^ #()
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   277
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   278
    "Created: / 09-11-2006 / 15:25:17 / cg"
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   279
!
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   280
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   281
repositoryInfoPerModule:info
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   282
    "/ ignore here
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   283
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   284
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   285
repositoryName
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   286
    "return the name of the repository.
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   287
     Since this is an abstract class, return nil (i.e. none)"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   288
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   289
    ^ nil
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   290
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   291
    "Modified: 12.9.1996 / 02:20:45 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   292
    "Created: 14.9.1996 / 13:21:37 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   293
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   294
2592
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   295
repositoryNameForPackage:packageId 
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   296
    "Return the repository ULR for the given package. 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   297
     Used for testing/debugging source code management configuration"
2592
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   298
    
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   299
    ^ self subclassResponsibility
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   300
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   301
    "Created: / 10-10-2011 / 19:44:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   302
    "Modified (comment): / 21-12-2011 / 23:03:00 / cg"
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   303
!
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   304
2700
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   305
shownInBrowserMenus
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   306
    "can be redefined in subclasses which can be suppressed in the browser's menus"
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   307
2728
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   308
    ^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') ifAbsent:false.
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   309
2700
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   310
    "Created: / 08-01-2012 / 19:56:22 / cg"
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   311
!
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   312
2728
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   313
shownInBrowserMenus:aBoolean
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   314
    "can be redefined in subclasses which can be suppressed in the browser's menus"
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   315
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   316
    ^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') put:aBoolean.
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   317
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   318
    "Created: / 15-01-2012 / 14:09:21 / cg"
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   319
!
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   320
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   321
useWorkTree
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   322
    "return the setting of useWorkTree, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   323
     controls if an up-to-date view of a CVS working tree should be
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   324
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   325
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   326
    ^ UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   327
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   328
    "Created: 16.12.1995 / 15:36:48 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   329
    "Modified: 12.9.1996 / 02:24:01 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   330
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   331
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   332
useWorkTree:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   333
    "enable/disable the useWorkTree feature, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   334
     controls if an up-to-date view of a CVS working tree should be
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   335
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   336
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   337
    UseWorkTree := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   338
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   339
    "Created: 16.12.1995 / 15:37:29 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   340
    "Modified: 12.9.1996 / 02:24:38 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   341
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   342
2557
vrany
parents: 2552
diff changeset
   343
utilities
vrany
parents: 2552
diff changeset
   344
    "Returns 'utilities' object that can be used by tools. 
vrany
parents: 2552
diff changeset
   345
vrany
parents: 2552
diff changeset
   346
     By default, it returns an instance of
vrany
parents: 2552
diff changeset
   347
     SourceCodeManagerUtilities with receiver as its
vrany
parents: 2552
diff changeset
   348
     manager, but individual managers may override this
vrany
parents: 2552
diff changeset
   349
     method and supply its own, customized utilities."
vrany
parents: 2552
diff changeset
   350
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   351
    ^ SourceCodeManagerUtilities forManager: self
2557
vrany
parents: 2552
diff changeset
   352
vrany
parents: 2552
diff changeset
   353
    "Created: / 10-10-2011 / 15:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   354
    "Modified (format): / 21-12-2011 / 20:05:31 / cg"
2557
vrany
parents: 2552
diff changeset
   355
!
vrany
parents: 2552
diff changeset
   356
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   357
workTreeDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   358
    "return the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   359
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   360
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   361
    ^ WorkTreeDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   362
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   363
    "Created: 16.12.1995 / 15:35:21 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   364
    "Modified: 12.9.1996 / 02:25:13 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   365
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   366
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   367
workTreeDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   368
    "set the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   369
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   370
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   371
    WorkTreeDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   372
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   373
    "Created: 16.12.1995 / 15:35:34 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   374
    "Modified: 12.9.1996 / 02:25:19 / cg"
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   375
! !
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   376
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   377
!AbstractSourceCodeManager class methodsFor:'basic access'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   378
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   379
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir source:sourceFile logMessage:logMessage force:force
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   380
    "checkin of a class into the source repository.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   381
     Return true if ok, false if not."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   382
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   383
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   384
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   385
    "Created: 14.2.1997 / 21:17:33 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   386
    "Modified: 14.2.1997 / 21:18:48 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   387
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   388
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   389
checkoutModule:aModule directory:aPackage andDo:aBlock
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   390
    "check out everything from a package into a temporary directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   391
     Then evaluate aBlock, passing the name of that temp-directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   392
     Afterwards, the tempDir is removed.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   393
     Return true, if OK, false if any error occurred."
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   394
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   395
    ^ self subclassResponsibility
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   396
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   397
    "Created: / 23-08-2006 / 14:07:08 / cg"
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   398
!
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   399
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   400
streamForClass:aClass fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:doCache
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   401
    "extract a classes source code and return an open readStream on it.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   402
     A revision of nil selects the current (in image) revision.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   403
     The classes source code is extracted using the revision and the sourceCodeInfo,
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   404
     which itself is extracted from the classes packageString."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   405
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   406
    ^ self subclassResponsibility
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   407
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   408
    "Modified: 14.2.1997 / 21:18:35 / cg"
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   409
!
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   410
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   411
streamForExtensionFile:fileName package:package directory:dir module:mod cache:doCache
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   412
    |defClass extensionsRevisionString extensionsRevisionInfo rev|
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   413
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   414
    defClass := ProjectDefinition definitionClassForPackage:package.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   415
    extensionsRevisionString := defClass perform:(self nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   416
    extensionsRevisionString isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   417
        Transcript showCR:'warning: no valid version info for extensions of "',package,'"'.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   418
        ^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   419
    ].
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   420
2399
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   421
    extensionsRevisionInfo := self revisionInfoFromString:extensionsRevisionString inClass:nil.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   422
    extensionsRevisionInfo isNil ifTrue:[
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   423
        self halt:'oops - possibly corrupted extensions version string'.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   424
        "/ check for umlaut-remover/adder bug from felix in extensionsRevisionString !!!!!!!!
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   425
        ^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   426
    ].
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   427
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   428
    self assert:(fileName = 'extensions.st').
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   429
    self assert:(fileName = extensionsRevisionInfo fileName).
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   430
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   431
    rev := extensionsRevisionInfo revision.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   432
    ^ self streamForClass:nil fileName:fileName revision:rev directory:dir module:mod cache:doCache.
2399
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   433
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   434
    "Modified: / 01-07-2011 / 13:52:38 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   435
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   436
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   437
!AbstractSourceCodeManager class methodsFor:'basic administration'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   438
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   439
checkForExistingContainer:fileName inModule:moduleName directory:dirName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   440
    "check for a container to be present"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   441
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   442
    ^ self subclassResponsibility.
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   443
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   444
    "Created: / 13-09-2006 / 18:22:24 / cg"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   445
!
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   446
1785
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   447
checkForExistingContainer:fileName inPackage:aPackage
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   448
    "check if a source-code container is present in a packages directory."
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   449
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   450
    |packageDir moduleDir|
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   451
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   452
    packageDir := aPackage asPackageId directory.
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   453
    moduleDir := aPackage asPackageId module. 
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   454
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   455
    ^ self 
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   456
        checkForExistingContainer:fileName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   457
        inModule:moduleDir 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   458
        directory:packageDir
1785
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   459
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   460
    "Created: / 13-09-2006 / 18:10:30 / cg"
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   461
!
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   462
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   463
checkForExistingContainerForClass:aClass
1013
c455100cbaa8 comments added
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   464
    "check if a source-code container for a given class is present in the repository."
c455100cbaa8 comments added
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   465
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   466
    |sourceInfo packageDir moduleDir classFileName|
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   467
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   468
    sourceInfo := self sourceInfoOfClass:aClass.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   469
    sourceInfo isNil ifTrue:[
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   470
        ('SourceCodeManager [warning]: no sourceInfo for class: ' , aClass name) errorPrintCR.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   471
        ^ false
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   472
    ].
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   473
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   474
    packageDir := self directoryFromSourceInfo:sourceInfo.
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   475
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   476
    classFileName := self containerFromSourceInfo:sourceInfo.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   477
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   478
    ^ self 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   479
        checkForExistingContainer:classFileName 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   480
        inModule:moduleDir 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   481
        directory:packageDir
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   482
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   483
    "Created: / 13-05-1998 / 22:35:50 / cg"
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   484
    "Modified: / 13-09-2006 / 18:23:20 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   485
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   486
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   487
checkForExistingModule:moduleName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   488
    "check for a module directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   489
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   490
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   491
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   492
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   493
    "Modified: 14.2.1997 / 21:19:01 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   494
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   495
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   496
checkForExistingModule:moduleDir directory:packageDir
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   497
    "check for a package directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   498
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   499
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   500
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   501
    "Created: / 23-08-2006 / 14:03:06 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   502
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   503
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   504
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   505
    "create a new container & check into it an initial version of aClass"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   506
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   507
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   508
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   509
    "Created: 9.12.1995 / 19:02:47 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   510
    "Modified: 14.2.1997 / 21:19:11 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   511
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   512
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   513
createModule:moduleName
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   514
    "create a new module directory"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   515
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   516
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   517
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   518
    "Created: 9.12.1995 / 19:02:23 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   519
    "Modified: 14.2.1997 / 21:19:16 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   520
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   521
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   522
createModule:module directory:directory
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   523
    "create a new package directory"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   524
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   525
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   526
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   527
    "Created: / 23-08-2006 / 14:04:41 / cg"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   528
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   529
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   530
initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   531
    "return a string usable as initial revision string"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   532
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   533
    ^ self subclassResponsibility
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   534
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   535
    "Created: / 23-08-2006 / 14:05:42 / cg"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   536
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   537
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   538
revisionLogOf:clsOrNil fromRevision:firstRev toRevision:lastRef fileName:classFileName directory:packageDir module:moduleDir 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   539
    ^ self 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   540
        revisionLogOf:clsOrNil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   541
        fromRevision:firstRev
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   542
        toRevision:lastRef
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   543
        numberOfRevisions:nil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   544
        fileName:classFileName
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   545
        directory:packageDir
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   546
        module:moduleDir
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   547
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   548
2210
42dd6c92f827 comment/format in: #revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Claus Gittinger <cg@exept.de>
parents: 2208
diff changeset
   549
revisionLogOf:clsOrNil fromRevision:rev1OrNil toRevision:rev2OrNil numberOfRevisions:limitOrNil fileName:classFileName directory:packageDir module:moduleDir 
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   550
    "actually do return a revisionLog. The main worker method.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   551
     This must be implemented by a concrete source-code manager"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   552
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   553
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   554
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   555
    "Created: 15.11.1995 / 18:12:51 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   556
    "Modified: 14.2.1997 / 21:14:01 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   557
! !
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   558
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   559
!AbstractSourceCodeManager class methodsFor:'cache administration'!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   560
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   561
condenseSourceCache
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   562
    "remove all cached old versions (i.e. leave the newest only)"
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   563
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   564
    |extractBaseAndVersion versionIsGreater vsnNumberString baseName|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   565
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   566
    CacheDirectoryName isNil ifTrue:[^ self].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   567
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   568
    extractBaseAndVersion := 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   569
        [:filenameString |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   570
            |i|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   571
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   572
            i := filenameString size.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   573
            [i > 0 and:[(filenameString at:i) isDigit or:[(filenameString at:i) == $.]]] whileTrue:[ i := i - 1 ].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   574
            vsnNumberString := filenameString copyFrom:i + 1.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   575
            (filenameString at:i) == $_ ifTrue:[i := i - 1].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   576
            baseName := filenameString copyTo:i.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   577
        ].        
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   578
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   579
    versionIsGreater :=
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   580
        [:vA :vB |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   581
            |seqA seqB sequenceIsGreater|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   582
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   583
            seqA := (vA asCollectionOfSubstringsSeparatedBy:$.) collect:[:each | Integer readFrom:each].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   584
            seqB := (vB asCollectionOfSubstringsSeparatedBy:$.) collect:[:each | Integer readFrom:each].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   585
            sequenceIsGreater :=
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   586
                [:seqA :seqB :index |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   587
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   588
                    |elA elB|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   589
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   590
                    elA := seqA at:index.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   591
                    elB := seqB at:index.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   592
                    elA > elB ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   593
                        true
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   594
                    ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   595
                        elA < elB ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   596
                            false
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   597
                        ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   598
                            sequenceIsGreater value:seqA value:seqB value:index+1.
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   599
                        ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   600
                    ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   601
                ].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   602
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   603
            sequenceIsGreater value:seqA value:seqB value:1.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   604
        ].    
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   605
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   606
    CacheDirectoryName asFilename withAllDirectoriesDo:[:d |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   607
        |allFiles newestVersions|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   608
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   609
        newestVersions := Dictionary new.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   610
        allFiles := d files.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   611
        allFiles do:[:eachFilename |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   612
            |prevVsnString|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   613
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   614
            extractBaseAndVersion value:eachFilename baseName.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   615
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   616
            vsnNumberString notEmpty ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   617
                prevVsnString := newestVersions at:baseName ifAbsent:nil.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   618
                prevVsnString isNil ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   619
                    newestVersions at:baseName put:vsnNumberString.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   620
                ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   621
                    (versionIsGreater value:vsnNumberString value:prevVsnString) ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   622
                        newestVersions at:baseName put:vsnNumberString
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   623
                    ]
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   624
                ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   625
            ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   626
        ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   627
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   628
        allFiles do:[:eachFilename |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   629
            extractBaseAndVersion value:eachFilename baseName.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   630
            (vsnNumberString isEmpty 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   631
            or:[(vsnNumberString ~= (newestVersions at:baseName))]) ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   632
                eachFilename remove
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   633
            ]
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   634
        ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   635
    ]
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   636
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   637
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   638
     self condenseSourceCache
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   639
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   640
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   641
    "Modified: / 29-08-2006 / 11:25:25 / cg"
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   642
!
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   643
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   644
flushSourceCache
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   645
    "remove all cached versions"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   646
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   647
    |d|
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   648
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   649
    CacheDirectoryName notNil ifTrue:[
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   650
        d := CacheDirectoryName asFilename.
1860
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   651
        d isDirectory ifTrue:[
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   652
            d directoryContentsAsFilenames do:[:eachFile |
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   653
                eachFile recursiveRemove
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   654
            ]
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   655
        ].
2550
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   656
    ].
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   657
    Method flushSourceStreamCache.
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   658
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   659
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   660
     self flushSourceCache
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   661
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   662
2550
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   663
    "Modified: / 30-09-2011 / 13:33:33 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   664
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   665
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   666
!AbstractSourceCodeManager class methodsFor:'obsolete backward compatibility'!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   667
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   668
checkForExistingContainerInModule:moduleDir directory:packageDir container:fileName
2082
1220f55f306b Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 2052
diff changeset
   669
    <resource: #obsolete>
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   670
    "check for a container to exist"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   671
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   672
    self obsoleteMethodWarning.
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   673
    ^ self checkForExistingContainer:fileName inModule:moduleDir directory:packageDir
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   674
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   675
    "Modified: / 13-09-2006 / 18:23:45 / cg"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   676
!
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   677
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   678
checkForExistingContainerInModule:moduleName package:dirName container:fileName
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   679
    "check for a container to be present"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   680
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   681
    <resource: #obsolete>
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   682
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   683
    self obsoleteMethodWarning.
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   684
    ^ self 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   685
        checkForExistingContainer:fileName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   686
        inModule:moduleName 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   687
        directory:dirName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   688
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   689
    "Modified: / 13-09-2006 / 18:23:35 / cg"
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   690
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   691
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   692
checkForExistingModule:moduleDir package:packageDir
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   693
    "check for a package directory to be present"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   694
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   695
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   696
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   697
    ^ self checkForExistingModule:moduleDir directory:packageDir.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   698
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   699
    "Created: / 09-12-1995 / 19:02:23 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   700
    "Modified: / 23-08-2006 / 14:03:25 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   701
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   702
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   703
checkoutModule:aModule package:aPackage andDo:aBlock
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   704
    "check out everything from a package into a temporary directory.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   705
     Then evaluate aBlock, passing the name of that temp-directory.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   706
     Afterwards, the tempDir is removed.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   707
     Return true, if OK, false if any error occurred."
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   708
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   709
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   710
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   711
    ^ self checkoutModule:aModule directory:aPackage andDo:aBlock
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   712
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   713
    "Modified: / 23-08-2006 / 14:07:31 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   714
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   715
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   716
createModule:module package:package
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   717
    "create a new package directory"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   718
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   719
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   720
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   721
    ^ self createModule:module directory:package.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   722
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   723
    "Created: / 09-12-1995 / 19:02:23 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   724
    "Modified: / 23-08-2006 / 14:04:59 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   725
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   726
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   727
getExistingContainersInModule:aModule package:aPackage
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   728
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   729
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   730
    "return a collection containing the names of existing containers"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   731
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   732
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   733
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   734
    ^ self getExistingContainersInModule:aModule directory:aPackage
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   735
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   736
    "Created: / 20-05-1998 / 19:49:12 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   737
    "Modified: / 23-08-2006 / 14:12:24 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   738
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   739
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   740
getExistingPackagesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   741
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   742
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   743
    "return a collection containing the names of existing packages"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   744
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   745
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   746
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   747
    ^ self getExistingDirectoriesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   748
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   749
    "Created: / 20-05-1998 / 19:38:34 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   750
    "Modified: / 23-08-2006 / 14:14:04 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   751
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   752
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   753
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   754
    "return a string usable as initial revision string"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   755
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   756
    <resource: #obsolete>
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
   757
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   758
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   759
    ^ self initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   760
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   761
    "Created: / 14-02-1997 / 21:01:41 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   762
    "Modified: / 23-08-2006 / 14:06:18 / cg"
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
   763
    "Modified (format): / 21-12-2011 / 18:58:53 / cg"
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   764
! !
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   765
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   766
!AbstractSourceCodeManager class methodsFor:'private'!
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   767
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   768
checkMethodPackagesOf:aClass
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   769
    "check if aClass contains methods from another package;
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   770
     ask if these should be checked in with the class.
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   771
     Raises abortSignal if checkIn is to be suppressed.
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   772
     returns:
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   773
        #base   - only check in methods from the classes package
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   774
        #all    - check in all
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   775
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   776
     the old code looked for all extensions, and allowed them to be moved to the base-package.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   777
     This was dangerous, as if one presses yes too quickly, extensions move to the base too easy.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   778
     The new code only allows for extensions from the __NOPROJECT__ package to be moved.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   779
     Extensions always remain extensions, and must be moved by an explicit method-menu action.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   780
    "
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   781
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   782
    |checkInClassPackageOnly clsPackage otherPackages otherPackageNames methodsFromOtherPackages
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   783
     methodCategoriesInOtherPackages methodCategoryInOtherPackages
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   784
     msg answer isDefaultAnswer labels actions hasUnassignedExtensions
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   785
     unassignedMethods methodCategoriesWithUnassignedMethods methodCategoryWithUnassignedMethods 
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   786
     args|
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   787
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   788
    checkInClassPackageOnly := false.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   789
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   790
    clsPackage := aClass package.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   791
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   792
    otherPackages := Set new.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   793
    methodsFromOtherPackages := OrderedCollection new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   794
    hasUnassignedExtensions := false.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   795
    unassignedMethods := OrderedCollection new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   796
    methodCategoriesWithUnassignedMethods := Set new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   797
    methodCategoriesInOtherPackages := Set new.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   798
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   799
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   800
        |mthdPackage|
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   801
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   802
        (mthdPackage := mthd package) ~= clsPackage ifTrue:[
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   803
            mthdPackage = PackageId noProjectID ifTrue:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   804
                hasUnassignedExtensions := true.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   805
                unassignedMethods add:mthd.        
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   806
                methodCategoriesWithUnassignedMethods add:(mthd category).
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   807
            ] ifFalse:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   808
                methodsFromOtherPackages add:mthd.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   809
                otherPackages add:mthdPackage.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   810
                methodCategoriesInOtherPackages add:(mthd category).
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   811
            ].
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   812
        ]
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   813
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   814
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   815
    hasUnassignedExtensions ifFalse:[
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   816
        aClass allPrivateClassesDo:[:eachPrivateClass |
1028
e839e2bcf1d7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
   817
            aClass setPackage:clsPackage.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   818
            eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   819
                mthd setPackage:clsPackage
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   820
            ]
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   821
        ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   822
        ^ #base
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   823
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   824
1029
2bb7575ddf46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   825
    otherPackages := otherPackages asOrderedCollection sort.
2043
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   826
    otherPackageNames := 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   827
        String streamContents:[:stream| 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   828
            otherPackages 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   829
                do:[:eachPackageName| eachPackageName printOn:stream] 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   830
                separatedBy:[stream nextPutAll:', '].
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   831
        ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   832
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   833
    methodCategoriesInOtherPackages size == 1 ifTrue:[
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   834
        methodCategoryInOtherPackages := methodCategoriesInOtherPackages anElement.
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   835
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   836
    methodCategoriesWithUnassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   837
        methodCategoryWithUnassignedMethods := methodCategoriesWithUnassignedMethods anElement.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   838
    ].
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   839
1021
0448114aab01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1018
diff changeset
   840
    isDefaultAnswer := false.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   841
    (SourceCodeManagerUtilities yesToAllNotification notNil 
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   842
    and:[SourceCodeManagerUtilities yesToAllNotification isHandled]) ifTrue:[
1021
0448114aab01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1018
diff changeset
   843
        answer := isDefaultAnswer := true.
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   844
    ] ifFalse:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   845
        methodCategoriesWithUnassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   846
            unassignedMethods size == 1 ifTrue:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   847
                msg := 'The class ''%1'' contains the unassigned (loose) method: %6'.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   848
            ] ifFalse:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   849
                msg := 'The class ''%1'' contains %3 unassigned (loose) method(s)'.
2468
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
   850
            ].
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
   851
            msg := msg , '\(In the ''%4'' category).'.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   852
        ] ifFalse:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   853
            msg := 'The class ''%1'' contains %3 unassigned (loose) methods in %5 categories.'.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   854
        ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   855
        unassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   856
            msg := msg , '\\Move this method to the ''%2'' package ?'.
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
   857
            msg := msg , '\\Hint: if this is meant to be an extension of another package,\move it to the appropriate package and checkIn the extension(s).'.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   858
        ] ifFalse:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   859
            msg := msg , '\\Move those to the ''%2'' package ?'.
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
   860
            msg := msg , '\\Hint: if these are meant to be extensions of another package,\move them to the appropriate package and checkIn the extensions.'.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   861
        ].
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
   862
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   863
        args := Array
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   864
                    with:aClass name allBold
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   865
                    with:clsPackage allBold
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   866
                    with:unassignedMethods size
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   867
                    with:methodCategoryWithUnassignedMethods
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   868
                    with:methodCategoriesWithUnassignedMethods size
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   869
                    with:unassignedMethods first selector allBold.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   870
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   871
        SourceCodeManagerUtilities yesToAllNotification isHandled       
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   872
        ifTrue:[
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   873
            labels := #('Cancel' 'No' 'Browse' 'Yes to all' 'Yes').
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   874
            actions := #(#cancel false #browse #yesToAll true).
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   875
        ] ifFalse:[
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   876
            labels := #('Cancel' 'No' 'Browse' 'Yes').
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   877
            actions := #(#cancel false #browse true).
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   878
        ].
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   879
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   880
        answer := OptionBox 
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   881
                      request:(SystemBrowser classResources
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   882
                                stringWithCRs:msg
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   883
                                withArgs:args) 
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   884
                      label:'Change packageID ?'
1392
4469708537e8 dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents: 1348
diff changeset
   885
                      image:(InfoBox iconBitmap)
1218
7bf09a49d58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1217
diff changeset
   886
                      buttonLabels:(Dialog resources array:labels)
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   887
                      values:actions
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   888
                      default:true.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   889
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   890
        answer == #browse ifTrue:[
1112
c395948357d3 care for userPref-browser-setting (in browse-action)
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
   891
            UserPreferences current systemBrowserClass
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   892
                browseMethods:unassignedMethods
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   893
                title:('Unassigned (loose) Methods in %1' bindWith:aClass name)
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   894
                sort:true.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   895
            answer := #cancel.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   896
        ].
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   897
"/        answer == #browseExtensions ifTrue:[
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   898
"/            UserPreferences current systemBrowserClass
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   899
"/                browseMethods:methodsFromOtherPackages
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   900
"/                title:('Extensions for %1' bindWith:aClass name)
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   901
"/                sort:true.
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   902
"/            answer := #cancel.
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   903
"/        ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   904
    ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   905
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   906
    answer == #cancel ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   907
        AbortSignal raise
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   908
    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   909
    answer == #yesToAll ifTrue:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   910
        SourceCodeManagerUtilities yesToAllNotification raiseWith:true.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   911
        answer := true.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   912
    ].
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   913
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   914
    "/ ok, move them over
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   915
    answer == true ifTrue:[
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   916
        "/ change all method's packageID to the classes packageId
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   917
        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2208
a66ff7ef9153 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2202
diff changeset
   918
            mthd package == PackageId noProjectID ifTrue:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   919
                mthd makeLocalStringSource.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   920
                mthd setPackage:clsPackage
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   921
            ]
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   922
        ].
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   923
        aClass allPrivateClassesDo:[:eachPrivateClass |
1028
e839e2bcf1d7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
   924
            aClass setPackage:clsPackage.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   925
            eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
1454
b7617ab0033d oops - care for extension method's sources
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
   926
                mthd makeLocalStringSource.
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   927
                mthd setPackage:clsPackage
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   928
            ]
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   929
        ].
980
4c0189345206 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
   930
        aClass changed:#projectOrganization.
1011
647a8c2fabc1 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   931
        Smalltalk changed:#projectOrganization with:(Array with:aClass). 
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   932
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   933
    ^ #base
1112
c395948357d3 care for userPref-browser-setting (in browse-action)
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
   934
2468
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
   935
    "Modified: / 24-07-2011 / 07:13:58 / cg"
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   936
!
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   937
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   938
compileVersionMethod:methodName of:aClass for:newRevisionString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   939
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   940
    |cls mthd code|
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   941
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   942
    cls := aClass theMetaclass.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   943
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
   944
    self assert: cls programmingLanguage isSmalltalk.
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
   945
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   946
    code :=
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   947
methodName , '
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   948
    ^ ''' , newRevisionString , '''
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   949
'.
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   950
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   951
    mthd := Compiler 
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   952
                compile:code  
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   953
                forClass:cls
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   954
                inCategory:#documentation
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   955
                notifying:nil
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   956
                install:true
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   957
                skipIfSame:false
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
   958
                silent:true.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   959
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   960
    mthd notNil ifTrue:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   961
        mthd setPackage:aClass package
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   962
    ]
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   963
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
   964
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   965
containerFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   966
    "given a sourceInfo, return the classes container"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   967
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   968
    (info includesKey:#fileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   969
        ^ info at:#fileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   970
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   971
    (info includesKey:#expectedFileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   972
        ^ info at:#expectedFileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   973
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   974
    ^ (info at:#classFileNameBase) , '.st'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   975
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   976
    "Modified: 12.9.1996 / 02:31:52 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   977
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   978
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   979
directoryFromContainerPath:containerPath forClass:aClass
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   980
    "given a full path as in an RCS header, 
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   981
     extract the directory (i.e. package)."
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   982
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   983
    ^ self directoryFromContainerPath:containerPath forPackage:(aClass package)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   984
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   985
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   986
     CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st' forClass:Array
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   987
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   988
!
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   989
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   990
directoryFromContainerPath:containerPath forPackage:packageID
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   991
    "given a full path as in an RCS header, 
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   992
     extract the directory (i.e. package)."
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   993
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   994
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   995
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
   996
    path := self pathInRepositoryFrom:containerPath forPackage:packageID.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   997
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   998
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   999
    "/ these are always UNIX filenames ...
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1000
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1001
    idx ~~ 0 ifTrue:[
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1002
        path := path copyFrom:(idx + 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1003
    ].
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1004
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1005
    "/ the code below used to be:
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1006
    "/     ^ path asFilename directoryName
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1007
    "/ however, that only works under UNIX, since
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1008
    "/ we MUST return a unix pathname here.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1009
    "/ therefore, do what unix would do here ...
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1010
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1011
    idx := path lastIndexOf:$/.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1012
    idx == 0 ifTrue:[
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1013
        "/ huh ?
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1014
        ^ path
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1015
    ].
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1016
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1017
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1018
    "
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1019
     CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1020
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1021
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1022
    "Created: / 25.9.1998 / 15:37:06 / cg"
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1023
    "Modified: / 25.9.1998 / 15:38:59 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1024
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1025
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1026
directoryFromSourceInfo:info
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1027
    "given a sourceInfo, return the classes package directory"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1028
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  1029
    ^ info at:#directory ifAbsent:nil.
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1030
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1031
    "Created: / 23-08-2006 / 14:10:29 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1032
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1033
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1034
moduleFromContainerPath:containerPath forClass:aClass
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1035
    "given a full path as in an RCS header, extract the module."
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1036
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1037
    ^ self moduleFromContainerPath:containerPath forPackage:aClass package
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1038
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1039
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1040
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st' forClass:Array
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1041
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1042
!
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1043
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1044
moduleFromContainerPath:containerPath forPackage:packageID
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1045
    "given a full path as in an RCS header, extract the module."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1046
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1047
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1048
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1049
    path := self pathInRepositoryFrom:containerPath forPackage:packageID.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1050
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1051
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1052
    "/ these are always UNIX filenames
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1053
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1054
    idx == 0 ifTrue:[^ path].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1055
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1056
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1057
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1058
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1059
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1060
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1061
    "Created: / 25.11.1995 / 18:42:20 / cg"
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1062
    "Modified: / 11.8.1998 / 23:01:24 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1063
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1064
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1065
moduleFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1066
    "given a sourceInfo, return the classes module directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1067
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1068
    ^ info at:#module.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1069
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1070
    "Created: 6.2.1996 / 17:26:38 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1071
    "Modified: 12.9.1996 / 02:32:23 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1072
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1073
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1074
packageFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1075
    "given a sourceInfo, return the classes package directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1076
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
  1077
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1078
    self obsoleteMethodWarning.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1079
    ^ info at:#directory.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1080
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1081
    "Created: / 06-02-1996 / 17:26:23 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1082
    "Modified: / 23-08-2006 / 14:11:18 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1083
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1084
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1085
pathInRepositoryFrom:containerPath forPackage:packageID
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1086
    "this tries to extract the path within a repository, given some path
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1087
     as present in an RCS Header string.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1088
     Typically, this ought to be that string directly; 
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1089
     however, if the repository directory is accessed via a symbolic link during
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1090
     ci/co, some systems extract different strings with co.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1091
     One such system here had a symbolic link from /phys/ibm/CVS... to /file/CVS,
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1092
     and extracted sources had /phys/ibm/CVS in their header.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1093
     Do not depend on the code below to work correctly all the time."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1094
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1095
    |top lastTop idx|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1096
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1097
    containerPath isNil ifTrue:[^ nil].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1098
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1099
    packageID notNil ifTrue:[
1348
4b2b7b73098e path extraction
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
  1100
        idx := containerPath lastIndexOfSubCollection:(packageID copyReplaceAll:$: with:$/).
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1101
        idx ~~ 0 ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1102
            ^ containerPath copyFrom:idx.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1103
        ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1104
    ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1105
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1106
    "/
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1107
    "/ the following is heuristics, in case that the packageID is not known
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1108
    "/ (should not be required)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1109
    "/
1499
9f17ad89deb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  1110
    top := self repositoryTopDirectoryFromCVSRoot.
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1111
    top notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1112
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1113
        (containerPath startsWith:(top , '/')) ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1114
            ^ containerPath copyFrom:(top size + 2).
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1115
        ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1116
        (containerPath startsWith:(top)) ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1117
            ^ containerPath copyFrom:(top size + 1).
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1118
        ].
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1119
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1120
        "/ hardcase - the repository-filename in the versionInfo
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1121
        "/ does not match my repository top.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1122
        "/ check for mangled prefix (happens with symbolic links)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1123
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1124
        lastTop := '/' , top asFilename baseName, '/'.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1125
        idx := containerPath indexOfSubCollection:lastTop.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1126
        idx ~~ 0 ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1127
            ('SourceCodeManager [warning]: warning: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintCR.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1128
            'SourceCodeManager [info]: warning: assuming that mismatch is ok.' infoPrintCR.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1129
            ^ containerPath copyFrom:(idx + lastTop size).
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1130
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1131
    ].
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1132
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1133
    ^ nil
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1134
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1135
    "
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1136
     SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st'    forPackage:Array package 
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1137
     SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' forPackage:Array package 
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1138
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1139
     SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st'    forPackage:nil          
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1140
     SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' forPackage:nil 
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1141
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1142
1498
67b278e62f29 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1143
    "Created: / 25-11-1995 / 18:42:20 / cg"
67b278e62f29 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1144
    "Modified: / 21-06-2006 / 12:06:14 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1145
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1146
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1147
postCheckInClass:aClass
871
93f994512ade checkin from browser
ps
parents: 870
diff changeset
  1148
    "invoked after a checkIn"
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1149
928
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1150
    |p|
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1151
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1152
    (p := Project current) notNil ifTrue:[
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1153
        p condenseChangesForClassCheckin:aClass.
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1154
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1155
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1156
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1157
    "/ Set the source code for every method of the checked in class
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1158
    "/ Ensure that the source code for the compiled methods is the original one
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1159
    "/ Done to avoid checking out from the repository using binaryRevision and sourcePosition
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1160
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1161
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1162
        mthd makeLocalStringSource.
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1163
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1164
    aClass allPrivateClassesDo:[:eachPrivateClass |
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1165
        eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1166
            mthd makeLocalStringSource.
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1167
        ]
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1168
    ].
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1169
!
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1170
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1171
postCheckInExtensionsForPackage:aPackageId
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1172
    "invoked after a checkIn"
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1173
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1174
    |p extensionMethods|
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1175
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1176
    (p := Project current) notNil ifTrue:[
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1177
        p condenseChangesForExtensionsCheckInInPackage:aPackageId.
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1178
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1179
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1180
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1181
    "/ Set the source code for every extension method of the checked in aPackageId
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1182
    "/ Ensure that the source code for the compiled methods is the original one
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1183
    "/ Done to avoid checking out from the repository
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1184
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1185
    extensionMethods := Smalltalk allExtensionsForPackage:aPackageId.
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1186
    extensionMethods do:[:mthd |
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1187
        mthd makeLocalStringSource.
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1188
    ].
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1189
!
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1190
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1191
reportError:msg
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1192
    |fullMsg|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1193
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1194
    fullMsg := self class name,' [error]: ',msg.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1195
    fullMsg errorPrintCR.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1196
    SourceCodeManagerError raiseErrorString:fullMsg.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1197
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1198
    "Created: / 29-08-2006 / 12:44:19 / cg"
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1199
!
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1200
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1201
repositoryTopDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1202
    "return the name of the repository"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1203
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1204
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1205
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1206
    "Created: 25.11.1995 / 18:38:59 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1207
    "Modified: 12.9.1996 / 02:32:40 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1208
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1209
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1210
sourceCacheDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1211
    "return the sourceCache directories name"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1212
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1213
    |dir nm|
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1214
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1215
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1216
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1217
    (dir := nm asFilename) exists ifFalse:[
1467
26f9edcb3542 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
  1218
        OperatingSystem errorSignal catch:[
2232
ee754b28809e changed: #sourceCacheDirectory
Claus Gittinger <cg@exept.de>
parents: 2231
diff changeset
  1219
            dir recursiveMakeDirectory.
1060
bf0279994422 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1038
diff changeset
  1220
        ].
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1221
        dir exists ifFalse:[
2232
ee754b28809e changed: #sourceCacheDirectory
Claus Gittinger <cg@exept.de>
parents: 2231
diff changeset
  1222
            ('SourceCodeManager [warning]: could not create cache dir "',CacheDirectoryName,'"') errorPrintCR.
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1223
            ^ nil
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1224
        ].
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1225
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1226
        "/ make it read/writable for everyone
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1227
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1228
        dir makeReadableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1229
        dir makeWritableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1230
        dir makeExecutableForAll.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1231
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1232
    ^ dir
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1233
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1234
    "Modified: 10.1.1997 / 15:13:20 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1235
!
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1236
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1237
sourceInfoOfClass:aClass
751
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1238
    "helper: return a classes sourceCodeInfo by extracting its
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1239
     versionString components."
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1240
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1241
    |cls packageInfo revInfo actualSourceFileName classFileNameBase
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1242
     newInfo container expectedFileName
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1243
     directoryFromVersion moduleFromVersion fileNameFromVersion 
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1244
     directoryFromPackage moduleFromPackage|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1245
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1246
    cls := aClass theNonMetaclass.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1247
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1248
    newInfo := IdentityDictionary new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1249
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1250
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1251
    "/ the info given by the classes source ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1252
    "/ (i.e. its revisionString)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1253
    "/
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1254
    revInfo := cls revisionInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1255
    revInfo notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1256
        revInfo keysAndValuesDo:[:key :value |
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1257
            newInfo at:key put:value
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1258
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1259
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1260
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1261
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1262
    "/ the info given by the classes binary ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1263
    "/ (i.e. its package-ID)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1264
    "/ if present, we better trust that one.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1265
    "/ however, it only contains partial information (module:directory:libName).
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1266
    "/ (but is available even without a source)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1267
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1268
    packageInfo := cls packageSourceCodeInfo.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1269
    packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1270
        packageInfo keysAndValuesDo:[:key :value |
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1271
            newInfo at:key put:value
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1272
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1273
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1274
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1275
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1276
    "/ no information
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1277
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1278
    (packageInfo isNil and:[revInfo isNil]) ifTrue:[
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1279
        ('SourceCodeManager [warning]: class `' , cls name , ''' has neither source nor compiled-in info') infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1280
        ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1281
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1282
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1283
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1284
    "/ validate for conflicts
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1285
    "/ trust binary if in doubt
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1286
    "/ (in case some cheater edited the version string)
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1287
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1288
    revInfo notNil ifTrue:[
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1289
        container := revInfo at:#repositoryPathName ifAbsent:nil.
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1290
        (container notNil) ifTrue:[
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1291
            moduleFromVersion := self moduleFromContainerPath:container forClass:aClass.
1125
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1292
            moduleFromVersion notNil ifTrue:[
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1293
                newInfo at:#module put:moduleFromVersion.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1294
            ].
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1295
            directoryFromVersion := self directoryFromContainerPath:container forClass:aClass.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1296
            directoryFromVersion notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1297
                newInfo at:#directory put:directoryFromVersion.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1298
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1299
            fileNameFromVersion := container asFilename baseName.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1300
            (fileNameFromVersion endsWith:',v') ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1301
                fileNameFromVersion := fileNameFromVersion copyWithoutLast:2.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1302
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1303
            newInfo at:#fileName put:fileNameFromVersion.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1304
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1305
            packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1306
                (packageInfo includesKey:#directory) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1307
                    directoryFromPackage := packageInfo at:#directory.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1308
                    moduleFromPackage := packageInfo at:#module.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1309
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1310
                    (directoryFromPackage ~= directoryFromVersion 
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1311
                    or:[moduleFromPackage ~= moduleFromVersion]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1312
                        (directoryFromVersion isNil or:[moduleFromVersion isNil]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1313
                            directoryFromPackage ~= 'no package' ifTrue:[
1125
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1314
                                moduleFromVersion notNil ifTrue:[
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1315
                                    ('SourceCodeManager [warning]: conflicting source infos (binary: ' 
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1316
                                        , (moduleFromPackage ? 'nil')  , '/' , (directoryFromPackage  ? 'nil')
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1317
                                        , ' vs. source:'
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1318
                                        , (moduleFromVersion ? 'nil') , '/' , (directoryFromVersion ? 'nil')
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1319
                                        , ')') infoPrintCR.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1320
                                    ('SourceCodeManager [info]: using binary info: ' 
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1321
                                        , moduleFromPackage , '/' , directoryFromPackage
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1322
                                    ) infoPrintCR.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1323
                                ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1324
                                newInfo at:#directory put:directoryFromPackage.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1325
                                newInfo at:#module put:moduleFromPackage.
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1326
                            ]
187
fdda79120bbb in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents: 185
diff changeset
  1327
                        ] ifFalse:[
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1328
                            directoryFromPackage ~= 'no package' ifTrue:[
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1329
                                ('SourceCodeManager [warning]: conflicting source infos (binary: ' 
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1330
                                    , moduleFromPackage  , '/' , directoryFromPackage
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1331
                                    , ' vs. source:'
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1332
                                    , moduleFromVersion  , '/' , directoryFromVersion
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1333
                                    , ')') infoPrintCR.
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1334
                            ]
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1335
                        ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1336
                    ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1337
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1338
            ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1339
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1340
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1341
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1342
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1343
    "/ the filename I'd expect from its name ...
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1344
    "/
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  1345
    classFileNameBase := cls classBaseFilename.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1346
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1347
    (newInfo includesKey:#fileName) ifFalse:[
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1348
        newInfo at:#fileName put:classFileNameBase
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1349
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1350
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1351
    "/ guess on the container
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1352
    ((newInfo includesKey:#directory) and:[newInfo includesKey:#module]) ifTrue:[
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1353
        |pathInRepository|
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1354
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1355
        container isNil ifTrue:[
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1356
            container := (newInfo at:#module)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1357
                         , '/'
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1358
                         , (newInfo at:#directory)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1359
                         , '/'
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1360
                         , classFileNameBase , ',v'.
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1361
        ].
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1362
        pathInRepository := (newInfo at:#module)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1363
                     , '/'
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1364
                     , (newInfo at:#directory)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1365
                     , '/'
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1366
                     , classFileNameBase.
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1367
        newInfo at:#pathInRepository put:pathInRepository.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1368
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1369
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1370
    container notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1371
        newInfo at:#repositoryPathName put:container.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1372
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1373
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1374
    "/ check ..
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1375
    revInfo notNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1376
        actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1377
        actualSourceFileName notNil ifTrue:[
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1378
            expectedFileName := classFileNameBase.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1379
            actualSourceFileName ~= expectedFileName ifTrue:[
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1380
                ('SourceCodeManager [warning]: source of class ' , cls name , ' in ' , actualSourceFileName , ';') infoPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1381
                ('SourceCodeManager [info]: (expected: ' , expectedFileName , '); renamed or missing abbreviation ?') infoPrintCR.
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1382
                ('SourceCodeManager [info]: This may fail to autoload later if left unchanged.') infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1383
                newInfo at:#expectedFileName put:expectedFileName.
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1384
                newInfo at:#renamed put:true.
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1385
                classFileNameBase := actualSourceFileName
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1386
            ]
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1387
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1388
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1389
1888
61dad1bbee19 use nameWithoutSuffix
Claus Gittinger <cg@exept.de>
parents: 1881
diff changeset
  1390
    newInfo at:#classFileNameBase put:(classFileNameBase asFilename nameWithoutSuffix).
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1391
    ^ newInfo
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1392
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1393
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1394
     self sourceInfoOfClass:Array
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1395
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1396
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1397
    "Modified: / 22-10-2008 / 20:49:15 / cg"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1398
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1399
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1400
updateVersionMethod:selector of:aClass for:newRevisionString
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1401
    "{ Pragma: +optSpace }"
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1402
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1403
    "helper for the checkin procedure.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1404
     Update my #version_XXX method, to now return newRevisionString."
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1405
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1406
    Class methodRedefinitionNotification answer:#keep do:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1407
        Class withoutUpdatingChangesDo:[
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1408
            |oldVersion|
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1409
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1410
"/            "/ must preserve the binary version, as methods still have the offsets into the old source file inside
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1411
"/            oldVersion := aClass revision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1412
"/            aClass setBinaryRevision:oldVersion.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1413
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1414
            self compileVersionMethod:selector of:aClass for:newRevisionString.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1415
        ]
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1416
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1417
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1418
    "Modified: / 29-09-2011 / 21:59:41 / cg"
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1419
    "Created: / 02-12-2011 / 14:18:14 / cg"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1420
!
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1421
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1422
updateVersionMethodOf:aClass for:newRevisionString
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1423
    "{ Pragma: +optSpace }"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1424
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1425
    "helper for the checkin procedure.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1426
     Update my #version_XXX method, to now return newRevisionString."
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1427
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1428
    self updateVersionMethod:(self nameOfVersionMethodInClasses) of:aClass for:newRevisionString.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1429
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1430
    "Updates the old method #version (if present)"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1431
    true "(aClass theMetaclass includesSelector: Class nameOfOldVersionMethod)" ifTrue: [
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1432
        self updateVersionMethod:(Class nameOfOldVersionMethod) of:aClass for:newRevisionString.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1433
    ].
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1434
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1435
    "Modified: / 02-12-2011 / 14:19:37 / cg"
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1436
! !
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1437
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1438
!AbstractSourceCodeManager class methodsFor:'queries'!
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1439
2730
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1440
enabled
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1441
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1442
    "JV@2012-01-19: Quick hack, see senders. Is that what you mean?"
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1443
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1444
    ^self askFor:#shownInBrowserMenus
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1445
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1446
    "Created: / 19-01-2012 / 10:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1447
!
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1448
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1449
isContainerBased
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1450
    "true, if the SCM uses some kind of source container (,v files).
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1451
     False, if it is like a database or filesystem."
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1452
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1453
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1454
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1455
    "Created: / 21-12-2011 / 18:53:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1456
!
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1457
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1458
isExperimental
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1459
    ^ false
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1460
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1461
    "Created: / 16-08-2006 / 11:22:47 / cg"
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1462
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1463
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1464
isResponsibleForModule:module
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1465
    ^ self repositoryInfoPerModule keys includes:module
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1466
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1467
    "Created: / 09-11-2006 / 15:24:57 / cg"
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1468
!
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1469
2445
vrany
parents: 2443
diff changeset
  1470
isResponsibleForPackage:aStringOrSymbol
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1471
    "Returns true if the manager can handle source code for given package.
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1472
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1473
     Answering true does not imply that receiver is configured default
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1474
     manager for that package, it only means that it has a repository
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1475
     configured for given package."
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1476
2445
vrany
parents: 2443
diff changeset
  1477
    self subclassResponsibility
vrany
parents: 2443
diff changeset
  1478
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1479
    "Modified (comment): / 11-10-2011 / 11:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2634
865f10de3c93 comment/format in: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1480
    "Modified (format): / 01-12-2011 / 20:56:32 / cg"
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1481
!
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1482
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1483
isRevision:revision1 after:revision2
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1484
    "true, if the dotted revision string revision1 is > than revision2"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1485
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1486
    |idx1 idx2 nr1 nr2 rest1 rest2|
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1487
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1488
    idx1 := revision1 indexOf:$..
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1489
    idx1 == 0 ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1490
        nr1 := Integer readFrom:revision1.
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1491
    ] ifFalse:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1492
        nr1 := Integer readFrom:(revision1 copyTo:idx1-1).
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1493
        rest1 := revision1 copyFrom:idx1+1.
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1494
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1495
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1496
    idx2 := revision2 indexOf:$..
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1497
    idx2 == 0 ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1498
        nr2 := Integer readFrom:revision2.
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1499
    ] ifFalse:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1500
        nr2 := Integer readFrom:(revision2 copyTo:idx2-1).
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1501
        rest2 := revision2 copyFrom:idx2+1.
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1502
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1503
    nr1 = nr2 ifFalse:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1504
        ^ nr1 > nr2
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1505
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1506
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1507
    "/ advance...
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1508
    rest1 isEmptyOrNil ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1509
        ^ false
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1510
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1511
    rest2 isEmptyOrNil ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1512
        ^ true
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1513
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1514
    ^ self isRevision:rest1 after:rest2
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1515
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1516
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1517
     SourceCodeManager isRevision:'1' after:'2'      
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1518
     SourceCodeManager isRevision:'2' after:'1'      
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1519
     SourceCodeManager isRevision:'1.1' after:'2.1.2' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1520
     SourceCodeManager isRevision:'2.1' after:'1.2.3' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1521
     SourceCodeManager isRevision:'1' after:'1.1'    
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1522
     SourceCodeManager isRevision:'1.1' after:'1'    
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1523
     SourceCodeManager isRevision:'1.1' after:'1.2' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1524
     SourceCodeManager isRevision:'1.2' after:'1.1' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1525
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.5' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1526
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.3' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1527
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3'   
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1528
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.4'   
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1529
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1530
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1531
    "Created: / 21-12-2011 / 19:15:35 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1532
!
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1533
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1534
isVersionMethodSelector: selector 
2342
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1535
    "true if the given selector is for one of the manager's version methods.
2445
vrany
parents: 2443
diff changeset
  1536
     These are all named version_XXX, where XXX is manager-specific (CVS, P4, SVN etc.).
2342
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1537
     For backward compatibility (times, when there was only one CVS sourcecode manager,
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1538
     the selector named 'version' alone also counts as a version method
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1539
     (which might be a somewhat bad idea in the long term...)."
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1540
2195
2062d4138045 changed: #isVersionMethodSelector:
fm
parents: 2192
diff changeset
  1541
    selector isNil ifTrue: [^ false].
2062d4138045 changed: #isVersionMethodSelector:
fm
parents: 2192
diff changeset
  1542
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1543
    ^ selector == self nameOfVersionMethodInClasses 
2530
331e4ee893f7 comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2529
diff changeset
  1544
    or:[selector startsWith: self prefixOfVersionMethodSelector]
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1545
2445
vrany
parents: 2443
diff changeset
  1546
    "Modified (comment): / 09-07-2011 / 12:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2530
331e4ee893f7 comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2529
diff changeset
  1547
    "Modified (format): / 29-09-2011 / 14:56:15 / cg"
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1548
!
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1549
2552
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1550
managerTypeName
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1551
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1552
    "Answers version manager name suitable for UI,
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1553
     i,e., CVS, SubVersion, Perforce"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1554
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1555
    ^ self subclassResponsibility
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1556
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1557
    "Modified (comment): / 03-10-2011 / 13:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1558
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1559
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1560
managerTypeNameShort
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1561
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1562
    "Answers short version manager name suitable for UI,
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1563
     i,e., CVS, SVN, P4. Used in cases where sorter strings
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1564
     are preferred. Defaults to #managerTypeName"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1565
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1566
    ^self managerTypeName
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1567
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1568
    "Created: / 03-10-2011 / 13:28:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1569
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1570
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1571
nameOfVersionMethodForExtensions
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1572
    "that is the old name; now, we use extensionsVersion_<SCM>"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1573
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1574
    ^ #'extensionsVersion'
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1575
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1576
    "Modified (comment): / 29-09-2011 / 13:27:04 / cg"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1577
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1578
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1579
nameOfVersionMethodInClasses
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1580
    "that is the old name; now, we use version_<SCM>"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1581
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1582
    ^ #'version'
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1583
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1584
    "Modified (comment): / 29-09-2011 / 13:27:09 / cg"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1585
!
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1586
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1587
prefixOfVersionMethodSelector
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1588
    "all scm-version methods start with this prefix"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1589
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1590
    ^ 'version_'
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1591
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1592
    "Created: / 29-09-2011 / 13:26:29 / cg"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1593
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1594
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1595
revisionAfter:aRevisionString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1596
    "generate the next revision number after the given number"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1597
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1598
    |idx|
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1599
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1600
    idx := aRevisionString lastIndexOf:$..
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1601
    idx == 0 ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1602
        ^ ((Integer readFrom:aRevisionString) + 1) printString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1603
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1604
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1605
    ^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1606
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1607
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1608
     SourceCodeManager revisionAfter:'1.2.3.4' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1609
     SourceCodeManager revisionAfter:'123'  
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1610
     SourceCodeManager revisionAfter:'1.24'  
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1611
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1612
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1613
    "Created: 20.11.1995 / 12:54:05 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1614
    "Modified: 12.9.1996 / 02:33:03 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1615
!
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1616
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1617
settingsApplicationClass
2350
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  1618
    "link to my settings application (needed for the settings dialog"
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  1619
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1620
    self subclassResponsibility
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1621
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1622
    "Created: / 19-04-2011 / 12:43:54 / cg"
2350
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  1623
    "Modified: / 19-04-2011 / 13:52:45 / cg"
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1624
!
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1625
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1626
sourceCodeManagerForPackage:aPackageID
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1627
    |module mgr|
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1628
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1629
    aPackageID notNil ifTrue:[
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1630
        "/ see if there is a package-specific manager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1631
        (mgr := self managerForModule:aPackageID) notNil ifTrue:[^ mgr].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1632
2445
vrany
parents: 2443
diff changeset
  1633
       "/ more or less obsolete now - I know which manager is to be used per package
vrany
parents: 2443
diff changeset
  1634
"/        self availableManagers do:[:mgr |
vrany
parents: 2443
diff changeset
  1635
"/            (mgr isResponsibleForPackage:aPackageID) ifTrue:[^ mgr ].
vrany
parents: 2443
diff changeset
  1636
"/        ].
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1637
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1638
        "/ old stuff: see if there is a module-specific manager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1639
        module := aPackageID upTo:$:.
2225
fm
parents: 2224
diff changeset
  1640
        self availableManagers do:[:mgr |
fm
parents: 2224
diff changeset
  1641
            (mgr isResponsibleForModule:module) ifTrue:[^ mgr ].
fm
parents: 2224
diff changeset
  1642
        ]
fm
parents: 2224
diff changeset
  1643
    ].
fm
parents: 2224
diff changeset
  1644
    ^ Smalltalk at:#SourceCodeManager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1645
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1646
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1647
     self sourceCodeManagerForPackage:'stx:libbasic'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1648
     self sourceCodeManagerForPackage:'stx:libboss'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1649
     self managerForMatchingModule:'stx:libba*' put:SVNSourceCodeManager.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1650
     self sourceCodeManagerForPackage:'stx:libbasic'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1651
     self sourceCodeManagerForPackage:'stx:libboss'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1652
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1653
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1654
    "Modified: / 18-04-2011 / 19:53:03 / cg"
2445
vrany
parents: 2443
diff changeset
  1655
    "Modified: / 09-07-2011 / 12:25:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2225
fm
parents: 2224
diff changeset
  1656
!
fm
parents: 2224
diff changeset
  1657
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1658
supportsCheckinLogMessages
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1659
    "true, if log-messages are supported"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1660
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1661
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1662
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1663
    "Created: / 21-12-2011 / 18:02:34 / cg"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1664
!
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1665
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1666
versionMethodKeyword
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1667
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1668
    "Answers the keyword used by the version management system to
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1669
     expand a current version in a file (_without_ dollars). For
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1670
     CVS it is 'Header', for SVN 'Id', others may use different
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1671
     keywords. If nil is returned, then the version management does
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1672
     not use any keyword."
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1673
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1674
    "/TODO: Now, 'Header' is returned for backward compatibility. In future
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1675
    "/it should be changed to self subclassResponsibility
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1676
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1677
    ^'Header'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1678
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1679
    "Created: / 27-09-2011 / 14:52:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1680
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1681
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1682
versionMethodTemplateForJavaScript
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1683
    ^ self versionMethodTemplateForJavaScriptFor:(self nameOfVersionMethodInClasses)
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1684
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1685
    "
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1686
     CVSSourceCodeManager versionMethodTemplateForJavaScript
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1687
    "
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1688
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1689
    "Created: / 19-08-2011 / 01:20:28 / cg"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1690
!
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1691
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1692
versionMethodTemplateForJavaScriptFor:aSelector
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1693
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1694
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1695
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1696
    ^
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1697
'function ',aSelector,'() {
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1698
    return "$' , 'Header' , '$"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1699
}'
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1700
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1701
    "Created: / 19-08-2011 / 01:20:56 / cg"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1702
!
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1703
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1704
versionMethodTemplateForRuby
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1705
    ^ self versionMethodTemplateForRubyFor:(self nameOfVersionMethodInClasses)
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1706
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1707
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1708
     CVSSourceCodeManager versionMethodTemplateForRuby
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1709
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1710
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1711
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1712
versionMethodTemplateForRubyFor:aSelector
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1713
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1714
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1715
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1716
    ^
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1717
'def self.',aSelector,'()
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1718
    return "$' , self versionMethodKeyword , '$"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1719
end'
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1720
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1721
    "Modified (comment): / 19-08-2011 / 01:19:40 / cg"
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1722
    "Modified: / 27-09-2011 / 16:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1723
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1724
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1725
versionMethodTemplateForSmalltalk
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1726
    ^ self versionMethodTemplateForSmalltalkFor:(self nameOfVersionMethodInClasses)
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1727
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1728
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1729
     CVSSourceCodeManager versionMethodTemplateForSmalltalk
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1730
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1731
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1732
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1733
versionMethodTemplateForSmalltalkFor:aSelector
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1734
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1735
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1736
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1737
    ^
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1738
aSelector,'
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1739
    ^ ''$', self versionMethodKeyword , '$''
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1740
'
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1741
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1742
    "Modified (comment): / 19-08-2011 / 01:19:08 / cg"
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1743
    "Modified: / 27-09-2011 / 16:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1744
! !
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1745
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1746
!AbstractSourceCodeManager class methodsFor:'source code access'!
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1747
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1748
basicCheckinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1749
    "low level checkin of a class into the source repository. Does not deal with anz version method updates,
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1750
     only does the checkin, using a temporary file.
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1751
     Return true if ok, false if not."
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1752
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1753
    |tempDir tempFile ok packageMode filter|
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1754
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1755
    packageMode := self checkMethodPackagesOf:aClass.
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1756
    packageMode == #base ifTrue:[
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1757
        filter := [:mthd | mthd package = aClass package].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1758
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1759
1804
73731c3a5fb4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1786
diff changeset
  1760
    tempDir := Filename newTemporaryDirectory.
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1761
    ok := false.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1762
    [
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1763
        |aStream|
75
ea3dcbdb0401 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
  1764
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1765
        tempFile := tempDir construct:classFileName.
1213
7dae237b6ee8 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 1206
diff changeset
  1766
        [
7dae237b6ee8 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 1206
diff changeset
  1767
            aStream := tempFile writeStream.
7dae237b6ee8 Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 1206
diff changeset
  1768
        ] on:FileStream openErrorSignal do:[:ex|
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1769
            self reportError:('temporary fileout failed').
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1770
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1771
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1772
184
e682441f91cb flush methods fileCache before filingOut
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
  1773
        Method flushSourceStreamCache.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1774
        Class fileOutErrorSignal handle:[:ex |
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1775
            aStream close.
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1776
            self reportError:('fileout failed (',ex description,')').
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1777
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1778
        ] do:[
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1779
            self 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1780
                fileOutSourceCodeOf:aClass 
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1781
                on:aStream 
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1782
                withTimeStamp:false 
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1783
                withInitialize:true 
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1784
                withDefinition:true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1785
                methodFilter:filter.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1786
        ].
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1787
        aStream close.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1788
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1789
        tempFile exists ifFalse:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1790
            self reportError:'temporary fileout failed'.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1791
            ^ false.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1792
        ].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1793
        ok := self 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1794
            checkinClass:aClass
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1795
            fileName:classFileName 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1796
            directory:packageDir 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1797
            module:moduleDir
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1798
            source:(tempFile name)
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1799
            logMessage:logMessage
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1800
            force:force.
1141
9f0bd4f3d482 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1125
diff changeset
  1801
    ] ensure:[
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  1802
        tempDir recursiveRemove
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1803
    ].
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1804
    ^ ok
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1805
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1806
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1807
     SourceCodeManager checkinClass:Array
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1808
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1809
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1810
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1811
    "Modified: / 20-08-2011 / 14:52:01 / cg"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1812
    "Created: / 21-12-2011 / 19:30:06 / cg"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1813
!
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1814
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1815
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1816
    "checkin of a class into the source repository.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1817
     Return true if ok, false if not."
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1818
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1819
    ^ self
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1820
        checkinClass:aClass 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1821
        fileName:classFileName 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1822
        directory:packageDir 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1823
        module:moduleDir 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1824
        logMessage:logMessage
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1825
        force:false
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1826
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1827
    "Modified: 11.9.1996 / 16:15:43 / cg"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1828
!
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1829
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1830
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1831
    "checkin of a class into the source repository.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1832
     Return true if ok, false if not."
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1833
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1834
    |className answer allLabel allValue 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1835
     nameOfVersionMethodInClasses|
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1836
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1837
    className := aClass name.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1838
    nameOfVersionMethodInClasses := self nameOfVersionMethodInClasses.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1839
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1840
    aClass revision isNil ifTrue:[ 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1841
        force ifFalse:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1842
            ('CVSSourceCodeManager [warning]: class ' , className, ' has no revision string') errorPrintCR.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1843
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1844
            AbortAllOperationWantedQuery query ifTrue:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1845
                allLabel := #('Cancel All').
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1846
                allValue := #(cancelAll).
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1847
            ] ifFalse:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1848
                allLabel := #().
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1849
                allValue := #().
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1850
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1851
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1852
            ((aClass theMetaclass includesSelector:#version)
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1853
               or:[aClass theMetaclass includesSelector: nameOfVersionMethodInClasses]) ifTrue:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1854
                answer := OptionBox 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1855
                            request:('Class %1 has no (usable) revision string.\\Check in as newest ?' bindWith:className allBold) withCRs
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1856
                            label:'Confirm'
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1857
                            buttonLabels:(allLabel , #('Cancel' 'CheckIn')) 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1858
                            values:(allValue , #(false #checkIn))
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1859
                            default:#checkIn.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1860
            ] ifFalse:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1861
                answer := OptionBox 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1862
                            request:('Class %1 has no revision string.\\Check in as newest ?' bindWith:className allBold) withCRs
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1863
                            label:'Confirm'
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1864
                            buttonLabels:(allLabel , #('Cancel' 'CheckIn' 'Create & CheckIn')) 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1865
                            values:(allValue , #(false #checkIn #create))
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1866
                            default:#create.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1867
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1868
            answer == false ifTrue:[ AbortSignal raise. ^ false ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1869
            answer == #cancelAll ifTrue:[ AbortAllSignal raise. ^ false ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1870
            answer == #create ifTrue:[ 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1871
                self updateVersionMethodOf:aClass for:'$' , 'Header' , '$'.  "/ concatenated to avoid RCS expansion
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1872
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1873
        ]
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1874
    ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1875
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1876
    "Ensure that the method #version_XXX is present before checking in XXX. 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1877
     It will be missing when checking in classes with only the old method #version"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1878
"/ this is wrong - it would add the SVN-id as CVS id...
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1879
"/    (aClass theMetaclass includesSelector: nameOfVersionMethodInClasses) ifFalse: [
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1880
"/        versionAsKnownBefore := aClass revisionString.   "/ looks in the old version (non-repository based)
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1881
"/
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1882
"/        self 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1883
"/            compileVersionMethod:nameOfVersionMethodInClasses 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1884
"/            of:aClass 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1885
"/            for:(versionAsKnownBefore ? ('$' , 'Header' , '$')).  "/ concatenated to avoid RCS expansion
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1886
"/    ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1887
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1888
    ^ self basicCheckinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1889
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1890
    "
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1891
     SourceCodeManager checkinClass:Array
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1892
    "
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1893
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1894
    "Created: / 11-09-1996 / 16:15:17 / cg"
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1895
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  1896
    "Modified: / 21-12-2011 / 19:30:38 / cg"
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1897
!
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1898
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1899
checkinClass:aClass logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1900
    "checkin of a class into the source repository.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1901
     Return true if ok, false if not."
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1902
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1903
    |sourceInfo packageDir moduleDir classFileName|
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1904
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1905
    sourceInfo := self sourceInfoOfClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1906
    sourceInfo isNil ifTrue:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1907
        self reportError:('no sourceInfo for class: ' , aClass name).
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1908
        ^ false
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1909
    ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1910
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1911
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1912
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1913
    classFileName := self containerFromSourceInfo:sourceInfo.
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1914
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1915
    ^ self 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1916
        checkinClass:aClass 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1917
        fileName:classFileName 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1918
        directory:packageDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1919
        module:moduleDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1920
        logMessage:logMessage
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1921
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1922
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1923
    "
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1924
     SourceCodeManager checkinClass:Array logMessage:'foo'
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1925
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1926
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1927
    "Created: / 06-11-1995 / 18:56:00 / cg"
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1928
    "Modified: / 29-08-2006 / 12:46:28 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1929
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1930
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1931
getFile:fileName revision:revision directory:packageDir module:moduleDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1932
    |s contents|
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1933
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1934
    s := self 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1935
            streamForFile:fileName 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1936
            revision:revision 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1937
            directory:packageDir
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1938
            module:moduleDir.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1939
    s isNil ifTrue:[^ nil].
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1940
    contents := s contentsOfEntireFile.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1941
    s close.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1942
    ^ contents
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1943
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1944
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1945
     SourceCodeManager 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1946
        getFile:'Make.spec' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1947
        revision:#newest 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1948
        directory:'libbasic2' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1949
        module:'stx'
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1950
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1951
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1952
    "Created: / 29-08-2006 / 15:47:08 / cg"
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1953
!
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  1954
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  1955
getMostRecentSourceStreamForClassNamed:aClassName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1956
    "given a class, return an open stream to its most recent source
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1957
     (not knowing anything about its version).
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1958
     Used when autoloading classes."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1959
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1960
    ^ self
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1961
        getMostRecentSourceStreamForClassNamed:aClassName 
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1962
        inPackage:nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1963
!
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1964
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1965
getMostRecentSourceStreamForClassNamed:aClassName inPackage:forcedPackage
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1966
    "given a class, return an open stream to its most recent source
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1967
     (not knowing anything about its version).
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1968
     Used when autoloading classes or to compare a classes source with the most
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1969
     recent found in the repostitory.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1970
     The forcePackage argument passes the classes package information
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1971
     and is only required when autoloading or when the class is not already
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1972
     present (i.e. there is no way to extract the package info).
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1973
     If nil, the package is extracted from the class - which must exist."
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1974
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  1975
    |cls sourceInfo classFileName packageDir moduleDir s components i|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1976
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1977
    cls := Smalltalk classNamed:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1978
    cls notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1979
        sourceInfo := self sourceInfoOfClass:cls.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1980
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1981
    sourceInfo notNil ifTrue:[
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1982
        packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1983
        moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1984
        classFileName := self containerFromSourceInfo:sourceInfo.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1985
    ] ifFalse:[
1838
91828978bae1 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1837
diff changeset
  1986
        classFileName := (Smalltalk fileNameForClass:aClassName), '.st'.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  1987
        packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1988
        packageDir notNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1989
            (packageDir startsWith:'stx/') ifTrue:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1990
                "this is a backward compatibility leftover - will vanish"
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1991
                packageDir := packageDir copyFrom:5.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1992
            ] ifFalse:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1993
                i := packageDir indexOf:$:.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1994
                i ~~ 0 ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1995
                    moduleDir := packageDir copyTo:i-1.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1996
                    packageDir := packageDir copyFrom:i+1
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1997
                ]
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  1998
            ]
744
eaf185681d85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  1999
        ].
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2000
        moduleDir isNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2001
            moduleDir := 'stx'
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2002
        ].
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2003
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2004
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2005
    packageDir isNil ifTrue:[
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2006
        forcedPackage isNil ifTrue:[
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2007
            'SourceCodeManager [warning]: could not extract packageDir' errorPrintCR.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2008
            ^ nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2009
        ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2010
        moduleDir := forcedPackage asPackageId module.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2011
        packageDir := forcedPackage asPackageId directory.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2012
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2013
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2014
    s := self 
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2015
        streamForClass:nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2016
        fileName:classFileName 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2017
        revision:#newest 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2018
        directory:packageDir 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2019
        module:moduleDir
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2020
        cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2021
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2022
    s isNil ifTrue:[
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2023
        "/ guessed moduleDir ?
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2024
        
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2025
        sourceInfo isNil ifTrue:[
1417
2707849f626a No need to use Filename>>#concreteClass
Stefan Vogel <sv@exept.de>
parents: 1392
diff changeset
  2026
            components := Filename components:packageDir.
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2027
            moduleDir := components first.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2028
            packageDir := (Filename fromComponents:(components copyFrom:2)) asString.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2029
            s := self 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2030
                streamForClass:nil
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2031
                fileName:classFileName 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2032
                revision:#newest 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2033
                directory:packageDir 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2034
                module:moduleDir
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2035
                cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2036
        ]
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2037
    ].
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2038
    ^ s.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2039
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2040
    "Created: / 12-10-1996 / 17:22:54 / cg"
1838
91828978bae1 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1837
diff changeset
  2041
    "Modified: / 06-10-2006 / 16:17:33 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2042
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2043
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2044
getMostRecentSourceStreamForFile:aFileName inPackage:aPackage
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2045
    "given a filename, return an open stream to its most recent contents
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2046
     (not knowing anything about its version).
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2047
     Used when autoloading extensions or to compare a classes source with the most
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2048
     recent found in the repostitory."
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2049
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2050
    |directory module|
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2051
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2052
    module := aPackage asPackageId module.
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2053
    directory := aPackage asPackageId directory.
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2054
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2055
    ^ self 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2056
        streamForFile:aFileName 
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2057
        revision:#newest 
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2058
        directory:directory 
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2059
        module:module.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2060
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2061
    "Created: / 12-10-1996 / 17:22:54 / cg"
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2062
    "Modified: / 29-08-2006 / 15:49:02 / cg"
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2063
!
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2064
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2065
getSourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2066
    "extract a classes source code and return an open readStream on it.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2067
     The classes source code is extracted using the revision and the sourceCodeInfo,
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2068
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2069
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2070
    ^ self getSourceStreamFor:aClass revision:nil
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2071
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2072
    "Created: 12.10.1996 / 17:21:03 / cg"
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2073
    "Modified: 12.10.1996 / 17:22:02 / cg"
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2074
!
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2075
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2076
getSourceStreamFor:aClass revision:aRevisionStringOrNil
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2077
    "extract a classes source code and return an open readStream on it.
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2078
     A revision of nil selects the current (in image) revision.
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2079
     The classes source code is extracted using the revision and the sourceCodeInfo,
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2080
     which itself is extracted from the classes packageString."
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2081
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2082
    |classFileName binaryRevision revision revisionUsed
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2083
     packageDir moduleDir sourceInfo revForMeOrNil|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2084
943
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2085
    aRevisionStringOrNil == #newest ifTrue:[
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2086
        ^ self getMostRecentSourceStreamForClassNamed:(aClass theNonMetaclass name).
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2087
    ].
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2088
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2089
    (revisionUsed := aRevisionStringOrNil) isNil ifTrue:[
2510
45b4c466a799 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2505
diff changeset
  2090
        revision := aClass revisionOfManager:self.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2091
        binaryRevision := aClass binaryRevision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2092
        binaryRevision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2093
            revision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2094
                ('SourceCodeManager [warning]: class "%1" has no revision string' bindWith:aClass name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2095
                ^ nil.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2096
            ].
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2097
            revisionUsed := revision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2098
        ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2099
            "/ see if this is a versionString for me (i.e. if I can extract my version string from it)
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2100
            revForMeOrNil := self revisionInfoFromString:aClass binaryRevisionString.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2101
            revForMeOrNil isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2102
                revision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2103
                    ('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - cannot extract version' 
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2104
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2105
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2106
                        with:self name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2107
                ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2108
                    ('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - trusting revision %2' 
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2109
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2110
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2111
                        with:self name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2112
                ].
2546
be9e1b778210 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  2113
                ^ nil
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2114
            ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2115
                revision ~= binaryRevision ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2116
                    ('SourceCodeManager [info]: "%1" has %4-revision (%2) vs. binary revision (%3) - trusting binaryRevision' 
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2117
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2118
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2119
                        with:self name) infoPrintCR.
2547
ccb236fb305e changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  2120
                    "/ self halt.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2121
                ].
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2122
                revisionUsed := binaryRevision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2123
            ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2124
        ]
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2125
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2126
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2127
    sourceInfo := self sourceInfoOfClass:aClass.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
  2128
    sourceInfo isNil ifTrue:[
2238
76eca50b4734 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2232
diff changeset
  2129
       ('SourceCodeManager [warning]: no sourceInfo for class "%1"' bindWith:aClass name) infoPrintCR.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
  2130
        ^ nil
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
  2131
    ].
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2132
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2133
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2134
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2135
    classFileName := self containerFromSourceInfo:sourceInfo.
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2136
    ^ self 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2137
        streamForClass:aClass
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2138
        fileName:classFileName 
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2139
        revision:revisionUsed 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2140
        directory:packageDir 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2141
        module:moduleDir
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2142
        cache:true
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
  2143
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2144
    "Created: / 12-10-1996 / 17:21:52 / cg"
2547
ccb236fb305e changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  2145
    "Modified: / 29-09-2011 / 22:02:55 / cg"
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2146
!
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2147
2225
fm
parents: 2224
diff changeset
  2148
loadPackageWithId: aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded
fm
parents: 2224
diff changeset
  2149
2226
eab85424d4ff changed: #loadPackageWithId:fromRepositoryAsAutoloaded:
fm
parents: 2225
diff changeset
  2150
    "Should be redefined by sub classes.
eab85424d4ff changed: #loadPackageWithId:fromRepositoryAsAutoloaded:
fm
parents: 2225
diff changeset
  2151
     Return true if loaded, false otherwise."
eab85424d4ff changed: #loadPackageWithId:fromRepositoryAsAutoloaded:
fm
parents: 2225
diff changeset
  2152
eab85424d4ff changed: #loadPackageWithId:fromRepositoryAsAutoloaded:
fm
parents: 2225
diff changeset
  2153
    ^ false
2225
fm
parents: 2224
diff changeset
  2154
!
fm
parents: 2224
diff changeset
  2155
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2156
streamForFile:fileName revision:revision directory:packageDir module:moduleDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2157
    ^ self
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2158
        streamForClass:nil
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2159
        fileName:fileName 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2160
        revision:revision 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2161
        directory:packageDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2162
        module:moduleDir
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2163
        cache:true
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2164
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2165
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2166
     SourceCodeManager 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2167
        streamForFile:'Make.spec' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2168
        revision:#newest 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2169
        directory:'libbasic2' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2170
        module:'stx'
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2171
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2172
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2173
    "Created: / 29-08-2006 / 15:41:43 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2174
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2175
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  2176
!AbstractSourceCodeManager class methodsFor:'source code administration'!
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
  2177
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2178
ensureDollarsInVersionMethod:aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2179
    "given the source code of my version method, ensure that it contains dollars for
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2180
     proper keyword expansion"
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2181
2191
fm
parents: 2183
diff changeset
  2182
    |versionString|
fm
parents: 2183
diff changeset
  2183
fm
parents: 2183
diff changeset
  2184
    versionString := aString copyWithout: $§.
fm
parents: 2183
diff changeset
  2185
    ^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString.
fm
parents: 2183
diff changeset
  2186
fm
parents: 2183
diff changeset
  2187
    "
fm
parents: 2183
diff changeset
  2188
     self ensureDollarsInVersionMethod:'foo ^ ''hello'' ' 
fm
parents: 2183
diff changeset
  2189
     self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' ' 
fm
parents: 2183
diff changeset
  2190
     self ensureDollarsInVersionMethod:'foo ^ ''   hello   '' '    
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2191
     self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '      
2191
fm
parents: 2183
diff changeset
  2192
    -- errors:
fm
parents: 2183
diff changeset
  2193
     self ensureDollarsInVersionMethod:'foo ^ ''$Head'' '    
fm
parents: 2183
diff changeset
  2194
     self ensureDollarsInVersionMethod:'foo ^ ''Header$'' '    
fm
parents: 2183
diff changeset
  2195
    "
fm
parents: 2183
diff changeset
  2196
!
fm
parents: 2183
diff changeset
  2197
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2198
ensureKeyword: keyword inVersionMethod: source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2199
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2200
    | startQuote endQuote doubleColon |
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2201
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2202
    "/nil keyword means that given source code management system
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2203
    "/does not expand keywords (StORE or Monticello, for example)
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2204
    keyword isNil ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2205
        ^source.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2206
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2207
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2208
    startQuote := source indexOf: $'.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2209
    startQuote == 0 ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2210
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2211
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2212
    (source at: startQuote + 1) == $$ ifFalse:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2213
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2214
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2215
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2216
    endQuote := source lastIndexOf: $'.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2217
    startQuote == endQuote ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2218
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2219
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2220
    (source at: endQuote - 1) == $$ ifFalse:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2221
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2222
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2223
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2224
    doubleColon := source indexOf: $: startingAt: startQuote + 2.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2225
    "/There may be no double colon at all, if the version method
2742
bb8d754b8edb changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
  2226
    "/is fresh, like '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.284 2012-01-20 15:48:33 cg Exp $'
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2227
    (doubleColon == 0 or:[doubleColon > endQuote]) ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2228
        doubleColon := endQuote - 1.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2229
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2230
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2231
    (source copyFrom: startQuote + 2 to: doubleColon - 1) = keyword ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2232
        "/ Good, desired keyword is already there
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2233
        ^source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2234
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2235
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2236
    ^(source copyTo: startQuote + 1) , keyword , (source copyFrom: doubleColon)
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2237
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2238
    "Created: / 27-09-2011 / 15:00:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2239
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2240
2191
fm
parents: 2183
diff changeset
  2241
ensureKeywordExpansionWith: aCharacter inVersionMethod:aString
fm
parents: 2183
diff changeset
  2242
    "given the source code of my version method, ensure that it contains aCharacter for
fm
parents: 2183
diff changeset
  2243
     proper keyword expansion"
fm
parents: 2183
diff changeset
  2244
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2245
    |indexOfFirstQuote indexOfNextAfterFirstQuote indexOfSecondDollar indexOfNextAfterSecondDollar indexOfLastQuote|
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2246
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2247
    indexOfFirstQuote := aString indexOf:$'.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2248
    indexOfFirstQuote == 0 ifTrue:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2249
        "/ no ' found - mhmh is this a valid version method's source ?
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2250
        ^ aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2251
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2252
    indexOfNextAfterFirstQuote := aString indexOfNonSeparatorStartingAt:indexOfFirstQuote+1.
2191
fm
parents: 2183
diff changeset
  2253
    (aString at:indexOfNextAfterFirstQuote) = aCharacter ifTrue:[
fm
parents: 2183
diff changeset
  2254
        indexOfSecondDollar := aString indexOf:aCharacter startingAt:indexOfNextAfterFirstQuote+1.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2255
        ((indexOfSecondDollar == 0) 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2256
        or:[ indexOfNextAfterSecondDollar := aString indexOfNonSeparatorStartingAt:indexOfSecondDollar+1.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2257
             (aString at:indexOfNextAfterSecondDollar) ~= $' 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2258
        ]) ifTrue:[ 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2259
            self error:'invalid source (no valid version method string)' 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2260
        ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2261
        "/ fine
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2262
        ^ aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2263
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2264
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2265
    indexOfLastQuote := aString lastIndexOf:$'.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2266
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2267
    ^ (aString copyTo:indexOfFirstQuote)
2191
fm
parents: 2183
diff changeset
  2268
        , aCharacter asString
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2269
        ,(aString copyFrom:indexOfFirstQuote+1 to:indexOfLastQuote-1)
2191
fm
parents: 2183
diff changeset
  2270
        ,aCharacter asString ,(aString copyFrom:indexOfLastQuote)
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2271
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2272
    "
2191
fm
parents: 2183
diff changeset
  2273
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '  
fm
parents: 2183
diff changeset
  2274
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''   hello   '' '
fm
parents: 2183
diff changeset
  2275
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '    
fm
parents: 2183
diff changeset
  2276
fm
parents: 2183
diff changeset
  2277
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' '  
fm
parents: 2183
diff changeset
  2278
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''   hello   '' '
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2279
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '    
2191
fm
parents: 2183
diff changeset
  2280
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2281
    -- errors:
2191
fm
parents: 2183
diff changeset
  2282
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '  
fm
parents: 2183
diff changeset
  2283
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '   
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2284
    "
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2285
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2286
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2287
ensureKeywordInVersionMethod: source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2288
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2289
    ^self ensureKeyword: self versionMethodKeyword inVersionMethod: source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2290
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2291
    "Created: / 27-09-2011 / 14:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2292
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2293
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2294
ensureNoDollarsInVersionMethod:aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2295
    "given the source code of another manager's version method, ensure that it does NOT
2191
fm
parents: 2183
diff changeset
  2296
     contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
fm
parents: 2183
diff changeset
  2297
fm
parents: 2183
diff changeset
  2298
    |versionString|
fm
parents: 2183
diff changeset
  2299
fm
parents: 2183
diff changeset
  2300
    versionString := aString copyWithout: $$.
fm
parents: 2183
diff changeset
  2301
    ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2302
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2303
    "
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2304
        self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '           
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2305
        self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' '                
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2306
        self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' '             
2191
fm
parents: 2183
diff changeset
  2307
        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '    
fm
parents: 2183
diff changeset
  2308
fm
parents: 2183
diff changeset
  2309
      -- errors:
fm
parents: 2183
diff changeset
  2310
fm
parents: 2183
diff changeset
  2311
        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '   
fm
parents: 2183
diff changeset
  2312
        self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '             
fm
parents: 2183
diff changeset
  2313
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2314
    "
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2315
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2316
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2317
fileOutSourceCodeOf:aClass on:aStream
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2318
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2319
    self withSourceRewriteHandlerDo:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2320
        aClass fileOutOn:aStream withTimeStamp:false.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2321
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2322
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2323
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2324
fileOutSourceCodeOf:aClass on:aStream 
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2325
      withTimeStamp:withTimeStamp withInitialize:withInitialize withDefinition:withDefinition
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2326
      methodFilter:methodFilter
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2327
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2328
    self withSourceRewriteHandlerDo:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2329
        aClass fileOutOn:aStream 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2330
               withTimeStamp:withTimeStamp 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2331
               withInitialize:withInitialize 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2332
               withDefinition:withDefinition
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2333
               methodFilter:methodFilter
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2334
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2335
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2336
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2337
getExistingContainersInModule:aModule directory:aPackage
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2338
    "{ Pragma: +optSpace }"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2339
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2340
    "return a collection containing the names of existing containers"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2341
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2342
    ^ self subclassResponsibility
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2343
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2344
    "Created: / 23-08-2006 / 14:12:07 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2345
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2346
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2347
getExistingDirectoriesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2348
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2349
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2350
    "return a collection containing the names of existing packages"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2351
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2352
    ^ self subclassResponsibility
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2353
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2354
    "Created: / 23-08-2006 / 14:13:52 / cg"
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2355
!
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2356
676
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2357
getExistingModules
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2358
    "{ Pragma: +optSpace }"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2359
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2360
    "return a collection containing the names of existing modules"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2361
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2362
    ^ self subclassResponsibility
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2363
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2364
    "Modified: / 29.1.1997 / 18:57:29 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2365
    "Created: / 20.5.1998 / 19:38:23 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2366
!
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2367
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2368
initialRCSRevisionStringFor:aClass in:dir container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2369
    "return a string usable as initial revision string"
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2370
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2371
    "/ do not make the string below into one string;
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2372
    "/ RCS would expand it into a wrong rev-string
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2373
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2374
    |nm oldRev idx special|
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2375
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2376
    nm := fileName.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2377
    (nm endsWith:',v') ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2378
        nm := nm copyWithoutLast:2
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2379
    ].
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2380
    (nm endsWith:'.st') ifFalse:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2381
        nm := nm , '.st'
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2382
    ].
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2383
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2384
    oldRev := aClass revisionString.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2385
    special := ''.
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2386
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2387
    oldRev notNil ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2388
        idx := oldRev lastIndexOf:$[.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2389
        idx ~~ 0 ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2390
            idx := oldRev indexOf:$[ startingAt:idx+1.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2391
            idx ~~ 0 ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2392
                special := ' ' , (oldRev copyFrom:idx).
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2393
            ]
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2394
        ]
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2395
    ].
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2396
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2397
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2398
    ^ '$' , 'Header: ' , dir , '/' , fileName , ',v $'
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2399
      , special
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2400
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2401
    "Modified: 17.9.1996 / 15:57:15 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2402
    "Created: 14.2.1997 / 20:59:28 / cg"
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2403
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2404
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2405
knownTagsAndRevisionsFor:aClass
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2406
    "retrieve a list of symbolic tags -> versionNr associations
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2407
     known for that class.
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2408
     I.e. which tags/symbolic versions exist, and which revision-nr is attached to it"
2319
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2409
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2410
    |log|
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2411
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2412
    log := aClass sourceCodeManager revisionLogOf:aClass fromRevision:nil toRevision:nil finishAfter:20.
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2413
    log isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2414
        SourceCodeManagerError 
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2415
            raiseRequestWith:aClass
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2416
            errorString: 'Could not fetch log (cvs connection error?)'.
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2417
        ^ #()
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2418
    ].
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2419
    ^ (log at:#symbolicNames).
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2420
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2421
    "Created: / 08-02-2011 / 10:18:00 / cg"
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2422
!
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2423
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2424
knownTagsFor:aClass
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2425
    "retrieve a list of symbolic tags known for that class.
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2426
     I.e. which tags/symbolic versions exist"
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2427
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2428
    |tagRevisionMapping|
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2429
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2430
    tagRevisionMapping := self knownTagsAndRevisionsFor:aClass.
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2431
    tagRevisionMapping isEmptyOrNil ifTrue:[^ tagRevisionMapping].
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2432
    ^ tagRevisionMapping keys
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2433
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2434
    "Modified: / 08-02-2011 / 10:18:34 / cg"
2319
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2435
!
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2436
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2437
newestRevisionInFile:classFileName directory:packageDir module:moduleDir
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2438
    "return the newest revision found in a container.
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2439
     Return nil on failure."
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2440
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2441
    |log|
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2442
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2443
    log := self
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2444
            revisionLogOf:nil 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2445
            fromRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2446
            toRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2447
            fileName:classFileName 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2448
            directory:packageDir 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2449
            module:moduleDir.
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2450
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2451
    log isNil ifTrue:[^ nil].
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2452
    ^ log at:#newestRevision ifAbsent:nil
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2453
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2454
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2455
     SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx'       
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2456
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2457
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2458
    "Modified: 10.1.1997 / 13:31:42 / cg"
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2459
!
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2460
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2461
newestRevisionLogEntryOf:aClass
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2462
    "return the newest revisions log found in the repository.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2463
     Return nil on failure."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2464
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2465
    ^ self revisionLogOf:aClass fromRevision:0 toRevision:0.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2466
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2467
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2468
     SourceCodeManager newestRevisionLogEntryOf:Array       
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2469
     SourceCodeManager newestRevisionLogEntryOf:Connection 
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2470
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2471
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2472
    "Modified: 10.1.1997 / 13:30:36 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2473
    "Created: 29.1.1997 / 18:50:12 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2474
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2475
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2476
newestRevisionOf:aClass
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2477
    "return the newest revision (as string) found in the repository.
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2478
     Return nil on failure."
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2479
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  2480
    |sourceInfo packageDir moduleDir classFileName|
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2481
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2482
    sourceInfo := self sourceInfoOfClass:aClass.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2483
    sourceInfo isNil ifTrue:[^ nil].
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2484
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2485
    packageDir := self directoryFromSourceInfo:sourceInfo.
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  2486
    packageDir isNil ifTrue:[^ nil].
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2487
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2488
    classFileName := self containerFromSourceInfo:sourceInfo.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2489
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2490
    ^ self newestRevisionInFile:classFileName directory:packageDir module:moduleDir
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2491
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2492
"/    |log|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2493
"/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2494
"/    log := self revisionLogOf:aClass fromRevision:0 toRevision:0.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2495
"/    log isNil ifTrue:[^ nil].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2496
"/    ^ log at:#newestRevision ifAbsent:nil
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2497
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2498
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2499
     SourceCodeManager newestRevisionOf:Array       
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2500
     SourceCodeManager newestRevisionOf:Connection 
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2501
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2502
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  2503
    "Modified: / 20-08-2011 / 14:56:04 / cg"
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2504
!
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2505
2683
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2506
removeContainer: container inModule: module directory: directory
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2507
    "remove a container"
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2508
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2509
    ^ self subclassResponsibility
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2510
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2511
    "Modified (comment): / 23-12-2011 / 19:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2512
!
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2513
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2514
revisionInfoFromRCSString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2515
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2516
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2517
    "return a dictionary filled with revision info.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2518
     This extracts the relevant info from aString."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2519
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  2520
    ^ CVSVersionInfo fromRCSString:aString.
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2521
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2522
    "
968
7fa6a836642b comments
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2523
     SourceCodeManager revisionInfoFromString:'$' , 'Revision: 1.122 $'
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2524
     SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2525
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2526
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  2527
    "Modified: / 22-10-2008 / 20:18:58 / cg"
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2528
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2529
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2530
revisionInfoFromString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2531
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2532
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2533
    "return a dictionary filled with revision info.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2534
     This extracts the relevant info from aString."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2535
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2536
    ^ self subclassResponsibility
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2537
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2538
    "Created: 29.1.1997 / 18:54:52 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2539
    "Modified: 29.1.1997 / 18:57:29 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2540
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2541
2552
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2542
revisionInfoFromString: vsnString inClass: class
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2543
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2544
    ^self revisionInfoFromString: vsnString
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2545
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2546
    "Modified: / 03-10-2011 / 13:05:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2547
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2548
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2549
revisionLogOf:aClass
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2550
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2551
     the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2552
     Return nil on failure.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2553
     The returned information is a structure (IdentityDictionary)
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2554
     filled with:
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2555
            #container          -> the RCS container file name
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2556
            #filename           -> the actual source file name
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2557
            #newestRevision     -> the revisionString of the newest revision
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2558
            #numberOfRevisions  -> the number of revisions in the container
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2559
            #revisions          -> collection of per-revision info
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2560
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2561
            per revision info consists of one record per revision:
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2562
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2563
              #revision              -> the revision string
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2564
              #author                -> who checked that revision into the repository
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2565
              #date                  -> when was it checked in
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2566
              #state                 -> the RCS state
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2567
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2568
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2569
            revisions are ordered newest first 
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2570
            (i.e. the last entry is for the initial revision; the first for the most recent one)
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2571
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2572
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2573
    ^ self
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  2574
        revisionLogOf:aClass fromRevision:nil toRevision:nil
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2575
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2576
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2577
     SourceCodeManager revisionLogOf:Array 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2578
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2579
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2580
    "Created: 25.11.1995 / 11:25:02 / cg"
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2581
    "Modified: 25.11.1995 / 11:56:16 / cg"
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2582
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2583
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2584
revisionLogOf:aClass fromRevision:rev1
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2585
    "return info about the repository container and
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2586
     (part of) the revisionlog as a collection of revision entries.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2587
     Return nil on failure.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2588
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2589
     The returned information is a structure (IdentityDictionary)
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2590
     filled with:
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2591
            #container          -> the RCS container file name 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2592
            #filename           -> the actual source file name
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2593
            #newestRevision     -> the revisionString of the newest revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2594
            #numberOfRevisions  -> the number of revisions in the container
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2595
            #revisions          -> collection of per-revision info (see below)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2596
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2597
         for some classes, additional info is returned:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2598
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2599
            #renamed            -> true if the class has been renamed or copied
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2600
                                   and the sourceInfo is from the previous one
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2601
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2602
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2603
            rev1 specifies from which revisions a logEntry is wanted:
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2604
              If rev1 is nil, the first revision is the initial revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2605
              otherwise, the log starts with that revision.
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2606
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2607
            per revision info consists of one record per revision:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2608
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2609
              #revision              -> the revision string
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2610
              #author                -> who checked that revision into the repository
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2611
              #date                  -> when was it checked in
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2612
              #state                 -> the RCS state
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2613
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2614
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2615
            revisions are ordered newest first 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2616
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2617
                  the first for the most recent one)
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2618
        "
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2619
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2620
    ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2621
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2622
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2623
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40'
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2624
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2625
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2626
    "Created: 6.11.1995 / 18:56:00 / cg"
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2627
    "Modified: 10.1.1997 / 13:29:50 / cg"
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2628
!
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  2629
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2630
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2631
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2632
     (part of) the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2633
     Return nil on failure.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2634
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2635
     The returned information is a structure (IdentityDictionary)
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2636
     filled with:
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2637
            #container          -> the RCS container file name 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2638
            #filename           -> the actual source file name
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2639
            #newestRevision     -> the revisionString of the newest revision
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2640
            #numberOfRevisions  -> the number of revisions in the container
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2641
            #revisions          -> collection of per-revision info (see below)
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2642
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2643
         for some classes, additional info is returned:
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2644
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2645
            #renamed            -> true if the class has been renamed or copied
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2646
                                   and the sourceInfo is from the previous one
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2647
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2648
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2649
            rev1 / rev2 specify from which revisions a logEntry is wanted:
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2650
              If rev1 is nil, the first revision is the initial revision
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2651
              otherwise, the log starts with that revision.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2652
              If rev2 is nil, the last revision is the newest revision
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2653
              otherwise, the log ends with that revision.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2654
              If both are nil, no logEntries are extracted (i.e. only the header).
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2655
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2656
            per revision info consists of one record per revision:
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2657
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2658
              #revision              -> the revision string
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2659
              #author                -> who checked that revision into the repository
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2660
              #date                  -> when was it checked in
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2661
              #state                 -> the RCS state
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2662
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2663
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2664
            revisions are ordered newest first 
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2665
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2666
                  the first for the most recent one)
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2667
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2668
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2669
    ^ self
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2670
        revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2671
        finishAfter:nil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2672
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2673
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2674
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCountOrNil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2675
    "return info about the repository container and
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2676
     (part of) the revisionlog as a collection of revision entries.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2677
     Return nil on failure.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2678
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2679
     The returned information is a structure (IdentityDictionary)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2680
     filled with:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2681
            #container          -> the RCS container file name 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2682
            #filename           -> the actual source file name
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2683
            #newestRevision     -> the revisionString of the newest revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2684
            #numberOfRevisions  -> the number of revisions in the container
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2685
            #revisions          -> collection of per-revision info (see below)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2686
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2687
         for some classes, additional info is returned:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2688
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2689
            #renamed            -> true if the class has been renamed or copied
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2690
                                   and the sourceInfo is from the previous one
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2691
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2692
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2693
            rev1 / rev2 specify from which revisions a logEntry is wanted:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2694
              If rev1 is nil, the first revision is the initial revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2695
              otherwise, the log starts with that revision.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2696
              If rev2 is nil, the last revision is the newest revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2697
              otherwise, the log ends with that revision.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2698
              If both are nil, no logEntries are extracted (i.e. only the header).
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2699
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2700
            per revision info consists of one record per revision:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2701
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2702
              #revision              -> the revision string
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2703
              #author                -> who checked that revision into the repository
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2704
              #date                  -> when was it checked in
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2705
              #state                 -> the RCS state
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2706
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2707
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2708
            revisions are ordered newest first 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2709
            (i.e. the last entry is for the initial revision; 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2710
                  the first for the most recent one)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2711
        "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2712
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  2713
    |sourceInfo packageDir moduleDir classFileName info|
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2714
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2715
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2716
    sourceInfo isNil ifTrue:[^ nil].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2717
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2718
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2719
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2720
    classFileName := self containerFromSourceInfo:sourceInfo.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2721
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2722
    info := self 
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2723
        revisionLogOf:aClass
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2724
        fromRevision:rev1 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2725
        toRevision:rev2
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  2726
        numberOfRevisions:maxCountOrNil
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2727
        fileName:classFileName
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2728
        directory:packageDir 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2729
        module:moduleDir.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2730
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2731
    info notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2732
"/        (sourceInfo includesKey:#renamed) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2733
"/            info at:#renamed put:(sourceInfo at:#renamed)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2734
"/        ].
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2735
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2736
            info at:#expectedFileName put:(sourceInfo at:#expectedFileName)
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2737
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2738
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2739
    ^ info
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2740
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2741
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2742
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' 
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  2743
     SourceCodeManager revisionLogOf:XtBoxNew 
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2744
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2745
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2746
    "Created: / 06-11-1995 / 18:56:00 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2747
    "Modified: / 23-08-2006 / 14:10:50 / cg"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2748
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  2749
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2750
revisionLogOf:aClass numberOfRevisions:numRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2751
    "return info about the repository container and
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2752
     (part of) the revisionlog (numRevisions newest revisions) 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2753
     as a collection of revision entries.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2754
     Return nil on failure.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2755
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2756
     The returned information is a structure (IdentityDictionary)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2757
     filled with:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2758
            #container          -> the RCS container file name 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2759
            #filename           -> the actual source file name
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2760
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  2761
            #numberOfRevisions  -> the number of revisions in the container (nil for all)
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2762
            #revisions          -> collection of per-revision info (see below)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2763
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2764
         for some classes, additional info is returned:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2765
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2766
            #renamed            -> true if the class has been renamed or copied
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2767
                                   and the sourceInfo is from the previous one
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2768
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2769
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2770
            rev1 / rev2 specify from which revisions a logEntry is wanted:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2771
              If rev1 is nil, the first revision is the initial revision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2772
              otherwise, the log starts with that revision.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2773
              If rev2 is nil, the last revision is the newest revision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2774
              otherwise, the log ends with that revision.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2775
              If both are nil, no logEntries are extracted (i.e. only the header).
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2776
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2777
            per revision info consists of one record per revision:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2778
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2779
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2780
              #author                -> who checked that revision into the repository
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2781
              #date                  -> when was it checked in
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2782
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2783
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2784
              #logMessage            -> the checkIn log message
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2785
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2786
            revisions are ordered newest first 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2787
            (i.e. the last entry is for the initial revision; 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2788
                  the first for the most recent one)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2789
        "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2790
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2791
    |sourceInfo packageDir moduleDir classFileName info|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2792
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2793
    sourceInfo := self sourceInfoOfClass:aClass.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2794
    sourceInfo isNil ifTrue:[^ nil].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2795
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2796
    packageDir := self directoryFromSourceInfo:sourceInfo.
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2797
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2798
    classFileName := self containerFromSourceInfo:sourceInfo.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2799
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2800
    info := self 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2801
        revisionLogOf:aClass
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2802
        numberOfRevisions:numRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2803
        fileName:classFileName
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2804
        directory:packageDir 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2805
        module:moduleDir.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2806
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2807
    info notNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2808
"/        (sourceInfo includesKey:#renamed) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2809
"/            info at:#renamed put:(sourceInfo at:#renamed)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2810
"/        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2811
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2812
            info at:#expectedFileName put:(sourceInfo at:#expectedFileName)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2813
        ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2814
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2815
    ^ info
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2816
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2817
    "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2818
     SourceCodeManager revisionLogOf:Array numberOfRevisions:10 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2819
    "
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2820
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2821
    "Modified: / 23-08-2006 / 14:10:52 / cg"
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2822
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  2823
2600
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2824
revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDir module:moduleDir
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2825
    ^ self 
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2826
        revisionLogOf:clsOrNil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2827
        fromRevision:nil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2828
        toRevision:nil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2829
        numberOfRevisions:numRevisions
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2830
        fileName:classFileName
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2831
        directory:packageDir
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2832
        module:moduleDir
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2833
!
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  2834
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2835
revisionLogOfContainer:classFileName directory:packageDir module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2836
    "return info about the repository container and
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2837
     (part of) the revisionlog as a collection of revision entries.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2838
     Return nil on failure.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2839
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2840
     The returned information is a structure (IdentityDictionary)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2841
     filled with:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2842
            #container          -> the RCS container file name 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2843
            #filename           -> the actual source file name
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2844
            #newestRevision     -> the revisionString of the newest revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2845
            #numberOfRevisions  -> the number of revisions in the container
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2846
            #revisions          -> collection of per-revision info (see below)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2847
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2848
            per revision info consists of one record per revision:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2849
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2850
              #revision              -> the revision string
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2851
              #author                -> who checked that revision into the repository
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2852
              #date                  -> when was it checked in
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2853
              #state                 -> the RCS state
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2854
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2855
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2856
            revisions are ordered newest first 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2857
            (i.e. the last entry is for the initial revision; 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2858
                  the first for the most recent one)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2859
        "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2860
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2861
    ^ self
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2862
        revisionLogOf:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2863
        fromRevision:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2864
        toRevision:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2865
        fileName:classFileName 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2866
        directory:packageDir 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2867
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2868
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2869
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2870
     CVSSourceCodeManager
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2871
        revisionLogInFile:'Array.st' directory:'libbasic' module:'stx'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2872
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2873
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2874
    "Modified: 10.1.1997 / 13:29:06 / cg"
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2875
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2876
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2877
revisionLogOfContainer:fileName module:moduleDir directory:packageDir fromRevision:rev1 toRevision:rev2
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2878
    "return info about the repository container and
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2879
     (part of) the revisionlog as a collection of revision entries.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2880
     Return nil on failure.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2881
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2882
     The returned information is a structure (IdentityDictionary)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2883
     filled with:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2884
            #container          -> the RCS container file name 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2885
            #filename           -> the actual source file name
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2886
            #newestRevision     -> the revisionString of the newest revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2887
            #numberOfRevisions  -> the number of revisions in the container
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2888
            #revisions          -> collection of per-revision info (see below)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2889
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2890
         for some classes, additional info is returned:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2891
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2892
            #renamed            -> true if the class has been renamed or copied
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2893
                                   and the sourceInfo is from the previous one
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2894
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2895
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2896
            rev1 / rev2 specify from which revisions a logEntry is wanted:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2897
              If rev1 is nil, the first revision is the initial revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2898
              otherwise, the log starts with that revision.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2899
              If rev2 is nil, the last revision is the newest revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2900
              otherwise, the log ends with that revision.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2901
              If both are nil, no logEntries are extracted (i.e. only the header).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2902
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2903
            per revision info consists of one record per revision:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2904
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2905
              #revision              -> the revision string
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2906
              #author                -> who checked that revision into the repository
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2907
              #date                  -> when was it checked in
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2908
              #state                 -> the RCS state
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2909
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2910
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2911
            revisions are ordered newest first 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2912
            (i.e. the last entry is for the initial revision; 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2913
                  the first for the most recent one)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2914
        "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2915
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2916
    |info|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2917
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2918
    info := self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2919
        revisionLogOf:nil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2920
        fromRevision:rev1 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2921
        toRevision:rev2
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2922
        fileName:fileName
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2923
        directory:packageDir 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2924
        module:moduleDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2925
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2926
    ^ info
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2927
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2928
    "
1980
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2929
     SourceCodeManager 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2930
        revisionLogOfContainer:'Array.st' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2931
        module:'stx' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2932
        directory:'libbasic' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2933
        fromRevision:'1.1' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2934
        toRevision:nil 
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2935
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2936
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2937
    "Created: / 23-08-2006 / 14:14:59 / cg"
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2938
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  2939
213
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2940
revisionsOf:aClass
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2941
    "return a collection of revisions (as strings) found in the repository.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2942
     The most recent (newest) revision will be the first in the list.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2943
     Return nil on failure."
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2944
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2945
    |log revisions|
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2946
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2947
    log := self revisionLogOf:aClass.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2948
    log isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2949
    revisions := log at:#revisions ifAbsent:nil.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2950
    revisions isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2951
    ^ revisions collect:[:rev | rev at:#revision].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2952
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2953
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2954
     SourceCodeManager revisionsOf:Array       
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2955
     SourceCodeManager newestRevisionOf:Array 
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2956
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2957
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2958
    "Modified: 10.4.1996 / 23:14:24 / cg"
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2959
    "Created: 19.4.1996 / 17:24:34 / cg"
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2960
!
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  2961
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2962
withSourceRewriteHandlerDo:aBlock
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2963
    "hook for just-in-time rewriting of a method's sourceCode while filing out
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2964
     used when saving version_XXX methods in a non-XXX sourceCodeManager"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2965
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2966
    AbstractSourceFileWriter methodSourceRewriteQuery handle:[:rewriteQuery |
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2967
        |m newSource |
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2968
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2969
        m := rewriteQuery method.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2970
        m isVersionMethod ifFalse:[                                                            
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2971
            rewriteQuery proceedWith:rewriteQuery source.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2972
        ].
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2973
        (m selector = self nameOfVersionMethodInClasses 
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2974
        or:[m selector = self nameOfVersionMethodForExtensions 
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2975
        or:[m selector = Class nameOfOldVersionMethod]]) ifTrue:[
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2976
            "/ it's my version method - make sure that it has $'s around...
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2977
            newSource := self ensureDollarsInVersionMethod:rewriteQuery source.
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2978
            (m selector = Class nameOfOldVersionMethod) ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2979
                "/ #version method: make sure that it contains proper
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2980
                "/ keyword (Header for CVS/P4, Id for SVN...
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2981
                newSource := self ensureKeywordInVersionMethod: newSource.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2982
            ]
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2983
        ] ifFalse:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2984
            "/ it's another manager's version method - make sure that it has NONONO $'s around...
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2985
            newSource := self ensureNoDollarsInVersionMethod:rewriteQuery source.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2986
        ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2987
        rewriteQuery proceedWith:newSource
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2988
    ] do:aBlock.
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2989
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2990
    "Modified: / 27-09-2011 / 16:48:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2991
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2992
2100
cdbd6a3ada7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2082
diff changeset
  2993
writeHistoryLogSince:timeGoal filterSTSources:filterSTSourcesBoolean filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter filterProjects:projectFilterArg to:aStream
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  2994
    "send a full historyLog to some stream.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  2995
     This walks over all possible repository roots."
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  2996
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  2997
    |projectFilter goalString prevUser prevCvsRoot |
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  2998
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  2999
    projectFilter := projectFilterArg isEmptyOrNil ifTrue:nil ifFalse:projectFilterArg.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3000
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3001
    goalString := ''.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3002
    projectFilter notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3003
        projectFilter size == 1 ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3004
            goalString := goalString , 'of ',projectFilter first.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3005
        ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3006
            projectFilter size == 2 ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3007
                goalString := goalString , 'of ',projectFilter first,' and ',projectFilter second.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3008
            ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3009
                goalString := goalString , 'of ',projectFilter size printString,' projects'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3010
            ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3011
        ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3012
        goalString := goalString,' '
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3013
    ].
1447
2ac1cf09722b isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  3014
    (timeGoal notEmptyOrNil) ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3015
        goalString := goalString , 'since ' , timeGoal,' '.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3016
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3017
    userFilter notNil ifTrue:[
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3018
        userFilter isString ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3019
            goalString := 'by user ',userFilter
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3020
        ] ifFalse:[
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3021
            userFilter size == 1 ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3022
                goalString := 'by user ',(userFilter first) 
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3023
            ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3024
                goalString := 'by users ',(userFilter first),'...',(userFilter last) 
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3025
            ]
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3026
        ].
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3027
        goalString := goalString,' '.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3028
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3029
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3030
    aStream nextPutLine:'**** repository history ' , goalString , '****'.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3031
    aStream cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3032
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3033
    self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3034
        reportHistoryLogSince:timeGoal 
2100
cdbd6a3ada7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2082
diff changeset
  3035
        filterSTSources:filterSTSourcesBoolean 
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3036
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3037
        filterRepository:repositoryFilter 
1038
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3038
        filterModules:moduleFilter
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3039
        inTo:[:info |
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3040
            |user recordType fileName date time rev pkgDir 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3041
             module directory pkg
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3042
             clsName cvsRoot cls clsRev revInfo|
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3043
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3044
            pkgDir := info at:#directory ifAbsent:'?'.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3045
            module := pkgDir upTo:$/.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3046
            directory := pkgDir copyFrom:(module size+2).
1910
a260d4326328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  3047
            pkg := (PackageId module:module directory:directory) asString.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3048
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3049
            (projectFilter isEmptyOrNil
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3050
            or:[ projectFilter includes:pkg ]) ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3051
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3052
                user := info at:#user ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3053
                recordType := info at:#cvsRecordType ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3054
                fileName := info at:#fileName ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3055
                date := info at:#date ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3056
                time := info at:#time ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3057
                rev := info at:#revision ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3058
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3059
                clsName := info at:#className ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3060
                cvsRoot := info at:#cvsRoot ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3061
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3062
                cvsRoot ~= prevCvsRoot ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3063
                    aStream cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3064
                    aStream nextPutLine:'>>>> repository: ' , cvsRoot , ' <<<<'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3065
                    aStream cr; cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3066
                    aStream nextPutLine:'     Date    Time        User    Rev    File                           Package'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3067
                    prevUser := nil.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3068
                    prevCvsRoot := cvsRoot.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3069
                ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3070
                prevUser ~= user ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3071
                    aStream cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3072
                    prevUser := user.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3073
                ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3074
                aStream 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3075
                    nextPutAll:recordType; space; 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3076
                    nextPutAll:(date printString paddedTo:10); space; nextPutAll:(time printString paddedTo:5); space;
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3077
                    nextPutAll:(user leftPaddedTo:10); space;             
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3078
                    nextPutAll:(rev decimalPaddedTo:8 and:4 at:$. withLeft:(Character space) right:nil); tab;              
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3079
                    nextPutAll:(fileName paddedTo:30); space;                 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3080
                    nextPutAll:pkg.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3081
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3082
                "/
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3083
                "/ for your convenience:
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3084
                "/  check what the actual version is in the image
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3085
                "/
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3086
                clsName notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3087
                    revInfo := nil.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3088
                    cls := Smalltalk classNamed:clsName.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3089
                    (cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3090
                        rev ~= clsRev ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3091
                            revInfo := (' current: ' , clsRev)
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3092
                        ]
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3093
                    ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3094
                        cls isNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3095
                            revInfo := (' current: ** none **')
1480
c42afcba343a Fix "cvs history"
Stefan Vogel <sv@exept.de>
parents: 1467
diff changeset
  3096
                        ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3097
                            cls isLoaded ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3098
                                revInfo := (' current: ** no revision info **')
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3099
                            ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3100
                                revInfo := (' current: ** not loaded **')
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3101
                            ]    
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3102
                        ]
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3103
                    ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3104
                    revInfo notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3105
                        aStream nextPutAll:revInfo
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3106
                    ].
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3107
                ].
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3108
                aStream cr                              
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3109
            ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3110
        ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3111
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3112
    "Created: / 12-09-2006 / 15:18:35 / cg"
1910
a260d4326328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  3113
    "Modified: / 18-11-2006 / 17:09:55 / cg"
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3114
!
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3115
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3116
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter to:aStream
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3117
    "send a full historyLog to some stream.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3118
     This walks over all possible repository roots."
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3119
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3120
    self
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3121
        writeHistoryLogSince:timeGoal 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3122
        filterSTSources:filter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3123
        filterUser:userFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3124
        filterRepository:repositoryFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3125
        filterModules:moduleFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3126
        filterProjects:nil 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3127
        to:aStream
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3128
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3129
    "Modified: / 12-09-2006 / 15:19:11 / cg"
1038
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3130
!
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3131
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3132
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter to:aStream
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3133
    "send a full historyLog to some stream.
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3134
     This walks over all possible repository roots."
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3135
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3136
    ^self
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3137
        writeHistoryLogSince:timeGoal 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3138
        filterSTSources:filter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3139
        filterUser:userFilter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3140
        filterRepository:repositoryFilter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3141
        filterModules:nil to:aStream
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3142
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3143
    "Modified: / 17.1.2001 / 13:15:54 / cg"
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3144
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3145
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3146
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3147
    "send a full historyLog to some stream.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3148
     This walks over all possible repository roots."
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3149
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3150
    ^ self
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3151
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3152
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3153
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3154
        filterRepository:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3155
        to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3156
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3157
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3158
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3159
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3160
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3161
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3162
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3163
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3164
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3165
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3166
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3167
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3168
    "Modified: 12.9.1996 / 02:36:32 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3169
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3170
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3171
writeHistoryLogSince:timeGoal to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3172
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3173
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3174
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3175
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3176
        filterSTSources:true 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3177
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3178
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3179
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3180
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3181
    "Created: 13.12.1995 / 10:28:27 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3182
    "Modified: 12.9.1996 / 02:36:38 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3183
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3184
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3185
writeRevisionLogMessagesFrom:log to:aStream
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3186
    "helper; send the revisionlog to aStream"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3187
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3188
    ^ self writeRevisionLogMessagesFrom:log withHeader:true to:aStream
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3189
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3190
    "Created: 10.12.1995 / 16:51:30 / cg"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3191
!
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3192
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3193
writeRevisionLogMessagesFrom:log withHeader:header to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3194
    "helper; send the revisionlog to aStream"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3195
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3196
    |tags|
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3197
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3198
    header ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3199
"/        (log at:#renamed ifAbsent:false) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3200
"/            aStream nextPutAll:'  Class was probably renamed; revision info is from original class.'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3201
"/            aStream cr; nextPutAll:'  You may have to create a new container for it.'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3202
"/            aStream cr; cr.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3203
"/        ].
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3204
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3205
        aStream nextPutAll:'  Total revisions: '; nextPutLine:(log at:#numberOfRevisions) printString.
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3206
        aStream nextPutAll:'  Newest revision: '; nextPutLine:(log at:#newestRevision) printString.
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3207
        tags := log at:#symbolicNames ifAbsent:nil.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3208
        tags notNil ifTrue:[
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3209
            aStream nextPutAll:'  Stable revision: '; nextPutAll:(tags at:'stable' ifAbsent:'none'); cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3210
            aStream nextPutAll:'  Symbolic names: '; cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3211
            "sort tags by tag name"
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3212
            tags := tags associations sort:[:a :b| a key < b key].
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3213
            tags do:[:eachAssociation|
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3214
                aStream tab; nextPutAll:eachAssociation key; 
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3215
                             nextPutAll:': '; 
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3216
                             nextPutAll:eachAssociation value; cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3217
            ]
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3218
        ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3219
    ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3220
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3221
    (log at:#revisions) do:[:entry |
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3222
        |logMsg|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3223
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3224
        aStream cr.
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3225
        aStream nextPutAll:'  revision '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3226
            show:(entry at:#revision); tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3227
        aStream nextPutAll:' date: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3228
            show:((entry at:#date ifAbsent:nil) ? '?'); space;
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3229
            show:((entry at:#time ifAbsent:nil) ? '?'); tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3230
        aStream nextPutAll:' author: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3231
            show:(entry at:#author ifAbsent:nil) ? '?'; tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3232
        aStream nextPutAll:' lines: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3233
            show:(entry at:#numberOfChangedLines ifAbsent:nil) ? '?'; cr.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3234
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3235
        logMsg := entry at:#logMessage ifAbsent:''.
1467
26f9edcb3542 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
  3236
        (logMsg isBlank or:[logMsg withoutSeparators = '.']) ifTrue:[
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3237
            logMsg := '*** empty log message ***'
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3238
        ].
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3239
        aStream tab; nextPutLine:logMsg.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3240
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3241
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3242
    "Created: / 16-11-1995 / 13:25:30 / cg"
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3243
    "Modified: / 27-11-1996 / 18:26:30 / stefan"
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3244
    "Modified: / 21-12-2011 / 23:33:53 / cg"
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3245
!
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3246
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3247
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount to:aStream
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3248
    "extract a classes log and append it to aStream."
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3249
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3250
    |log |
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3251
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3252
    log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3253
    log isNil ifTrue:[
1024
7344e4e24b1c missing repository-log message beautified
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
  3254
        aStream cr; nextPutAll:'  ** No revision log available **'.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3255
        ^ false
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3256
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3257
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3258
    self writeRevisionLogMessagesFrom:log to:aStream.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3259
    ^ true
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3260
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3261
    "
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3262
     SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript 
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3263
    "
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3264
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3265
    "Created: 6.11.1995 / 18:56:00 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3266
    "Modified: 14.2.1997 / 21:11:57 / cg"
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3267
!
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3268
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3269
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3270
    "extract a classes log and append it to aStream."
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3271
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3272
    ^ self
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3273
        writeRevisionLogOf:aClass 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3274
        fromRevision:rev1 toRevision:rev2 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3275
        finishAfter:nil to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3276
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3277
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3278
     SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3279
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3280
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3281
    "Created: 6.11.1995 / 18:56:00 / cg"
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3282
    "Modified: 14.2.1997 / 21:11:57 / cg"
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3283
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3284
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3285
writeRevisionLogOf:aClass short:shortOrNot to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3286
    "extract a classes log and append it to aStream."
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3287
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3288
    ^ self
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3289
        writeRevisionLogOf:aClass 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3290
        fromRevision:nil 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3291
        toRevision:nil 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3292
        finishAfter:(shortOrNot ifTrue:20 ifFalse:nil)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3293
        to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3294
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3295
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3296
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3297
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3298
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3299
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3300
writeRevisionLogOf:aClass to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3301
    "extract a classes log and append it to aStream."
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3302
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3303
    ^ self writeRevisionLogOf:aClass short:false to:aStream
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3304
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3305
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3306
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3307
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3308
! !
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3309
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3310
!AbstractSourceCodeManager class methodsFor:'subclass responsibility'!
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3311
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3312
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter 
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3313
        filterRepository:repositoryFilter filterModules:moduleFilter inTo:aBlock
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3314
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3315
    ^ self subclassResponsibility
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3316
! !
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3317
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3318
!AbstractSourceCodeManager class methodsFor:'testing'!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3319
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3320
isCVS
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3321
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3322
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3323
    "Created: / 16-08-2006 / 10:58:27 / cg"
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3324
!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3325
2725
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3326
isMercurial
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3327
    ^ false
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3328
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3329
    "Created: / 14-01-2012 / 21:54:19 / cg"
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3330
!
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3331
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  3332
isSVN
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3333
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3334
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  3335
    "Created: / 16-08-2006 / 10:58:27 / cg"
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3336
!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3337
1890
9a64ba9dcf37 changed #methodChange:
Claus Gittinger <cg@exept.de>
parents: 1889
diff changeset
  3338
isSmallTeam
1889
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3339
    ^ false
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3340
1890
9a64ba9dcf37 changed #methodChange:
Claus Gittinger <cg@exept.de>
parents: 1889
diff changeset
  3341
    "Created: / 09-11-2006 / 14:30:22 / cg"
1889
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3342
!
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3343
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3344
isStore
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3345
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3346
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3347
    "Created: / 16-08-2006 / 10:59:26 / cg"
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3348
! !
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3349
2445
vrany
parents: 2443
diff changeset
  3350
!AbstractSourceCodeManager::PackageAndManager class methodsFor:'instance creation'!
vrany
parents: 2443
diff changeset
  3351
vrany
parents: 2443
diff changeset
  3352
package: package manager: manager
vrany
parents: 2443
diff changeset
  3353
vrany
parents: 2443
diff changeset
  3354
    ^self new
vrany
parents: 2443
diff changeset
  3355
        package: package;
vrany
parents: 2443
diff changeset
  3356
        manager: manager.
vrany
parents: 2443
diff changeset
  3357
vrany
parents: 2443
diff changeset
  3358
    "Created: / 09-07-2011 / 13:58:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3359
! !
vrany
parents: 2443
diff changeset
  3360
vrany
parents: 2443
diff changeset
  3361
!AbstractSourceCodeManager::PackageAndManager methodsFor:'accessing'!
vrany
parents: 2443
diff changeset
  3362
vrany
parents: 2443
diff changeset
  3363
manager
vrany
parents: 2443
diff changeset
  3364
vrany
parents: 2443
diff changeset
  3365
    ^AbstractSourceCodeManager named: managerTypeName
vrany
parents: 2443
diff changeset
  3366
vrany
parents: 2443
diff changeset
  3367
    "Created: / 09-07-2011 / 13:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3368
!
vrany
parents: 2443
diff changeset
  3369
vrany
parents: 2443
diff changeset
  3370
manager: aSourceCodeManager
vrany
parents: 2443
diff changeset
  3371
vrany
parents: 2443
diff changeset
  3372
    managerTypeName := aSourceCodeManager managerTypeName
vrany
parents: 2443
diff changeset
  3373
vrany
parents: 2443
diff changeset
  3374
    "Created: / 09-07-2011 / 13:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3375
!
vrany
parents: 2443
diff changeset
  3376
vrany
parents: 2443
diff changeset
  3377
managerTypeName
vrany
parents: 2443
diff changeset
  3378
    ^ managerTypeName
vrany
parents: 2443
diff changeset
  3379
!
vrany
parents: 2443
diff changeset
  3380
vrany
parents: 2443
diff changeset
  3381
managerTypeName:something
vrany
parents: 2443
diff changeset
  3382
    managerTypeName := something.
vrany
parents: 2443
diff changeset
  3383
!
vrany
parents: 2443
diff changeset
  3384
vrany
parents: 2443
diff changeset
  3385
package
vrany
parents: 2443
diff changeset
  3386
    ^ package
vrany
parents: 2443
diff changeset
  3387
!
vrany
parents: 2443
diff changeset
  3388
vrany
parents: 2443
diff changeset
  3389
package:something
vrany
parents: 2443
diff changeset
  3390
    package := something.
vrany
parents: 2443
diff changeset
  3391
! !
vrany
parents: 2443
diff changeset
  3392
2477
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3393
!AbstractSourceCodeManager::PackageAndManager methodsFor:'comparing'!
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3394
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3395
= aPackageAndManagerOrNil
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3396
    aPackageAndManagerOrNil isNil ifTrue:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3397
    aPackageAndManagerOrNil package = package ifFalse:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3398
    aPackageAndManagerOrNil managerTypeName = managerTypeName ifFalse:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3399
    ^ true
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3400
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3401
    "Created: / 19-08-2011 / 01:47:34 / cg"
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3402
!
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3403
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3404
hash
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3405
    ^ package hash bitXor: managerTypeName hash
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3406
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3407
    "Created: / 19-08-2011 / 01:47:56 / cg"
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3408
! !
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3409
2445
vrany
parents: 2443
diff changeset
  3410
!AbstractSourceCodeManager::PackageAndManager methodsFor:'displaying'!
vrany
parents: 2443
diff changeset
  3411
vrany
parents: 2443
diff changeset
  3412
displayStringForManagerTypeName
vrany
parents: 2443
diff changeset
  3413
    ^ self manager isNil 
vrany
parents: 2443
diff changeset
  3414
        ifFalse:[ managerTypeName ]
vrany
parents: 2443
diff changeset
  3415
        ifTrue:
vrany
parents: 2443
diff changeset
  3416
            [ (managerTypeName , ' (unavailable)') asText colorizeAllWith:Color gray ].
vrany
parents: 2443
diff changeset
  3417
vrany
parents: 2443
diff changeset
  3418
    "Created: / 09-07-2011 / 14:05:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3419
!
vrany
parents: 2443
diff changeset
  3420
vrany
parents: 2443
diff changeset
  3421
displayStringForPackage
vrany
parents: 2443
diff changeset
  3422
    ^ self manager isNil 
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  3423
        ifTrue:[ package asText colorizeAllWith:Color gray ]
2445
vrany
parents: 2443
diff changeset
  3424
        ifFalse:[ package ]
vrany
parents: 2443
diff changeset
  3425
vrany
parents: 2443
diff changeset
  3426
    "Created: / 09-07-2011 / 14:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  3427
    "Modified: / 03-12-2011 / 11:31:49 / cg"
2445
vrany
parents: 2443
diff changeset
  3428
! !
vrany
parents: 2443
diff changeset
  3429
2623
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3430
!AbstractSourceCodeManager::PackageAndManager methodsFor:'printing & storing'!
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3431
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3432
printOn:aStream
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3433
    "append a printed representation if the receiver to the argument, aStream"
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3434
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3435
    super printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3436
    aStream nextPut: $(.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3437
    package printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3438
    aStream nextPutAll:' -> '.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3439
    managerTypeName printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3440
    aStream nextPut: $).
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3441
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3442
    "Modified: / 25-11-2011 / 18:35:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3443
! !
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3444
2445
vrany
parents: 2443
diff changeset
  3445
!AbstractSourceCodeManager::PackageAndManager methodsFor:'queries'!
vrany
parents: 2443
diff changeset
  3446
vrany
parents: 2443
diff changeset
  3447
match: packageId
vrany
parents: 2443
diff changeset
  3448
    | manager |
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3449
2445
vrany
parents: 2443
diff changeset
  3450
    manager := self manager.
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3451
    manager isNil ifTrue:[^false].
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3452
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3453
    ^ (package match: packageId) 
2445
vrany
parents: 2443
diff changeset
  3454
        and: [manager isResponsibleForPackage: packageId]
vrany
parents: 2443
diff changeset
  3455
vrany
parents: 2443
diff changeset
  3456
    "
vrany
parents: 2443
diff changeset
  3457
     self managerForModule:'stx:libbasic' 
vrany
parents: 2443
diff changeset
  3458
     self managerForModule:'stx:libbasic2'
vrany
parents: 2443
diff changeset
  3459
     self managerForModule:'exept:expecco'  
vrany
parents: 2443
diff changeset
  3460
    "
vrany
parents: 2443
diff changeset
  3461
vrany
parents: 2443
diff changeset
  3462
    "Created: / 09-07-2011 / 14:26:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3463
    "Modified (format): / 18-11-2011 / 14:07:53 / cg"
2445
vrany
parents: 2443
diff changeset
  3464
! !
vrany
parents: 2443
diff changeset
  3465
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3466
!AbstractSourceCodeManager class methodsFor:'documentation'!
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3467
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3468
version
2742
bb8d754b8edb changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
  3469
    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.284 2012-01-20 15:48:33 cg Exp $'
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3470
!
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3471
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3472
version_CVS
2742
bb8d754b8edb changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2730
diff changeset
  3473
    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.284 2012-01-20 15:48:33 cg Exp $'
123
9a1dff152656 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 122
diff changeset
  3474
! !
1202
86cb235976ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1161
diff changeset
  3475
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
  3476
AbstractSourceCodeManager initialize!