AbstractSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Sun, 17 Dec 1995 16:19:09 +0100
changeset 160 dacfc2454cc8
parent 158 27f76f9d8a25
child 173 d73d61190510
permissions -rw-r--r--
prints replaced by infoPrint
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:[
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   270
	dir makeDirectory.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   271
	dir asFilename exists ifFalse:[
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   272
	    'SOURCEMGR: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintNL.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   273
	    ^ nil
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   274
	].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   275
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   276
    ^ dir
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   277
!
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   278
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   279
sourceInfoOfClass:aClass
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   280
    "helper: return a classes sourceCodeInfo"
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   281
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   282
    |cls sourceInfo revInfo actualSourceFileName classFileName
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   283
     newInfo revisionInfo container|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   284
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   285
    cls := aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   286
    cls isMeta ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   287
        cls := cls soleInstance
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   288
    ].
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
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   291
    "/ the info given by the classes source ...
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
    revInfo := aClass revisionInfo.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   294
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   295
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   296
    "/ the info given by the classes binary ...
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   297
    "/ if present, we better trust that one.
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
    sourceInfo := cls packageSourceCodeInfo.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   300
    sourceInfo isNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   301
        revInfo isNil ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   302
            'SOURCEMGR: class has neither source nor compiled-in info' infoPrintNL.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   303
            ^ nil
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   304
        ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   305
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   306
        container := revInfo at:#repositoryPathName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   307
        container notNil ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   308
            sourceInfo := revInfo.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   309
            sourceInfo at:#directory put:(self directoryFromContainerPath:container).
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   310
            sourceInfo at:#module put:(self moduleFromContainerPath:container).
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   311
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   312
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   313
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   314
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   315
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   316
    "/ the filename I would expect from its name ...
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   317
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   318
    classFileName := Smalltalk fileNameForClass:aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   319
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   320
    newInfo := IdentityDictionary new.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   321
    sourceInfo keysAndValuesDo:[:key :value |
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   322
        newInfo at:key put:value
96
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
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   325
    "/ check ..
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   326
    revInfo notNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   327
        actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   328
        actualSourceFileName notNil ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   329
            actualSourceFileName ~= (classFileName , '.st') ifTrue:[
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   330
                ('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
   331
                newInfo at:#expectedFileName put:(classFileName).
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   332
                newInfo at:#renamed put:true.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   333
                classFileName := actualSourceFileName copyWithoutLast:3
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   334
            ]
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   335
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   336
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   337
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   338
    newInfo at:#classFileName put:classFileName.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   339
    ^ newInfo
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   340
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   341
    "Created: 25.11.1995 / 12:40:19 / cg"
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   342
    "Modified: 17.12.1995 / 16:03:31 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   343
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   344
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   345
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
   346
    self subclassResponsibility.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   347
    ^ nil
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   348
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   349
    "Created: 4.11.1995 / 19:09:12 / cg"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   350
    "Modified: 4.11.1995 / 19:15:43 / cg"
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   351
! !
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   352
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   353
!AbstractSourceCodeManager class methodsFor:'source code access'!
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   354
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   355
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   356
    "checkin of a class into the source repository.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   357
     Return true if ok, false if not."
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   358
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   359
    |tempDir tempFile ok|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   360
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   361
    tempDir := (Filename newTemporaryIn:nil) makeDirectory.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   362
    [
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   363
        |aStream|
75
ea3dcbdb0401 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   364
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   365
        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
   366
        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
   367
        aStream isNil ifTrue:[
121
a23bb38554ee trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   368
            '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
   369
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   370
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   371
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   372
        Class fileOutErrorSignal handle:[:ex |
121
a23bb38554ee trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   373
            '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
   374
            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
   375
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   376
        ] do:[
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   377
            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
   378
        ].
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   379
        aStream close.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   380
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   381
        tempFile exists ifFalse:[
121
a23bb38554ee trace messages only if Verbose is true
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   382
            '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
   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
        ].
75
ea3dcbdb0401 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   385
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   386
        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
   387
            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
   388
            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
   389
            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
   390
            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
   391
            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
   392
            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
   393
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
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   395
    ] 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
   396
        tempDir recursiveRemove
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   397
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   398
    ^ false
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   399
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   400
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   401
     SourceCodeManager checkinClass:Array
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   402
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   403
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   404
    "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
   405
    "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
   406
!
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   407
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   408
checkinClass:aClass logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   409
    "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
   410
     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
   411
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   412
    |sourceInfo packageDir moduleDir classFileName|
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   413
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   414
    sourceInfo := self sourceInfoOfClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   415
    sourceInfo isNil ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   416
        ('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
   417
        ^ false
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   418
    ].
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
    packageDir := sourceInfo at:#directory.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   421
    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
   422
    classFileName := sourceInfo at:#classFileName.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   423
"/    classFileName := Smalltalk fileNameForClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   424
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   425
    ^ 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
   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
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   429
     SourceCodeManager checkinClass:Array
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   430
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   431
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   432
    "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
   433
    "Modified: 9.12.1995 / 21:40:44 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   434
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   435
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   436
mostRecentSourceStreamForClassNamed:aClassName
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   437
    |cls sourceInfo classFileName packageDir moduleDir|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   438
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   439
    cls := Smalltalk classNamed:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   440
    cls notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   441
        sourceInfo := self sourceInfoOfClass:cls.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   442
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   443
    sourceInfo notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   444
        packageDir := sourceInfo at:#directory.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   445
        moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   446
        classFileName := sourceInfo at:#classFileName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   447
    ] ifFalse:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   448
        classFileName := Smalltalk fileNameForClass:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   449
        packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   450
        moduleDir := 'stx'.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   451
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   452
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   453
    packageDir isNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   454
        'SRCMGR: could not extract packageDir' errorPrintNL.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   455
        ^ nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   456
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   457
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   458
    ^ self 
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   459
        streamForClass:nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   460
        fileName:classFileName 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   461
        revision:#newest 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   462
        directory:packageDir 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   463
        module:moduleDir
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   464
        cache:false
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
    "Created: 6.11.1995 / 16:09:06 / cg"
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   467
    "Modified: 10.12.1995 / 01:09:06 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   468
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   469
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
sourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   471
    "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
   472
     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
   473
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   474
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   475
    ^ self sourceStreamFor:aClass revision:nil
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   476
!
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   477
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   478
sourceStreamFor:aClass revision:aRevisionStringOrNil
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   479
    "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
   480
     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
   481
     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
   482
     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
   483
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   484
    |classFileName revision 
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   485
     packageDir moduleDir sourceInfo revInfo|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   486
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   487
    aRevisionStringOrNil isNil ifTrue:[
109
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   488
	revision := aClass binaryRevision.
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   489
	revision isNil ifTrue:[ 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   490
	    'SOURCEMGR: class ' , aClass name , ' has no revision string' infoPrintNL.
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   491
	    ^ nil.
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   492
	]
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   493
    ] ifFalse:[
109
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   494
	revision := aRevisionStringOrNil
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   495
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   496
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   497
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   498
    sourceInfo isNil ifTrue:[^ nil].
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   499
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   500
    packageDir := sourceInfo at:#directory.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   501
    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
   502
    classFileName := sourceInfo at:#classFileName.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   503
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   504
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   505
    ^ self 
109
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   506
	streamForClass:aClass
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   507
	fileName:classFileName 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   508
	revision:revision 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   509
	directory:packageDir 
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   510
	module:moduleDir
51cf60ce547e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 96
diff changeset
   511
	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
   512
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   513
    "Modified: 25.11.1995 / 17:04:38 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   514
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   515
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   516
!AbstractSourceCodeManager class methodsFor:'source code administration'!
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   517
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   518
checkForExistingContainerInModule:moduleName package:dirName container:fileName
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   519
    self subclassResponsibility.
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   520
    ^ false
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   521
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   522
    "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
   523
    "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
   524
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   525
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
   526
checkForExistingModule:moduleName
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:54 / 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:moduleDir package:packageDir
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:44:04 / 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
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
   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:47 / 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:28:15 / 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
createModule:moduleName
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:23 / 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:53:23 / 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:module package:package
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:54:26 / 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
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   566
revisionLogOf:aClass
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   567
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   568
     the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   569
     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
   570
     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
   571
     filled with:
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   572
	    #container          -> the RCS container file name
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   573
	    #filename           -> the actual source file name
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   574
	    #newestRevision     -> the revisionString of the newest revision
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   575
	    #numberOfRevisions  -> the number of revisions in the container
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   576
	    #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
   577
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   578
	    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
   579
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   580
	      #revision              -> the revision string
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   581
	      #author                -> who checked that revision into the repository
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   582
	      #date                  -> when was it checked in
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   583
	      #state                 -> the RCS state
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   584
	      #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
   585
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   586
	    revisions are ordered newest first 
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   587
	    (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
   588
	"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   589
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   590
    ^ self
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   591
	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
   592
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   593
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   594
     SourceCodeManager revisionLogOf:Array 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   595
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   596
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   597
    "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
   598
    "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
   599
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   600
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   601
revisionLogOf:aClass fromRevision:rev1
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   602
    "return info about the repository container and
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   603
     (part of) the revisionlog as a collection of revision entries.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   604
     Return nil on failure.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   605
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   606
     The returned information is a structure (IdentityDictionary)
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   607
     filled with:
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   608
	    #container          -> the RCS container file name 
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   609
	    #filename           -> the actual source file name
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   610
	    #newestRevision     -> the revisionString of the newest revision
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   611
	    #numberOfRevisions  -> the number of revisions in the container
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   612
	    #revisions          -> collection of per-revision info (see below)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   613
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   614
	 for some classes, additional info is returned:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   615
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   616
	    #renamed            -> true if the class has been renamed or copied
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   617
				   and the sourceInfo is from the previous one
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   618
	    #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
   619
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   620
	    rev1 / rev2 specify from which revisions a logEntry is wanted:
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   621
	      If rev1 is nil, the first revision is the initial revision
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   622
	      otherwise, the log starts with that revision.
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   623
	      If rev2 is nil, the last revision is the newest revision
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   624
	      otherwise, the log ends with that revision.
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   625
	      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
   626
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   627
	    per revision info consists of one record per revision:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   628
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   629
	      #revision              -> the revision string
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   630
	      #author                -> who checked that revision into the repository
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   631
	      #date                  -> when was it checked in
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   632
	      #state                 -> the RCS state
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   633
	      #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
   634
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   635
	    revisions are ordered newest first 
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   636
	    (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
   637
	"
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   638
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   639
    ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   640
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   641
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   642
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40'
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   643
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   644
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   645
    "Created: 6.11.1995 / 18:56:00 / cg"
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   646
    "Modified: 7.12.1995 / 11:51:15 / cg"
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   647
!
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
   648
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   649
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   650
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   651
     (part of) the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   652
     Return nil on failure.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   653
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   654
     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
   655
     filled with:
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   656
            #container          -> the RCS container file name 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   657
            #filename           -> the actual source file name
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   658
            #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
   659
            #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
   660
            #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
   661
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   662
         for some classes, additional info is returned:
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   663
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   664
            #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
   665
                                   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
   666
            #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
   667
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   668
            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
   669
              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
   670
              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
   671
              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
   672
              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
   673
              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
   674
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   675
            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
   676
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   677
              #revision              -> the revision string
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   678
              #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
   679
              #date                  -> when was it checked in
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   680
              #state                 -> the RCS state
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   681
              #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
   682
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   683
            revisions are ordered newest first 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   684
            (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
   685
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   686
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   687
    |cls sourceInfo packageDir moduleDir classFileName info|
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   688
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   689
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   690
    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
   691
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   692
    packageDir := sourceInfo at:#directory.
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   693
    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
   694
"/    classFileName := Smalltalk fileNameForClass:aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   695
    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
   696
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   697
    info := self 
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   698
        revisionLogOf:aClass
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   699
        fromRevision:rev1 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   700
        toRevision:rev2
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   701
        fileName:(classFileName , '.st')
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   702
        directory:packageDir 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   703
        module:moduleDir.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   704
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   705
    info notNil ifTrue:[
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   706
        (sourceInfo includesKey:#renamed) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   707
            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
   708
        ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   709
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   710
            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
   711
        ]
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
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   714
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   715
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   716
     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
   717
     SourceCodeManager revisionLogOf:XtBoxNew 
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   718
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   719
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   720
    "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
   721
    "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
   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
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
   725
    "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
   726
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   727
    self subclassResponsibility.
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   728
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   729
    "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
   730
    "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
   731
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   732
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   733
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   734
    self writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:nil to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   735
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   736
    "Modified: 13.12.1995 / 11:03:01 / cg"
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   737
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   738
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   739
writeHistoryLogSince:timeGoal to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   740
    self writeHistoryLogSince:timeGoal filterSTSources:true filterUser:nil to:aStream
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   741
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   742
    "Created: 13.12.1995 / 10:28:27 / cg"
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   743
    "Modified: 13.12.1995 / 11:00:49 / cg"
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   744
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   745
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   746
writeRevisionLogMessagesFrom:log to:aStream
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   747
    "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
   748
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   749
    self writeRevisionLogMessagesFrom:log withHeader:true to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   750
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   751
    "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
   752
!
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   753
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   754
writeRevisionLogMessagesFrom:log withHeader:header to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   755
    "helper; send the revisionlog to aStream"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   756
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   757
    header ifTrue:[
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   758
        (log at:#renamed ifAbsent:false) ifTrue:[
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   759
            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
   760
            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
   761
            aStream cr; cr.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   762
        ].
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   763
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   764
        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
   765
        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
   766
    ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   767
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   768
    (log at:#revisions) do:[:entry |
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   769
        |logMsg|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   770
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   771
        aStream cr.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   772
        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
   773
        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
   774
        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
   775
        aStream cr.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   776
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   777
        logMsg := entry at:#logMessage.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   778
        (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
   779
            logMsg := '*** empty log message ***'
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   780
        ].
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   781
        aStream tab; nextPutAll:logMsg.
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   782
        aStream cr.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   783
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   784
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   785
    "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
   786
    "Modified: 10.12.1995 / 16:51:15 / cg"
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   787
!
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   788
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   789
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   790
    "extract a classes log and append it to aStream."
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   791
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   792
    |log |
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   793
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   794
    log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   795
    log isNil ifTrue:[^ false].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   796
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   797
    self writeRevisionLogMessagesFrom:log to:aStream.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   798
    ^ true
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   799
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   800
    "
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   801
     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
   802
    "
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   803
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
   804
    "Created: 6.11.1995 / 18:56:00 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   805
    "Modified: 25.11.1995 / 17:24:55 / cg"
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   806
!
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   807
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   808
writeRevisionLogOf:aClass to:aStream
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   809
    "extract a classes log and append it to aStream."
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   810
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   811
    ^ self
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   812
	writeRevisionLogOf:aClass fromRevision:nil toRevision:nil to:aStream
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   813
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   814
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   815
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   816
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   817
! !
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
   818
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   819
!AbstractSourceCodeManager class methodsFor:'documentation'!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   820
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
   821
version
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   822
    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.39 1995-12-17 15:18:28 cg Exp $'
123
9a1dff152656 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 122
diff changeset
   823
! !
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   824
AbstractSourceCodeManager initialize!