AbstrSCMgr.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jan 1996 15:33:49 +0100
changeset 173 d73d61190510
parent 160 dacfc2454cc8
child 174 9c623b53c784
permissions -rw-r--r--
make sourceCache rwx-able for all
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
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
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
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
Object subclass:#AbstractSourceCodeManager
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    14
	instanceVariableNames:''
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    15
	classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    16
		WorkTreeDirectoryName'
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    17
	poolDictionaries:''
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    18
	category:'System-Support'
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
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
!AbstractSourceCodeManager class methodsFor:'documentation'!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 1995 by Claus Gittinger
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	      All Rights Reserved
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 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
    29
 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
    30
 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
    31
 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
    32
 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
    33
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    35
!
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
documentation
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    38
"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    39
    Abstract superclass for sourceCodeManagers.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    40
    Concrete subclasses provide access to a source repository.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    41
    All protocol here traps into subclassResponsbility errors.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    42
    Please read more documentation in concrete subclasses 
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    43
    (especially: CVSSourceCodeManager) for how to use this manager.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    44
"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
    45
! !
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    47
!AbstractSourceCodeManager class methodsFor:'initialization'!
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    48
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    49
initCacheDirPath
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    50
    |path|
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    51
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
    52
    path := OperatingSystem getEnvironment:'STX_TMPPATH'.
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    53
    path isNil ifTrue:[
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    54
        path := OperatingSystem getEnvironment:'TMPPATH'.
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    55
        path isNil ifTrue:[
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    56
            path := '/tmp'
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    57
        ]
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    58
    ].
64
Claus Gittinger <cg@exept.de>
parents: 63
diff changeset
    59
    CacheDirectoryName := path , '/stx_sourceCache'.
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    60
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    61
    "Modified: 16.12.1995 / 15:39:42 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    62
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    63
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    64
initialize
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    65
    CachingSources := UseWorkTree := false.
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    66
    CacheDirectoryName := WorkTreeDirectoryName := ''.
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    67
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    68
    "Modified: 16.12.1995 / 15:39:42 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    69
    "Created: 16.12.1995 / 15:41:00 / cg"
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    70
! !
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    71
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    72
!AbstractSourceCodeManager class methodsFor:'accessing'!
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    73
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    74
cacheDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    75
    ^ CacheDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    76
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    77
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    78
cacheDirectoryName:aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    79
    CacheDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    80
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    81
    "Created: 16.12.1995 / 15:18:43 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    82
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    83
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    84
cachingSources
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    85
    ^ CachingSources
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    86
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    87
    "Created: 16.12.1995 / 15:17:50 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    88
    "Modified: 16.12.1995 / 15:18:03 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    89
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    90
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    91
cachingSources:aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    92
    CachingSources := aBoolean
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
    "Created: 16.12.1995 / 15:18:13 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    95
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    96
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    97
defaultManager
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    98
    ^ DefaultManager
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    99
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   100
    "Created: 7.12.1995 / 17:14:22 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   101
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   102
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   103
useWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   104
    ^ UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   105
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   106
    "Created: 16.12.1995 / 15:36:48 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   107
    "Modified: 16.12.1995 / 15:37:17 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   108
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   109
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   110
useWorkTree:aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   111
    UseWorkTree := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   112
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   113
    "Modified: 16.12.1995 / 15:18:03 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   114
    "Created: 16.12.1995 / 15:37:29 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   115
