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