!
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
workTreeDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   118
    ^ WorkTreeDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   119
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   120
    "Created: 16.12.1995 / 15:35:21 / cg"
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   121
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   122
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   123
workTreeDirectoryName:aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   124
    WorkTreeDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   125
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   126
    "Created: 16.12.1995 / 15:35:34 / cg"
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   127
! !
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   128
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   129
!AbstractSourceCodeManager class methodsFor:'private'!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   130
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   131
directoryFromContainerPath:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   132
    "given a full path as in an RCS header, extract the directory (i.e. package)."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   133
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   134
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   135
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   136
    path := self pathInRepositoryFrom:containerPath.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   137
    path notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   138
        idx := path indexOf:(Filename separator).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   139
        idx ~~ 0 ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   140
            path := path copyFrom:(idx + 1)
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   141
        ].
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   142
        ^ path asFilename directoryName
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   143
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   144
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   145
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   146
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   147
     SourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   148
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   149
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   150
    "Created: 25.11.1995 / 18:42:20 / cg"
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   151
    "Modified: 13.12.1995 / 13:06:15 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   152
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   153
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   154
filenameFromContainerPath:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   155
    "given some path as present in an RCS Header string, extract the containers
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   156
     name.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   157
     OBSOLETE - this is no longer used."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   158
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   159
    |top rest|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   160
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   161
    containerPath notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   162
        top := self repositoryTopDirectory.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   163
        top notNil ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   164
            (containerPath startsWith:(top , '/')) ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   165
                rest := containerPath copyFrom:(top size + 2).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   166
                ^ rest asFilename baseName
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   167
            ]
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   168
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   169
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   170
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   171
    "Created: 25.11.1995 / 18:42:34 / cg"
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   172
    "Modified: 13.12.1995 / 13:05:14 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   173
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   174
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   175
moduleFromContainerPath:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   176
    "given a full path as in an RCS header, extract the module."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   177
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   178
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   179
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   180
    path := self pathInRepositoryFrom:containerPath.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   181
    path notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   182
        idx := path indexOf:(Filename separator).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   183
        idx == 0 ifTrue:[^ path].
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   184
        ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   185
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   186
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   187
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   188
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   189
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   190
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   191
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   192
    "Created: 25.11.1995 / 18:42:20 / cg"
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   193
    "Modified: 13.12.1995 / 13:06:03 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   194
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   195
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   196
pathInRepositoryFrom:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   197
    "this tries to extract the path within a repository, given some path
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   198
     as present in an RCS Header string.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   199
     Typically, this ought to be that string directly; 
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   200
     however, if the repository directory is accessed via a symbolic link during
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   201
     ci/co, some systems extract different strings with co.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   202
     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
   203
     and extracted sources had /phys/ibm/CVS in their header.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   204
     Do not depend on the code below to work correctly all the time."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   205
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   206
    |top rest lastTop idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   207
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   208
    containerPath notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   209
        top := self repositoryTopDirectory.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   210
        top notNil ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   211
            (containerPath startsWith:(top , '/')) ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   212
                ^ containerPath copyFrom:(top size + 2).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   213
            ].
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   214
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   215
            "/ hardcase - the repository-filename in the versionInfo
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   216
            "/ does no match my repository top.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   217
            "/ check for mangled prefix (happens with symbolic links)
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   218
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   219
            lastTop := '/' , top asFilename baseName, '/'.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   220
            idx := containerPath indexOfSubCollection:lastTop.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   221
            idx ~~ 0 ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   222
                ('SOURCEMGR: warning: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintNL.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   223
                'SOURCEMGR: warning: assuming that mismatch is ok.' infoPrintNL.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   224
                ^ containerPath copyFrom:(idx + lastTop size).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   225
            ]
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   226
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   227
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   228
    ^ rest
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   229
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   230
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   231
     SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   232
     SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   233
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   234
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   235
    "Created: 25.11.1995 / 18:42:20 / cg"
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   236
    "Modified: 13.12.1995 / 13:03:53 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   237
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   238
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   239
repositoryTopDirectory
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   240
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   241
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   242
    "Created: 25.11.1995 / 18:38:59 / cg"
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   243
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   244
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   245
revisionAfter:aRevisionString
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   246
    |idx s|
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   247
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   248
    idx := aRevisionString lastIndexOf:$..
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   249
    idx == 0 ifTrue:[
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   250
	^ ((Integer readFrom:aRevisionString) + 1) printString
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   251
    ].
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   252
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   253
    ^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   254
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   255
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   256
     SourceCodeManager revisionAfter:'1.2.3.4' 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   257
     SourceCodeManager revisionAfter:'123'  
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   258
     SourceCodeManager revisionAfter:'1.24'  
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   259
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   260
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   261
    "Created: 20.11.1995 / 12:54:05 / cg"
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   262
!
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   263
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   264
sourceCacheDirectory
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   265
    |dir nm|
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   266
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   267
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   268
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   269
    (dir := nm asFilename) exists ifFalse:[
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   270
        dir makeDirectory.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   271
        dir exists ifFalse:[
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   272
            'SOURCEMGR: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintNL.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   273
            ^ nil
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   274
        ].
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   275
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   276
        "/ make it read/writable for everyone
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   277
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   278
        dir makeReadableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   279
        dir makeWritableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   280
        dir makeExecutableForAll.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   281
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   282
    ^ dir
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   283
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   284
    "Modified: 9.1.1996 / 15:33:27 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   285
!
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   286
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   287
sourceInfoOfClass:aClass
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   288
    "helper: return a classes sourceCodeInfo"
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   289
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   290
    |cls sourceInfo revInfo actualSourceFileName classFileName
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   291
     newInfo revisionInfo container|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   292
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   293
    cls := aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   294
    cls isMeta ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   295
        cls := cls soleInstance
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   296
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   297
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   298
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   299
    "/ the info given by the classes source ...
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   300
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   301
    revInfo := aClass revisionInfo.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   302
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   303
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   304
    "/ the info given by the classes binary ...
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   305
    "/ if present, we better trust that one.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   306
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   307
    sourceInfo := cls packageSourceCodeInfo.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   308
    sourceInfo isNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   309
        revInfo isNil ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   310
            'SOURCEMGR: class has neither source nor compiled-in info' infoPrintNL.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   311
            ^ nil
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   312
        ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   313
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   314
        container := revInfo at:#repositoryPathName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   315
        container notNil ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   316
            sourceInfo := revInfo.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   317
            sourceInfo at:#directory put:(self directoryFromContainerPath:container).
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   318
            sourceInfo at:#module put:(self moduleFromContainerPath:container).
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   319
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   320
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   321
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   322
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   323
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   324
    "/ the filename I would expect from its name ...
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   325
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   326
    classFileName := Smalltalk fileNameForClass:aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   327
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   328
    newInfo := IdentityDictionary new.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   329
    sourceInfo keysAndValuesDo:[:key :value |
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   330
        newInfo at:key put:value
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   331
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   332
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   333
    "/ check ..
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   334
    revInfo notNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   335
        actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   336
        actualSourceFileName notNil ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   337
            actualSourceFileName ~= (classFileName , '.st') ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   338
                ('SOURCEMGR: source of class ' , aClass name , ' found in ' , actualSourceFileName , ' (expected: ' , classFileName , '.st); renamed ?') infoPrintNL.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   339
                newInfo at:#expectedFileName put:(classFileName).
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   340
                newInfo at:#renamed put:true.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   341
                classFileName := actualSourceFileName copyWithoutLast:3
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   342
            ]
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   343
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   344
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   345
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   346
    newInfo at:#classFileName put:classFileName.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   347
    ^ newInfo
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   348
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   349
    "Created: 25.11.1995 / 12:40:19 / cg"
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   350
    "Modified: 17.12.1995 / 16:03:31 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   351
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   352
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   353
streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:cacheIt
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   354
    self subclassResponsibility.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   355
    ^ nil
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   356
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   357
    "Created: 4.11.1995 / 19:09:12 / cg"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   358
    "Modified: 4.11.1995 / 19:15:43 / cg"
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   359
! !
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   360
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   361
!AbstractSourceCodeManager class methodsFor:'source code access'!
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   362
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   363
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   364
    "checkin of a class into the source repository.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   365
     Return true if ok, false if not."
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   366
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   367
    |tempDir tempFile ok|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   368
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   369
    tempDir := (Filename newTemporaryIn:nil) makeDirectory.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   370
    [
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   371
        |aStream|
75
ea3dcbdb0401 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   372
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   373
        tempFile := tempDir construct:classFileName.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   374
        aStream := tempFile writeStream.
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   375
        aStream isNil ifTrue:[
121
a23bb38554ee trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   376
            'SOURCEMGR: temporary fileout failed' errorPrintNL.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   377
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   378
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   379
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   380
        Class fileOutErrorSignal handle:[:ex |
121
a23bb38554ee trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   381
            'SOURCEMGR: fileout failed' errorPrintNL.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   382
            aStream close.
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   383
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   384
        ] do:[
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   385
            aClass fileOutOn:aStream withTimeStamp:false.
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   386
        ].
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   387
        aStream close.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   388
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   389
        tempFile exists ifFalse:[
121
a23bb38554ee trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   390
            'SOURCEMGR: temporary fileout failed' errorPrintNL.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   391
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   392
        ].
75
ea3dcbdb0401 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   393
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   394
        ok := self 
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   395
            checkinClass:aClass
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   396
            fileName:classFileName 
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   397
            directory:packageDir 
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   398
            module:moduleDir
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   399
            source:(tempFile name)
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   400
            logMessage:logMessage.
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   401
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   402
        ^ ok
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   403
    ] valueNowOrOnUnwindDo:[
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   404
        tempDir recursiveRemove
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   405
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   406
    ^ false
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   407
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   408
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   409
     SourceCodeManager checkinClass:Array
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   410
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   411
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   412
    "Created: 6.11.1995 / 18:56:00 / cg"
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   413
    "Modified: 9.12.1995 / 21:43:35 / cg"
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   414
!
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   415
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   416
checkinClass:aClass logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   417
    "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
   418
     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
   419
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   420
    |sourceInfo packageDir moduleDir classFileName|
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   421
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   422
    sourceInfo := self sourceInfoOfClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   423
    sourceInfo isNil ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   424
        ('SOURCEMGR: no sourceInfo for class: ' , aClass name) errorPrintNL.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   425
        ^ false
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   426
    ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   427
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   428
    packageDir := sourceInfo at:#directory.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   429
    moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   430
    classFileName := sourceInfo at:#classFileName.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   431
"/    classFileName := Smalltalk fileNameForClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   432
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   433
    ^ self checkinClass:aClass fileName:(classFileName , '.st') directory:packageDir module:moduleDir logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   434
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   435
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   436
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   437
     SourceCodeManager checkinClass:Array
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   438
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   439
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   440
    "Created: 6.11.1995 / 18:56:00 / cg"
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   441
    "Modified: 9.12.1995 / 21:40:44 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   442
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   443
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   444
mostRecentSourceStreamForClassNamed:aClassName
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   445
    |cls sourceInfo classFileName packageDir moduleDir|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   446
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   447
    cls := Smalltalk classNamed:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   448
    cls notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   449
        sourceInfo := self sourceInfoOfClass:cls.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   450
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   451
    sourceInfo notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   452
        packageDir := sourceInfo at:#directory.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   453
        moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   454
        classFileName := sourceInfo at:#classFileName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   455
    ] ifFalse:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   456
        classFileName := Smalltalk fileNameForClass:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   457
        packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   458
        moduleDir := 'stx'.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   459
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   460
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   461
    packageDir isNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   462
        'SRCMGR: could not extract packageDir' errorPrintNL.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   463
        ^ nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   464
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   465
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   466
    ^ self 
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   467
        streamForClass:nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   468
        fileName:classFileName 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   469
        revision:#newest 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   470
        directory:packageDir 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   471
        module:moduleDir
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   472
        cache:false
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   473
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   474
    "Created: 6.11.1995 / 16:09:06 / cg"
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   475
    "Modified: 10.12.1995 / 01:09:06 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   476
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   477
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
sourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   479
    "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
   480
     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
   481
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   482
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   483
    ^ self sourceStreamFor:aClass revision:nil
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   484
!
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   485
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   486
sourceStreamFor:aClass revision:aRevisionStringOrNil
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   487
    "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
   488
     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
   489
     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
   490
     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
   491
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   492
    |classFileName revision 
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   493
     packageDir moduleDir sourceInfo revInfo|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   494
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   495
    aRevisionStringOrNil isNil ifTrue:[
109
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   496
	revision := aClass binaryRevision.
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   497
	revision isNil ifTrue:[ 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   498
	    'SOURCEMGR: class ' , aClass name , ' has no revision string' infoPrintNL.
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   499
	    ^ nil.
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   500
	]
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   501
    ] ifFalse:[
109
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   502
	revision := aRevisionStringOrNil
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   503
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   504
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   505
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   506
    sourceInfo isNil ifTrue:[^ nil].
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   507
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   508
    packageDir := sourceInfo at:#directory.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   509
    moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   510
    classFileName := sourceInfo at:#classFileName.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   511
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   512
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   513
    ^ self 
109
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   514
	streamForClass:aClass
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   515
	fileName:classFileName 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   516
	revision:revision 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   517
	directory:packageDir 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   518
	module:moduleDir
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   519
	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
   520
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   521
    "Modified: 25.11.1995 / 17:04:38 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   522
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   523
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   524
!AbstractSourceCodeManager class methodsFor:'source code administration'!
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   525
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   526
checkForExistingContainerInModule:moduleName package:dirName container:fileName
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   527
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   528
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   529
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   530
    "Created: 9.12.1995 / 19:02:23 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   531
    "Modified: 9.12.1995 / 19:43:39 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   532
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   533
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   534
checkForExistingModule:moduleName
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   535
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   536
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   537
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   538
    "Created: 9.12.1995 / 19:02:23 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   539
    "Modified: 9.12.1995 / 19:43:54 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   540
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   541
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   542
checkForExistingModule:moduleDir package:packageDir
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   543
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   544
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   545
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   546
    "Created: 9.12.1995 / 19:02:23 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   547
    "Modified: 9.12.1995 / 19:44:04 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   548
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   549
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   550
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   551
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   552
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   553
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   554
    "Created: 9.12.1995 / 19:02:47 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   555
    "Modified: 9.12.1995 / 19:28:15 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   556
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   557
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   558
createModule:moduleName
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   559
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   560
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   561
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   562
    "Created: 9.12.1995 / 19:02:23 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   563
    "Modified: 9.12.1995 / 19:53:23 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   564
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   565
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   566
createModule:module package:package
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   567
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   568
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   569
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   570
    "Created: 9.12.1995 / 19:02:23 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   571
    "Modified: 9.12.1995 / 19:54:26 / cg"
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   572
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   573
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   574
revisionLogOf:aClass
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   575
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   576
     the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   577
     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
   578
     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
   579
     filled with:
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   580
	    #container          -> the RCS container file name
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   581
	    #filename           -> the actual source file name
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   582
	    #newestRevision     -> the revisionString of the newest revision
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   583
	    #numberOfRevisions  -> the number of revisions in the container
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   584
	    #revisions          -> collection of per-revision info
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   585
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   586
	    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
   587
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   588
	      #revision              -> the revision string
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   589
	      #author                -> who checked that revision into the repository
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   590
	      #date                  -> when was it checked in
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   591
	      #state                 -> the RCS state
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   592
	      #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
   593
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   594
	    revisions are ordered newest first 
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   595
	    (i.e. the last entry is for the initial revision; the first for the most recent one)
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   596
	"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   597
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   598
    ^ self
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   599
	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
   600
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   601
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   602
     SourceCodeManager revisionLogOf:Array 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   603
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   604
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   605
    "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
   606
    "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
   607
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   608
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   609
revisionLogOf:aClass fromRevision:rev1
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   610
    "return info about the repository container and
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   611
     (part of) the revisionlog as a collection of revision entries.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   612
     Return nil on failure.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   613
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   614
     The returned information is a structure (IdentityDictionary)
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   615
     filled with:
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   616
	    #container          -> the RCS container file name 
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   617
	    #filename           -> the actual source file name
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   618
	    #newestRevision     -> the revisionString of the newest revision
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   619
	    #numberOfRevisions  -> the number of revisions in the container
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   620
	    #revisions          -> collection of per-revision info (see below)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   621
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   622
	 for some classes, additional info is returned:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   623
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   624
	    #renamed            -> true if the class has been renamed or copied
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   625
				   and the sourceInfo is from the previous one
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   626
	    #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
   627
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   628
	    rev1 / rev2 specify from which revisions a logEntry is wanted:
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   629
	      If rev1 is nil, the first revision is the initial revision
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   630
	      otherwise, the log starts with that revision.
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   631
	      If rev2 is nil, the last revision is the newest revision
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   632
	      otherwise, the log ends with that revision.
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   633
	      If both are nil, no logEntries are extracted (i.e. only the header).
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   634
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   635
	    per revision info consists of one record per revision:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   636
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   637
	      #revision              -> the revision string
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   638
	      #author                -> who checked that revision into the repository
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   639
	      #date                  -> when was it checked in
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   640
	      #state                 -> the RCS state
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   641
	      #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
   642
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   643
	    revisions are ordered newest first 
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   644
	    (i.e. the last entry is for the initial revision; the first for the most recent one)
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   645
	"
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   646
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   647
    ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   648
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   649
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   650
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40'
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   651
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   652
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   653
    "Created: 6.11.1995 / 18:56:00 / cg"
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   654
    "Modified: 7.12.1995 / 11:51:15 / cg"
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   655
!
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   656
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   657
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   658
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   659
     (part of) the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   660
     Return nil on failure.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   661
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   662
     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
   663
     filled with:
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   664
            #container          -> the RCS container file name 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   665
            #filename           -> the actual source file name
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   666
            #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
   667
            #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
   668
            #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
   669
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   670
         for some classes, additional info is returned:
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   671
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   672
            #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
   673
                                   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
   674
            #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
   675
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   676
            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
   677
              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
   678
              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
   679
              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
   680
              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
   681
              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
   682
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   683
            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
   684
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   685
              #revision              -> the revision string
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   686
              #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
   687
              #date                  -> when was it checked in
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   688
              #state                 -> the RCS state
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   689
              #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
   690
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   691
            revisions are ordered newest first 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   692
            (i.e. the last entry is for the initial revision; the first for the most recent one)
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   693
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   694
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   695
    |cls sourceInfo packageDir moduleDir classFileName info|
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   696
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   697
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   698
    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
   699
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   700
    packageDir := sourceInfo at:#directory.
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   701
    moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   702
"/    classFileName := Smalltalk fileNameForClass:aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   703
    classFileName := sourceInfo at:#classFileName.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   704
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   705
    info := self 
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   706
        revisionLogOf:aClass
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   707
        fromRevision:rev1 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   708
        toRevision:rev2
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   709
        fileName:(classFileName , '.st')
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   710
        directory:packageDir 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   711
        module:moduleDir.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   712
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   713
    info notNil ifTrue:[
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   714
        (sourceInfo includesKey:#renamed) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   715
            info at:#renamed put:(sourceInfo at:#renamed)
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   716
        ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   717
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   718
            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
   719
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   720
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   721
    ^ info
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   722
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   723
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   724
     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
   725
     SourceCodeManager revisionLogOf:XtBoxNew 
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   726
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   727
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   728
    "Created: 6.11.1995 / 18:56:00 / cg"
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   729
    "Modified: 9.12.1995 / 22:04:08 / cg"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   730
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   731
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   732
revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   733
    "this must be implemented by a concrete source-code manager"
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   734
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   735
    self subclassResponsibility.
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   736
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   737
    "Created: 15.11.1995 / 18:12:51 / cg"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   738
    "Modified: 25.11.1995 / 11:56:38 / cg"
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   739
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   740
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   741
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   742
    self writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:nil to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   743
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   744
    "Modified: 13.12.1995 / 11:03:01 / cg"
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   745
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   746
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   747
writeHistoryLogSince:timeGoal to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   748
    self writeHistoryLogSince:timeGoal filterSTSources:true filterUser:nil to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   749
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   750
    "Created: 13.12.1995 / 10:28:27 / cg"
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   751
    "Modified: 13.12.1995 / 11:00:49 / cg"
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   752
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   753
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   754
writeRevisionLogMessagesFrom:log to:aStream
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   755
    "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
   756
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   757
    self writeRevisionLogMessagesFrom:log withHeader:true to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   758
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   759
    "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
   760
!
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   761
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   762
writeRevisionLogMessagesFrom:log withHeader:header to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   763
    "helper; send the revisionlog to aStream"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   764
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   765
    header ifTrue:[
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   766
        (log at:#renamed ifAbsent:false) ifTrue:[
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   767
            aStream nextPutAll:'  Class was probably renamed; revision info is from original class.'.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   768
            aStream cr; nextPutAll:'  You may have to create a new container for it.'.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   769
            aStream cr; cr.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   770
        ].
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   771
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   772
        aStream nextPutAll:'  Total revisions: '; nextPutAll:(log at:#numberOfRevisions) printString; cr.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   773
        aStream nextPutAll:'  Newest revision: '; nextPutAll:(log at:#newestRevision) printString; cr.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   774
    ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   775
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   776
    (log at:#revisions) do:[:entry |
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   777
        |logMsg|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   778
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   779
        aStream cr.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   780
        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
   781
        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
   782
        aStream nextPutAll:' author: '; nextPutAll:(entry at:#author); tab.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   783
        aStream cr.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   784
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   785
        logMsg := entry at:#logMessage.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   786
        (logMsg isEmpty or:[logMsg isBlank or:[logMsg withoutSeparators = '.']]) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   787
            logMsg := '*** empty log message ***'
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   788
        ].
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   789
        aStream tab; nextPutAll:logMsg.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   790
        aStream cr.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   791
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   792
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   793
    "Created: 16.11.1995 / 13:25:30 / cg"
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   794
    "Modified: 10.12.1995 / 16:51:15 / cg"
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   795
!
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   796
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   797
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   798
    "extract a classes log and append it to aStream."
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   799
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   800
    |log |
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   801
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   802
    log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   803
    log isNil ifTrue:[^ false].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   804
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   805
    self writeRevisionLogMessagesFrom:log to:aStream.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   806
    ^ true
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   807
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   808
    "
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   809
     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
   810
    "
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   811
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   812
    "Created: 6.11.1995 / 18:56:00 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   813
    "Modified: 25.11.1995 / 17:24:55 / cg"
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   814
!
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   815
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   816
writeRevisionLogOf:aClass to:aStream
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   817
    "extract a classes log and append it to aStream."
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   818
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   819
    ^ self
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   820
	writeRevisionLogOf:aClass fromRevision:nil toRevision:nil to:aStream
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   821
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   822
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   823
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   824
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   825
! !
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   826
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   827
!AbstractSourceCodeManager class methodsFor:'documentation'!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   828
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   829
version
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   830
    ^ '$Header: /cvs/stx/stx/libbasic3/Attic/AbstrSCMgr.st,v 1.40 1996-01-09 14:33:49 cg Exp $'
123
9a1dff152656 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 122
diff changeset
   831
! !
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   832
AbstractSourceCodeManager initialize!