AbstractSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Wed, 29 Mar 2000 20:34:06 +0200
changeset 919 20e138a64538
parent 904 1db5b3ee4b37
child 922 24cfcd3043a2
permissions -rw-r--r--
*** empty log message ***
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
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    14
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Object subclass:#AbstractSourceCodeManager
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    16
	instanceVariableNames:''
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    17
	classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    18
		WorkTreeDirectoryName'
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    19
	poolDictionaries:''
218
abd9b9000b37 category changes
Claus Gittinger <cg@exept.de>
parents: 213
diff changeset
    20
	category:'System-SourceCodeManagement'
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    23
!AbstractSourceCodeManager class methodsFor:'documentation'!
56
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
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 1995 by Claus Gittinger
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 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
    31
 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
    32
 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
    33
 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
    34
 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
    35
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    37
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    38
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    39
documentation
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    40
"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    41
    Abstract superclass for sourceCodeManagers.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    42
    Concrete subclasses provide access to a source repository.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    43
    All protocol here traps into subclassResponsbility errors.
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    44
    Please read more documentation in concrete subclasses 
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    45
    (especially: CVSSourceCodeManager) for how to use this manager.
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    46
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    47
    [author:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    48
        Claus Gittinger
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    49
"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
    50
! !
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    52
!AbstractSourceCodeManager class methodsFor:'initialization'!
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    53
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    54
initCacheDirPath
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    55
    "initialize the name of the cacheDirectory.
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    56
     This is:
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    57
          <tempDir>/stx_sourceCache."
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    58
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    59
    CacheDirectoryName := (Filename tempDirectory constructString:'stx_sourceCache').
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    60
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    61
    "
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    62
     self initCacheDirPath
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    63
    "
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    64
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    65
    "Modified: / 12.7.1999 / 10:01:31 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    66
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    67
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    68
initialize
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    69
    "setup for no caching and no workTree"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    70
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    71
    CachingSources := UseWorkTree := false.
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    72
    CacheDirectoryName := WorkTreeDirectoryName := ''.
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    73
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    74
    "Created: 16.12.1995 / 15:41:00 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    75
    "Modified: 12.9.1996 / 02:28:11 / cg"
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    76
! !
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    77
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    78
!AbstractSourceCodeManager class methodsFor:'accessing'!
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
    79
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    80
cacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    81
    "return the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    82
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    83
     This cache is shared among all ST/X users on a system."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    84
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    85
    ^ CacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    86
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    87
    "Modified: 12.9.1996 / 02:20:45 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    88
!
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
cacheDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    91
    "set the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    92
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    93
     This cache is shared among all ST/X users on a system.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    94
     The directory is typically set via the launchers setting menu, or
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    95
     from a startup rc-file."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    96
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    97
    CacheDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    98
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    99
    "Created: 16.12.1995 / 15:18:43 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   100
    "Modified: 12.9.1996 / 02:21:35 / 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
cachingSources
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   104
    "return true, if source caching is enabled.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   105
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   106
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   107
    ^ CachingSources
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
    "Created: 16.12.1995 / 15:17:50 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   110
    "Modified: 12.9.1996 / 02:22:19 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   111
!
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
cachingSources:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   114
    "enable/disable the caching of source files.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   115
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   116
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   117
    CachingSources := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   118
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   119
    "Created: 16.12.1995 / 15:18:13 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   120
    "Modified: 12.9.1996 / 02:22:42 / cg"
158
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
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   123
defaultManager
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   124
    "return the default sourceCodeManager class"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   125
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   126
    ^ DefaultManager
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
    "Created: 7.12.1995 / 17:14:22 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   129
    "Modified: 12.9.1996 / 02:22:56 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   130
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   131
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   132
repositoryName
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   133
    "return the name of the repository.
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   134
     Since this is an abstract class, return nil (i.e. none)"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   135
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   136
    ^ nil
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   137
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   138
    "Modified: 12.9.1996 / 02:20:45 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   139
    "Created: 14.9.1996 / 13:21:37 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   140
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   141
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   142
useWorkTree
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   143
    "return the setting of useWorkTree, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   144
     controls if an up-to-date view of a CVS working tree should be
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   145
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   146
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   147
    ^ UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   148
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   149
    "Created: 16.12.1995 / 15:36:48 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   150
    "Modified: 12.9.1996 / 02:24:01 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   151
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   152
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   153
useWorkTree:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   154
    "enable/disable the useWorkTree feature, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   155
     controls if an up-to-date view of a CVS working tree should be
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   156
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   157
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   158
    UseWorkTree := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   159
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   160
    "Created: 16.12.1995 / 15:37:29 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   161
    "Modified: 12.9.1996 / 02:24:38 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   162
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   163
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   164
workTreeDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   165
    "return the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   166
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   167
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   168
    ^ WorkTreeDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   169
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   170
    "Created: 16.12.1995 / 15:35:21 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   171
    "Modified: 12.9.1996 / 02:25:13 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   172
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   173
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   174
workTreeDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   175
    "set the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   176
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   177
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   178
    WorkTreeDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   179
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   180
    "Created: 16.12.1995 / 15:35:34 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   181
    "Modified: 12.9.1996 / 02:25:19 / cg"
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   182
! !
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   183
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   184
!AbstractSourceCodeManager class methodsFor:'basic access'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   185
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   186
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir source:sourceFile logMessage:logMessage force:force
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   187
    "checkin of a class into the source repository.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   188
     Return true if ok, false if not."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   189
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   190
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   191
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   192
    "Created: 14.2.1997 / 21:17:33 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   193
    "Modified: 14.2.1997 / 21:18:48 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   194
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   195
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   196
checkoutModule:aModule package:aPackage andDo:aBlock
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   197
    "check out everything from a package into a temporary directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   198
     Then evaluate aBlock, passing the name of that temp-directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   199
     Afterwards, the tempDir is removed.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   200
     Return true, if OK, false if any error occurred."
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   201
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   202
    ^ self subclassResponsibility
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   203
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   204
    "Modified: 14.2.1997 / 21:18:35 / cg"
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   205
!
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   206
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   207
streamForClass:aClass fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:doCache
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   208
    "extract a classes source code and return an open readStream on it.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   209
     A revision of nil selects the current (in image) revision.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   210
     The classes source code is extracted using the revision and the sourceCodeInfo,
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   211
     which itself is extracted from the classes packageString."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   212
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   213
    ^ self subclassResponsibility
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   214
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   215
    "Modified: 14.2.1997 / 21:18:35 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   216
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   217
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   218
!AbstractSourceCodeManager class methodsFor:'basic administration'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   219
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   220
checkForExistingContainerForClass:aClass
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   221
    |sourceInfo packageDir moduleDir classFileName|
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   222
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   223
    sourceInfo := self sourceInfoOfClass:aClass.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   224
    sourceInfo isNil ifTrue:[
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   225
        ('SourceCodeManager [warning]: no sourceInfo for class: ' , aClass name) errorPrintCR.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   226
        ^ false
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   227
    ].
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   228
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   229
    packageDir := self packageFromSourceInfo:sourceInfo.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   230
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   231
    classFileName := self containerFromSourceInfo:sourceInfo.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   232
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   233
    ^ self checkForExistingContainerInModule:moduleDir package:packageDir container:classFileName
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   234
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   235
    "Created: / 13.5.1998 / 22:35:50 / cg"
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   236
!
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   237
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   238
checkForExistingContainerInModule:moduleName package:dirName container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   239
    "check for a container to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   240
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   241
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   242
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   243
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   244
    "Modified: 14.2.1997 / 21:18:56 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   245
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   246
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   247
checkForExistingModule:moduleName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   248
    "check for a module directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   249
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   250
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   251
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   252
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   253
    "Modified: 14.2.1997 / 21:19:01 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   254
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   255
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   256
checkForExistingModule:moduleDir package:packageDir
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   257
    "check for a package directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   258
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   259
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   260
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   261
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   262
    "Modified: 14.2.1997 / 21:19:06 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   263
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   264
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   265
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   266
    "create a new container & check into it an initial version of aClass"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   267
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   268
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   269
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   270
    "Created: 9.12.1995 / 19:02:47 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   271
    "Modified: 14.2.1997 / 21:19:11 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   272
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   273
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   274
createModule:moduleName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   275
    "create a new module directory"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   276
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   277
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   278
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   279
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   280
    "Modified: 14.2.1997 / 21:19:16 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   281
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   282
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   283
createModule:module package:package
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   284
    "create a new package directory"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   285
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   286
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   287
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   288
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   289
    "Modified: 14.2.1997 / 21:19:21 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   290
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   291
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   292
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   293
    "return a string usable as initial revision string"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   294
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   295
    ^ self subclassResponsibility
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   296
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   297
    "Created: 14.2.1997 / 21:01:41 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   298
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   299
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   300
removeContainerFor:aClass inModule:moduleName directory:dirName container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   301
    "remove a container"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   302
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   303
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   304
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   305
    "Created: 11.9.1996 / 13:18:33 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   306
    "Modified: 14.2.1997 / 21:19:28 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   307
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   308
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   309
revisionLogOf:cls fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir 
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   310
    "actually do return a revisionLog. The main worker method.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   311
     This must be implemented by a concrete source-code manager"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   312
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   313
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   314
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   315
    "Created: 15.11.1995 / 18:12:51 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   316
    "Modified: 14.2.1997 / 21:14:01 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   317
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   318
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   319
!AbstractSourceCodeManager class methodsFor:'private'!
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   320
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   321
checkMethodPackagesOf:aClass
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   322
    "check if aClass contains methods from another package;
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   323
     ask if these should be checked in with the class.
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   324
     Raises abortSignal if checkIn is to be suppressed.
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   325
     returns:
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   326
        #base   - only check in methods from the classes package
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   327
        #all    - check in all"
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   328
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   329
    |checkInClassPackageOnly clsPackage otherPackages msg answer|
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   330
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   331
    checkInClassPackageOnly := false.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   332
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   333
    clsPackage := aClass package.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   334
    otherPackages := IdentitySet new.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   335
    aClass methodDictionary keysAndValuesDo:[:sel :mthd |
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   336
        |mthdPackage|
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   337
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   338
        (mthdPackage := mthd package) ~= clsPackage ifTrue:[
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   339
            otherPackages add:mthdPackage.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   340
        ]
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   341
    ].
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   342
    aClass class methodDictionary keysAndValuesDo:[:sel :mthd |
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   343
        |mthdPackage|
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   344
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   345
        (mthdPackage := mthd package) ~= clsPackage ifTrue:[
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   346
            otherPackages add:mthdPackage.
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   347
        ]
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   348
    ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   349
    otherPackages isEmpty ifTrue:[
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   350
        ^ #all
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   351
    ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   352
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
   353
    msg := 'The class ''' , aClass name asText allBold.
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   354
    otherPackages size == 1 ifTrue:[
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   355
        msg := msg , ''' contains methods for the ''%1'' package.\\Change those to belong to the ''%3'' package ?'
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   356
    ] ifFalse:[
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   357
        msg := msg , ''' contains methods for %2 other packages.\\Change those to belong to the ''%3'' package ?'
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   358
    ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   359
853
d08ab47e96f1 option dialogs default
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   360
    answer := Dialog 
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   361
                confirmWithCancel:(msg bindWith:(otherPackages first asText allBold) 
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   362
                                       with:(otherPackages size) 
853
d08ab47e96f1 option dialogs default
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   363
                                       with:clsPackage asText allBold) withCRs
d08ab47e96f1 option dialogs default
Claus Gittinger <cg@exept.de>
parents: 851
diff changeset
   364
                default:9999. "/ i.e. no default
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   365
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   366
    answer == true ifTrue:[
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   367
        ((otherPackages size > 1)
868
03a471305561 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 855
diff changeset
   368
        or:[otherPackages first ~= 'private']) ifTrue:[
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   369
            (self confirm:('Are you certain to check the other packages methods into the %1 package ?'
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   370
                          bindWith:clsPackage)) ifFalse:[
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   371
                AbortSignal raise
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   372
            ]
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   373
        ].
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   374
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   375
        "/ change all method's packageID to the classes packageId
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   376
        aClass methodDictionary keysAndValuesDo:[:sel :mthd |
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   377
            mthd package:clsPackage
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   378
        ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   379
        aClass class methodDictionary keysAndValuesDo:[:sel :mthd |
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   380
            mthd package:clsPackage
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   381
        ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   382
        ^ #all
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   383
    ].
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   384
    answer == false ifTrue:[
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   385
        (self confirm:'Ignore those methods in the classes container\\(i.e. checkin basePackage methods only) ?' withCRs) ifTrue:[
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   386
            ^ #base
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
   387
        ]
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   388
    ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   389
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   390
    AbortSignal raise
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   391
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   392
!
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   393
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   394
containerFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   395
    "given a sourceInfo, return the classes container"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   396
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   397
    (info includesKey:#fileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   398
        ^ info at:#fileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   399
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   400
    (info includesKey:#expectedFileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   401
        ^ info at:#expectedFileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   402
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   403
    ^ (info at:#classFileNameBase) , '.st'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   404
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   405
    "Modified: 12.9.1996 / 02:31:52 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   406
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   407
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   408
directoryFromContainerPath:containerPath
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   409
    "given a full path as in an RCS header, 
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   410
     extract the directory (i.e. package)."
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   411
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   412
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   413
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   414
    path := self pathInRepositoryFrom:containerPath.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   415
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   416
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   417
    "/ these are always UNIX filenames ...
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   418
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   419
    idx ~~ 0 ifTrue:[
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   420
        path := path copyFrom:(idx + 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   421
    ].
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   422
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   423
    "/ the code below used to be:
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   424
    "/     ^ path asFilename directoryName
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   425
    "/ however, that only works under UNIX, since
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   426
    "/ we MUST return a unix pathname here.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   427
    "/ therefore, do what unix would do here ...
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   428
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   429
    idx := path lastIndexOf:$/.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   430
    idx == 0 ifTrue:[
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   431
        "/ huh ?
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   432
        ^ path
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   433
    ].
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   434
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   435
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   436
    "
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   437
     CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   438
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   439
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   440
    "Created: / 25.9.1998 / 15:37:06 / cg"
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
   441
    "Modified: / 25.9.1998 / 15:38:59 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   442
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   443
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   444
filenameFromContainerPath:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   445
    "given some path as present in an RCS Header string, extract the containers
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   446
     name.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   447
     OBSOLETE - this is no longer used."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   448
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   449
    |top rest|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   450
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   451
    containerPath notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   452
        top := self repositoryTopDirectory.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   453
        top notNil ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   454
            (containerPath startsWith:(top , '/')) ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   455
                rest := containerPath copyFrom:(top size + 2).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   456
                ^ rest asFilename baseName
516
183dae704f70 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   457
            ].
183dae704f70 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   458
            (containerPath startsWith:(top)) ifTrue:[
183dae704f70 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   459
                rest := containerPath copyFrom:(top size + 1).
183dae704f70 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   460
                ^ rest asFilename baseName
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   461
            ]
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   462
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   463
    ].
185
440be89424bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   464
    ^ containerPath
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   465
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   466
    "Created: 25.11.1995 / 18:42:34 / cg"
516
183dae704f70 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   467
    "Modified: 11.11.1996 / 16:04:39 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   468
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   469
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   470
moduleFromContainerPath:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   471
    "given a full path as in an RCS header, extract the module."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   472
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   473
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   474
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   475
    path := self pathInRepositoryFrom:containerPath.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   476
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   477
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   478
    "/ these are always UNIX filenames
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   479
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   480
    idx == 0 ifTrue:[^ path].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   481
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   482
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   483
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   484
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   485
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   486
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   487
    "Created: / 25.11.1995 / 18:42:20 / cg"
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   488
    "Modified: / 11.8.1998 / 23:01:24 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   489
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   490
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   491
moduleFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   492
    "given a sourceInfo, return the classes module directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   493
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   494
    ^ info at:#module.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   495
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   496
    "Created: 6.2.1996 / 17:26:38 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   497
    "Modified: 12.9.1996 / 02:32:23 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   498
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   499
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   500
packageFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   501
    "given a sourceInfo, return the classes package directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   502
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   503
    ^ info at:#directory.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   504
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   505
    "Created: 6.2.1996 / 17:26:23 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   506
    "Modified: 12.9.1996 / 02:32:19 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   507
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   508
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   509
pathInRepositoryFrom:containerPath
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   510
    "this tries to extract the path within a repository, given some path
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   511
     as present in an RCS Header string.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   512
     Typically, this ought to be that string directly; 
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   513
     however, if the repository directory is accessed via a symbolic link during
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   514
     ci/co, some systems extract different strings with co.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   515
     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
   516
     and extracted sources had /phys/ibm/CVS in their header.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   517
     Do not depend on the code below to work correctly all the time."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   518
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
   519
    |top lastTop idx|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   520
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   521
    containerPath notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   522
        top := self repositoryTopDirectory.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   523
        top notNil ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   524
            (containerPath startsWith:(top , '/')) ifTrue:[
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   525
                ^ containerPath copyFrom:(top size + 2).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   526
            ].
515
74ee7c511219 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
   527
            (containerPath startsWith:(top)) ifTrue:[
74ee7c511219 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
   528
                ^ containerPath copyFrom:(top size + 1).
74ee7c511219 oops - rcsTop may or may not include a trailing slash
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
   529
            ].
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   530
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   531
            "/ hardcase - the repository-filename in the versionInfo
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   532
            "/ does no match my repository top.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   533
            "/ check for mangled prefix (happens with symbolic links)
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   534
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   535
            lastTop := '/' , top asFilename baseName, '/'.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   536
            idx := containerPath indexOfSubCollection:lastTop.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   537
            idx ~~ 0 ifTrue:[
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   538
                ('SourceCodeManager [warning]: warning: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintCR.
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   539
                'SourceCodeManager [info]: warning: assuming that mismatch is ok.' infoPrintCR.
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   540
                ^ containerPath copyFrom:(idx + lastTop size).
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   541
            ]
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   542
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   543
    ].
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
   544
    ^ nil
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   545
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   546
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   547
     SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   548
     SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   549
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   550
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   551
    "Created: 25.11.1995 / 18:42:20 / cg"
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   552
    "Modified: 10.1.1997 / 15:13:25 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   553
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   554
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   555
postCheckIn:aClass
871
93f994512ade checkin from browser
ps
parents: 870
diff changeset
   556
    "invoked after a checkIn"
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   557
871
93f994512ade checkin from browser
ps
parents: 870
diff changeset
   558
    Project current condenseChangesForClassCheckin:aClass.
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   559
!
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
   560
880
d438ae8d9797 checkin from browser
ps
parents: 871
diff changeset
   561
postFileIn:aClass
d438ae8d9797 checkin from browser
ps
parents: 871
diff changeset
   562
    "invoked after a fileIn"
d438ae8d9797 checkin from browser
ps
parents: 871
diff changeset
   563
d438ae8d9797 checkin from browser
ps
parents: 871
diff changeset
   564
    Project current condenseChangesForClassFilein:aClass.
d438ae8d9797 checkin from browser
ps
parents: 871
diff changeset
   565
!
d438ae8d9797 checkin from browser
ps
parents: 871
diff changeset
   566
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   567
repositoryTopDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   568
    "return the name of the repository"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   569
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   570
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   571
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   572
    "Created: 25.11.1995 / 18:38:59 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   573
    "Modified: 12.9.1996 / 02:32:40 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   574
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   575
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   576
revisionAfter:aRevisionString
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   577
    "generate the next revision number after the given number"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   578
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
   579
    |idx|
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   580
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   581
    idx := aRevisionString lastIndexOf:$..
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   582
    idx == 0 ifTrue:[
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   583
        ^ ((Integer readFrom:aRevisionString) + 1) printString
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   584
    ].
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   585
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   586
    ^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   587
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   588
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   589
     SourceCodeManager revisionAfter:'1.2.3.4' 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   590
     SourceCodeManager revisionAfter:'123'  
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   591
     SourceCodeManager revisionAfter:'1.24'  
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   592
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   593
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   594
    "Created: 20.11.1995 / 12:54:05 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   595
    "Modified: 12.9.1996 / 02:33:03 / cg"
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   596
!
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
   597
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   598
sourceCacheDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   599
    "return the sourceCache directories name"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   600
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   601
    |dir nm|
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   602
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   603
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   604
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   605
    (dir := nm asFilename) exists ifFalse:[
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   606
        dir makeDirectory.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   607
        dir exists ifFalse:[
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   608
            'SourceCodeManager [warning]: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintCR.
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   609
            ^ nil
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   610
        ].
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   611
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   612
        "/ make it read/writable for everyone
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   613
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   614
        dir makeReadableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   615
        dir makeWritableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   616
        dir makeExecutableForAll.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   617
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   618
    ^ dir
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
   619
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   620
    "Modified: 10.1.1997 / 15:13:20 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   621
!
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   622
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   623
sourceInfoOfClass:aClass
751
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   624
    "helper: return a classes sourceCodeInfo by extracting its
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   625
     versionString components."
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   626
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   627
    |cls packageInfo revInfo actualSourceFileName classFileNameBase
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
   628
     newInfo container expectedFileName
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   629
     directoryFromVersion moduleFromVersion fileNameFromVersion 
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   630
     directoryFromPackage moduleFromPackage|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   631
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   632
    cls := aClass.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   633
    cls isMeta ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   634
        cls := cls soleInstance
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   635
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   636
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   637
    newInfo := IdentityDictionary new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   638
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   639
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   640
    "/ the info given by the classes source ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   641
    "/ (i.e. its revisionString)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   642
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   643
    revInfo := aClass revisionInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   644
    revInfo notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   645
        revInfo keysAndValuesDo:[:key :value |
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   646
            newInfo at:key put:value
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   647
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   648
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   649
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   650
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   651
    "/ the info given by the classes binary ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   652
    "/ (i.e. its package-ID)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   653
    "/ if present, we better trust that one.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   654
    "/ however, it only contains partial information (module:directory:libName).
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   655
    "/ (but is available even without a source)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   656
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   657
    packageInfo := cls packageSourceCodeInfo.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   658
    packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   659
        packageInfo keysAndValuesDo:[:key :value |
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   660
            newInfo at:key put:value
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   661
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   662
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   663
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   664
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   665
    "/ no information
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   666
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   667
    (packageInfo isNil and:[revInfo isNil]) ifTrue:[
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   668
        ('SourceCodeManager [warning]: class `' , aClass name , ''' has neither source nor compiled-in info') infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   669
        ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   670
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   671
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   672
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   673
    "/ validate for conflicts
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   674
    "/ trust binary if in doubt
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   675
    "/ (in case some cheater edited the version string)
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   676
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   677
    revInfo notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   678
        (revInfo includesKey:#repositoryPathName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   679
            container := revInfo at:#repositoryPathName ifAbsent:nil.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   680
            directoryFromVersion := self directoryFromContainerPath:container.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   681
            directoryFromVersion notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   682
                newInfo at:#directory put:directoryFromVersion.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   683
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   684
            moduleFromVersion := self moduleFromContainerPath:container.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   685
            moduleFromVersion notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   686
                newInfo at:#module put:moduleFromVersion.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   687
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   688
            fileNameFromVersion := container asFilename baseName.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   689
            (fileNameFromVersion endsWith:',v') ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   690
                fileNameFromVersion := fileNameFromVersion copyWithoutLast:2.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   691
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   692
            newInfo at:#fileName put:fileNameFromVersion.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   693
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   694
            packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   695
                (packageInfo includesKey:#directory) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   696
                    directoryFromPackage := packageInfo at:#directory.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   697
                    moduleFromPackage := packageInfo at:#module.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   698
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   699
                    (directoryFromPackage ~= directoryFromVersion 
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   700
                    or:[moduleFromPackage ~= moduleFromVersion]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   701
                        (directoryFromVersion isNil or:[moduleFromVersion isNil]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   702
                            directoryFromPackage ~= 'no package' ifTrue:[
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   703
                                ('SourceCodeManager [info]: using binary info: ' 
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   704
                                    , moduleFromPackage , '/' , directoryFromPackage
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   705
                                ) infoPrintCR.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   706
                                newInfo at:#directory put:directoryFromPackage.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   707
                                newInfo at:#module put:moduleFromPackage.
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   708
                            ]
187
fdda79120bbb in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents: 185
diff changeset
   709
                        ] ifFalse:[
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   710
                            directoryFromPackage ~= 'no package' ifTrue:[
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   711
                                ('SourceCodeManager [warning]: conflicting source infos (binary: ' 
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   712
                                    , moduleFromPackage  , '/' , directoryFromPackage
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   713
                                    , ' vs. source:'
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
   714
                                    , moduleFromVersion  , '/' , directoryFromVersion
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   715
                                    , ')') infoPrintCR.
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   716
                            ]
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
   717
                        ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   718
                    ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   719
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   720
            ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   721
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   722
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   723
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   724
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   725
    "/ the filename I'd expect from its name ...
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   726
    "/
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   727
    aClass owningClass notNil ifTrue:[
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   728
        classFileNameBase := Smalltalk fileNameForClass:aClass topOwningClass
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   729
    ] ifFalse:[
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   730
        classFileNameBase := Smalltalk fileNameForClass:aClass.
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   731
    ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   732
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   733
    (newInfo includesKey:#fileName) ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   734
        newInfo at:#fileName put:(classFileNameBase , '.st')
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   735
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   736
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   737
    "/ guess on the container
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   738
    container isNil ifTrue:[
183
ca
parents: 182
diff changeset
   739
        (newInfo includesKey:#directory) ifTrue:[
ca
parents: 182
diff changeset
   740
            (newInfo includesKey:#module) ifTrue:[
705
6cdfc51d3195 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
   741
                container := (newInfo at:#module)
6cdfc51d3195 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
   742
                             , '/'
6cdfc51d3195 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
   743
                             , (newInfo at:#directory)
6cdfc51d3195 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
   744
                             , '/'
6cdfc51d3195 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
   745
                             , classFileNameBase , '.st,v'.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   746
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   747
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   748
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   749
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   750
    container notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   751
        newInfo at:#repositoryPathName put:container.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   752
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   753
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   754
    "/ check ..
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   755
    revInfo notNil ifTrue:[
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   756
        
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   757
        actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   758
        actualSourceFileName notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   759
            expectedFileName := classFileNameBase , '.st'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   760
            actualSourceFileName ~= expectedFileName ifTrue:[
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   761
                ('SourceCodeManager [warning]: source of class ' , aClass name , ' in ' , actualSourceFileName , ';') infoPrintCR.
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   762
                ('SourceCodeManager [info]: (expected: ' , expectedFileName , '); renamed or missing abbreviation ?') infoPrintCR.
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
   763
                ('SourceCodeManager [info]: This may fail to autoload later if left unchanged.') infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   764
                newInfo at:#expectedFileName put:expectedFileName.
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   765
                newInfo at:#renamed put:true.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   766
                classFileNameBase := actualSourceFileName copyWithoutLast:3
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   767
            ]
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
   768
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   769
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   770
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   771
    newInfo at:#classFileNameBase put:classFileNameBase.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   772
    ^ newInfo
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
   773
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   774
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   775
     self sourceInfoOfClass:Array
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   776
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
   777
705
6cdfc51d3195 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
   778
    "Modified: / 11.8.1998 / 23:05:05 / cg"
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   779
! !
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   780
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   781
!AbstractSourceCodeManager class methodsFor:'source code access'!
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   782
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   783
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   784
    "checkin of a class into the source repository.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   785
     Return true if ok, false if not."
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
   786
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   787
    ^ self
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   788
        checkinClass:aClass 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   789
        fileName:classFileName 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   790
        directory:packageDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   791
        module:moduleDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   792
        logMessage:logMessage
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   793
        force:false
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   794
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   795
    "Modified: 11.9.1996 / 16:15:43 / cg"
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   796
!
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   797
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   798
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   799
    "checkin of a class into the source repository.
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   800
     Return true if ok, false if not."
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   801
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   802
    |tempDir tempFile ok packageMode filter|
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   803
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   804
    packageMode := self checkMethodPackagesOf:aClass.
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   805
    packageMode == #base ifTrue:[
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   806
        filter := [:mthd | mthd package = aClass package].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   807
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   808
619
16b4d6ffaa0e Fix checkinClass:fileName:directory:module... (makeDirectory returns
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   809
    tempDir := (Filename newTemporaryIn:nil) makeDirectory; yourself.
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   810
    ok := false.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   811
    [
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   812
        |aStream|
75
ea3dcbdb0401 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 73
diff changeset
   813
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   814
        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
   815
        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
   816
        aStream isNil ifTrue:[
375
476a8a705f0d show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
   817
            'SOURCEMGR: temporary fileout failed' errorPrintCR.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   818
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   819
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   820
184
e682441f91cb flush methods fileCache before filingOut
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   821
        Method flushSourceStreamCache.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   822
        Class fileOutErrorSignal handle:[:ex |
375
476a8a705f0d show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
   823
            'SOURCEMGR: fileout failed.' errorPrintCR.
476a8a705f0d show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
   824
            'SOURCEMGR: reason: ' errorPrint. ex errorString printCR.
476a8a705f0d show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
   825
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   826
            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
   827
            ^ false
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   828
        ] do:[
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   829
            aClass 
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   830
                fileOutOn:aStream 
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   831
                withTimeStamp:false 
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   832
                withInitialize:true 
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   833
                withDefinition:true
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   834
                methodFilter:filter
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   835
        ].
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   836
        aStream close.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   837
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   838
        tempFile exists ifFalse:[
375
476a8a705f0d show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
   839
            'SOURCEMGR: temporary fileout failed' errorPrintCR.
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   840
        ] ifTrue:[
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   841
            ok := self 
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   842
                checkinClass:aClass
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   843
                fileName:classFileName 
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   844
                directory:packageDir 
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   845
                module:moduleDir
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   846
                source:(tempFile name)
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   847
                logMessage:logMessage
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   848
                force:force.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   849
        ]
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   850
    ] 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
   851
        tempDir recursiveRemove
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   852
    ].
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   853
    ^ ok
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   854
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   855
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   856
     SourceCodeManager checkinClass:Array
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   857
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   858
375
476a8a705f0d show reason why fileOut failed (on stderr)
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
   859
    "Modified: 12.7.1996 / 23:38:36 / cg"
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   860
    "Created: 11.9.1996 / 16:15:17 / cg"
619
16b4d6ffaa0e Fix checkinClass:fileName:directory:module... (makeDirectory returns
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   861
    "Modified: 25.9.1997 / 12:16:00 / stefan"
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   862
!
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   863
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   864
checkinClass:aClass logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   865
    "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
   866
     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
   867
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   868
    |sourceInfo packageDir moduleDir classFileName|
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   869
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   870
    sourceInfo := self sourceInfoOfClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   871
    sourceInfo isNil ifTrue:[
537
240d5b2ab16c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   872
        ('SourceCodeManager [warning]: no sourceInfo for class: ' , aClass name) errorPrintCR.
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   873
        ^ false
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   874
    ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   875
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   876
    packageDir := self packageFromSourceInfo:sourceInfo.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   877
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   878
    classFileName := self containerFromSourceInfo:sourceInfo.
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   879
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   880
    ^ self 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   881
        checkinClass:aClass 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   882
        fileName:classFileName 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   883
        directory:packageDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   884
        module:moduleDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   885
        logMessage:logMessage
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   886
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   887
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   888
    "
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   889
     SourceCodeManager checkinClass:Array logMessage:'foo'
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   890
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   891
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
   892
    "Created: 6.11.1995 / 18:56:00 / cg"
537
240d5b2ab16c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   893
    "Modified: 10.1.1997 / 17:26:48 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   894
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   895
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   896
getMostRecentSourceStreamForClassNamed:aClassName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   897
    "given a class, return an open stream to its most recent source
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   898
     (not knowing anything about its version).
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   899
     Used when autoloading classes."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   900
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   901
    ^ self
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   902
        getMostRecentSourceStreamForClassNamed:aClassName 
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   903
        inPackage:nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   904
!
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   905
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   906
getMostRecentSourceStreamForClassNamed:aClassName inPackage:forcedPackage
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   907
    "given a class, return an open stream to its most recent source
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   908
     (not knowing anything about its version).
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   909
     Used when autoloading classes or to compare a classes source with the most
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   910
     recent found in the repostitory.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   911
     The forcePackage argument passes the classes package information
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   912
     and is only required when autoloading or when the class is not already
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   913
     present (i.e. there is no way to extract the package info).
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   914
     If nil, the package is extracted from the class - which must exist."
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   915
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   916
    |cls sourceInfo classFileName packageDir moduleDir s m components i|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   917
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   918
    cls := Smalltalk classNamed:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   919
    cls notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   920
        sourceInfo := self sourceInfoOfClass:cls.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   921
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   922
    sourceInfo notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   923
        packageDir := self packageFromSourceInfo:sourceInfo.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   924
        moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   925
        classFileName := self containerFromSourceInfo:sourceInfo.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   926
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   927
        classFileName := (Smalltalk fileNameForClass:aClassName) , '.st'.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   928
        packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   929
        packageDir notNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   930
            (packageDir startsWith:'stx/') ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   931
                packageDir := packageDir copyFrom:5.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   932
            ] ifFalse:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   933
                i := packageDir indexOf:$:.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   934
                i ~~ 0 ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   935
                    moduleDir := packageDir copyTo:i-1.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   936
                    packageDir := packageDir copyFrom:i+1
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   937
                ]
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   938
            ]
744
eaf185681d85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   939
        ].
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   940
        moduleDir isNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   941
            moduleDir := 'stx'
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
   942
        ].
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   943
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   944
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   945
    packageDir isNil ifTrue:[
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   946
        forcedPackage isNil ifTrue:[
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   947
            'SourceCodeManager [warning]: could not extract packageDir' errorPrintCR.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   948
            ^ nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   949
        ].
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   950
        packageDir := forcedPackage copyFrom:(forcedPackage indexOf:$/) + 1.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   951
        moduleDir := forcedPackage copyTo:(forcedPackage indexOf:$/) - 1.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   952
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   953
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   954
    s := self 
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   955
        streamForClass:nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   956
        fileName:classFileName 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   957
        revision:#newest 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   958
        directory:packageDir 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
   959
        module:moduleDir
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   960
        cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   961
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   962
    s isNil ifTrue:[
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   963
        "/ guessed moduleDir ?
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   964
        
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   965
        sourceInfo isNil ifTrue:[
611
b1fb7d133e17 filename changes
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   966
            components := Filename concreteClass components:packageDir.
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   967
            moduleDir := components first.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   968
            packageDir := (Filename fromComponents:(components copyFrom:2)) asString.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   969
            s := self 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   970
                streamForClass:nil
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   971
                fileName:classFileName 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   972
                revision:#newest 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   973
                directory:packageDir 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   974
                module:moduleDir
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   975
                cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   976
        ]
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   977
    ].
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   978
    ^ s.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   979
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   980
    "Created: 12.10.1996 / 17:22:54 / cg"
611
b1fb7d133e17 filename changes
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   981
    "Modified: 8.9.1997 / 00:21:27 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   982
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   983
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   984
getSourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   985
    "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
   986
     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
   987
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   988
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   989
    ^ self getSourceStreamFor:aClass revision:nil
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   990
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   991
    "Created: 12.10.1996 / 17:21:03 / cg"
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   992
    "Modified: 12.10.1996 / 17:22:02 / cg"
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   993
!
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   994
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
   995
getSourceStreamFor:aClass revision:aRevisionStringOrNil
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
   996
    "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
   997
     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
   998
     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
   999
     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
  1000
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1001
    |classFileName revision 
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1002
     packageDir moduleDir sourceInfo|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1003
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  1004
    aRevisionStringOrNil isNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1005
        revision := aClass binaryRevision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1006
        revision isNil ifTrue:[ 
191
ebdb455a26ce take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents: 187
diff changeset
  1007
            revision := aClass revision.
ebdb455a26ce take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents: 187
diff changeset
  1008
            revision isNil ifTrue:[
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1009
                ('SourceCodeManager [warning]: class `' , aClass name , ''' has no revision string') infoPrintCR.
191
ebdb455a26ce take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents: 187
diff changeset
  1010
                ^ nil.
ebdb455a26ce take revision if no binaryRevision is available (in sourceStream for ...)
ca
parents: 187
diff changeset
  1011
            ].
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1012
            ('SourceCodeManager [info]: trusting classes revision ...') infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1013
        ]
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  1014
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1015
        revision := aRevisionStringOrNil
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1016
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1017
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1018
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1019
    sourceInfo isNil ifTrue:[^ nil].
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1020
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1021
    packageDir := self packageFromSourceInfo:sourceInfo.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1022
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1023
    classFileName := self containerFromSourceInfo:sourceInfo.
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1024
    ^ self 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1025
        streamForClass:aClass
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1026
        fileName:classFileName 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1027
        revision:revision 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1028
        directory:packageDir 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1029
        module:moduleDir
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1030
        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
  1031
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1032
    "Created: / 12.10.1996 / 17:21:52 / cg"
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1033
    "Modified: / 11.8.1998 / 22:33:41 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1034
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  1035
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1036
!AbstractSourceCodeManager class methodsFor:'source code administration'!
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
  1037
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1038
getExistingContainersInModule:aModule package:aPackage
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1039
    "{ Pragma: +optSpace }"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1040
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1041
    "return a collection containing the names of existing containers"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1042
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1043
    ^ self subclassResponsibility
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1044
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1045
    "Modified: / 29.1.1997 / 18:57:29 / cg"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1046
    "Created: / 20.5.1998 / 19:49:12 / cg"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1047
!
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  1048
676
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1049
getExistingModules
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1050
    "{ Pragma: +optSpace }"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1051
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1052
    "return a collection containing the names of existing modules"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1053
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1054
    ^ self subclassResponsibility
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1055
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1056
    "Modified: / 29.1.1997 / 18:57:29 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1057
    "Created: / 20.5.1998 / 19:38:23 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1058
!
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1059
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1060
getExistingPackagesInModule:aModule
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1061
    "{ Pragma: +optSpace }"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1062
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1063
    "return a collection containing the names of existing packages"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1064
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1065
    ^ self subclassResponsibility
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1066
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1067
    "Modified: / 29.1.1997 / 18:57:29 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1068
    "Created: / 20.5.1998 / 19:38:34 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1069
!
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1070
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1071
initialRCSRevisionStringFor:aClass in:dir container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1072
    "return a string usable as initial revision string"
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1073
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1074
    "/ do not make the string below into one string;
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1075
    "/ RCS would expand it into a wrong rev-string
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1076
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1077
    |nm oldRev idx special|
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1078
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1079
    nm := fileName.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1080
    (nm endsWith:',v') ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1081
        nm := nm copyWithoutLast:2
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1082
    ].
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1083
    (nm endsWith:'.st') ifFalse:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1084
        nm := nm , '.st'
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1085
    ].
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1086
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1087
    oldRev := aClass revisionString.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1088
    special := ''.
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1089
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1090
    oldRev notNil ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1091
        idx := oldRev lastIndexOf:$[.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1092
        idx ~~ 0 ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1093
            idx := oldRev indexOf:$[ startingAt:idx+1.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1094
            idx ~~ 0 ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1095
                special := ' ' , (oldRev copyFrom:idx).
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1096
            ]
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1097
        ]
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1098
    ].
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1099
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1100
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1101
    ^ '$' , 'Header: ' , dir , '/' , fileName , ',v $'
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1102
      , special
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1103
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1104
    "Modified: 17.9.1996 / 15:57:15 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1105
    "Created: 14.2.1997 / 20:59:28 / cg"
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1106
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  1107
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1108
newestRevisionInFile:classFileName directory:packageDir module:moduleDir
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1109
    "return the newest revision found in a container.
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1110
     Return nil on failure."
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1111
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1112
    |log|
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1113
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1114
    log := self
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1115
            revisionLogOf:nil 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1116
            fromRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1117
            toRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1118
            fileName:classFileName 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1119
            directory:packageDir 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1120
            module:moduleDir.
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1121
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1122
    log isNil ifTrue:[^ nil].
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1123
    ^ log at:#newestRevision ifAbsent:nil
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1124
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1125
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1126
     SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx'       
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1127
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1128
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1129
    "Modified: 10.1.1997 / 13:31:42 / cg"
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1130
!
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1131
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1132
newestRevisionLogEntryOf:aClass
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1133
    "return the newest revisions log found in the repository.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1134
     Return nil on failure."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1135
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1136
    ^ self revisionLogOf:aClass fromRevision:0 toRevision:0.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1137
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1138
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1139
     SourceCodeManager newestRevisionLogEntryOf:Array       
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1140
     SourceCodeManager newestRevisionLogEntryOf:Connection 
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1141
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1142
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1143
    "Modified: 10.1.1997 / 13:30:36 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1144
    "Created: 29.1.1997 / 18:50:12 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1145
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1146
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1147
newestRevisionOf:aClass
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1148
    "return the newest revision (as string) found in the repository.
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1149
     Return nil on failure."
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1150
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1151
    |log|
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1152
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1153
    log := self revisionLogOf:aClass fromRevision:0 toRevision:0.
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1154
    log isNil ifTrue:[^ nil].
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1155
    ^ log at:#newestRevision ifAbsent:nil
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1156
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1157
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1158
     SourceCodeManager newestRevisionOf:Array       
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1159
     SourceCodeManager newestRevisionOf:Connection 
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1160
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1161
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1162
    "Modified: 10.1.1997 / 13:30:36 / cg"
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1163
!
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  1164
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1165
revisionInfoFromRCSString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1166
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1167
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1168
    "return a dictionary filled with revision info.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1169
     This extracts the relevant info from aString."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1170
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1171
    |words info nm mgr|
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1172
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1173
    info := IdentityDictionary new.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1174
    words := aString asCollectionOfWords.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1175
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1176
    words notEmpty ifTrue:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1177
        "/
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1178
        "/ supported formats:
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1179
        "/
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1180
        "/ $-Header: pathName rev date time user state $
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1181
        "/ $-Revision: rev $
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1182
        "/ $-Id: fileName rev date time user state $
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1183
        "/
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1184
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1185
        ((words at:1) = '$Header:') ifTrue:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1186
            nm := words at:2.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1187
            info at:#repositoryPathName put:nm.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1188
            (nm endsWith:',v') ifTrue:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1189
                nm := nm copyWithoutLast:2
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1190
            ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1191
            info at:#fileName put:nm asFilename baseName.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1192
            words size > 2 ifTrue:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1193
                (words at:3) = '$' ifFalse:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1194
                    info at:#revision put:(words at:3).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1195
                    (words at:4) = '$' ifFalse:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1196
                        info at:#date put:(words at:4).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1197
                        info at:#time put:(words at:5).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1198
                        info at:#user put:(words at:6).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1199
                        info at:#state put:(words at:7).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1200
                    ]
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1201
                ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1202
            ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1203
            ^ info
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1204
        ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1205
        ((words at:1) = '$Revision:') ifTrue:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1206
            info at:#revision put:(words at:2).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1207
            ^ info
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1208
        ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1209
        ((words at:1) = '$Id:') ifTrue:[
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1210
            info at:#fileName put:(words at:2).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1211
            info at:#revision put:(words at:3).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1212
            info at:#date put:(words at:4).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1213
            info at:#time put:(words at:5).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1214
            info at:#user put:(words at:6).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1215
            info at:#state put:(words at:7).
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1216
            ^ info
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1217
        ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1218
    ].
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1219
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1220
    ^ nil
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1221
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1222
    "
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  1223
     SourceCodeManager revisionInfoFromString:'$Revision: 1.115 $'
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1224
     SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1225
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1226
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1227
    "Modified: 29.1.1997 / 18:56:31 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1228
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1229
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1230
revisionInfoFromString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1231
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1232
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1233
    "return a dictionary filled with revision info.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1234
     This extracts the relevant info from aString."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1235
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1236
    ^ self subclassResponsibility
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1237
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1238
    "Created: 29.1.1997 / 18:54:52 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1239
    "Modified: 29.1.1997 / 18:57:29 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1240
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  1241
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1242
revisionLogInFile:classFileName directory:packageDir module:moduleDir
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1243
    "return info about the repository container and
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1244
     (part of) the revisionlog as a collection of revision entries.
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1245
     Return nil on failure.
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1246
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1247
     The returned information is a structure (IdentityDictionary)
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1248
     filled with:
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1249
            #container          -> the RCS container file name 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1250
            #filename           -> the actual source file name
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1251
            #newestRevision     -> the revisionString of the newest revision
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1252
            #numberOfRevisions  -> the number of revisions in the container
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1253
            #revisions          -> collection of per-revision info (see below)
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1254
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1255
            per revision info consists of one record per revision:
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1256
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1257
              #revision              -> the revision string
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1258
              #author                -> who checked that revision into the repository
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1259
              #date                  -> when was it checked in
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1260
              #state                 -> the RCS state
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1261
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1262
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1263
            revisions are ordered newest first 
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1264
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1265
                  the first for the most recent one)
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1266
        "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1267
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1268
    ^ self
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1269
        revisionLogOf:nil 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1270
        fromRevision:nil 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1271
        toRevision:nil 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1272
        fileName:classFileName 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1273
        directory:packageDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1274
        module:moduleDir
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1275
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1276
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1277
     CVSSourceCodeManager
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1278
        revisionLogInFile:'Array.st' directory:'libbasic' module:'stx'
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1279
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1280
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1281
    "Modified: 10.1.1997 / 13:29:06 / cg"
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1282
!
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  1283
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1284
revisionLogOf:aClass
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1285
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1286
     the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1287
     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
  1288
     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
  1289
     filled with:
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1290
	    #container          -> the RCS container file name
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1291
	    #filename           -> the actual source file name
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1292
	    #newestRevision     -> the revisionString of the newest revision
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1293
	    #numberOfRevisions  -> the number of revisions in the container
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1294
	    #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
  1295
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1296
	    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
  1297
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1298
	      #revision              -> the revision string
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1299
	      #author                -> who checked that revision into the repository
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1300
	      #date                  -> when was it checked in
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1301
	      #state                 -> the RCS state
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1302
	      #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
  1303
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1304
	    revisions are ordered newest first 
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1305
	    (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
  1306
	"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1307
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1308
    ^ self
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1309
	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
  1310
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1311
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1312
     SourceCodeManager revisionLogOf:Array 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1313
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1314
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1315
    "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
  1316
    "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
  1317
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1318
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1319
revisionLogOf:aClass fromRevision:rev1
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1320
    "return info about the repository container and
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1321
     (part of) the revisionlog as a collection of revision entries.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1322
     Return nil on failure.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1323
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1324
     The returned information is a structure (IdentityDictionary)
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1325
     filled with:
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1326
            #container          -> the RCS container file name 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1327
            #filename           -> the actual source file name
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1328
            #newestRevision     -> the revisionString of the newest revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1329
            #numberOfRevisions  -> the number of revisions in the container
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1330
            #revisions          -> collection of per-revision info (see below)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1331
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1332
         for some classes, additional info is returned:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1333
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1334
            #renamed            -> true if the class has been renamed or copied
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1335
                                   and the sourceInfo is from the previous one
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1336
            #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
  1337
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1338
            rev1 specifies from which revisions a logEntry is wanted:
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1339
              If rev1 is nil, the first revision is the initial revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1340
              otherwise, the log starts with that revision.
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1341
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1342
            per revision info consists of one record per revision:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1343
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1344
              #revision              -> the revision string
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1345
              #author                -> who checked that revision into the repository
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1346
              #date                  -> when was it checked in
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1347
              #state                 -> the RCS state
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1348
              #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
  1349
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1350
            revisions are ordered newest first 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1351
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1352
                  the first for the most recent one)
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1353
        "
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1354
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1355
    ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1356
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1357
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1358
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40'
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1359
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1360
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1361
    "Created: 6.11.1995 / 18:56:00 / cg"
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1362
    "Modified: 10.1.1997 / 13:29:50 / cg"
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1363
!
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  1364
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1365
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1366
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1367
     (part of) the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1368
     Return nil on failure.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1369
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1370
     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
  1371
     filled with:
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1372
            #container          -> the RCS container file name 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1373
            #filename           -> the actual source file name
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1374
            #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
  1375
            #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
  1376
            #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
  1377
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1378
         for some classes, additional info is returned:
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1379
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1380
            #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
  1381
                                   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
  1382
            #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
  1383
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1384
            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
  1385
              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
  1386
              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
  1387
              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
  1388
              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
  1389
              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
  1390
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1391
            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
  1392
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1393
              #revision              -> the revision string
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1394
              #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
  1395
              #date                  -> when was it checked in
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1396
              #state                 -> the RCS state
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1397
              #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
  1398
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1399
            revisions are ordered newest first 
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1400
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1401
                  the first for the most recent one)
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1402
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1403
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1404
    |sourceInfo packageDir moduleDir classFileName info|
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1405
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1406
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1407
    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
  1408
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1409
    packageDir := self packageFromSourceInfo:sourceInfo.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1410
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1411
    classFileName := self containerFromSourceInfo:sourceInfo.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1412
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1413
    info := self 
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1414
        revisionLogOf:aClass
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1415
        fromRevision:rev1 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1416
        toRevision:rev2
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1417
        fileName:classFileName
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1418
        directory:packageDir 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1419
        module:moduleDir.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1420
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1421
    info notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1422
"/        (sourceInfo includesKey:#renamed) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1423
"/            info at:#renamed put:(sourceInfo at:#renamed)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1424
"/        ].
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1425
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1426
            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
  1427
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1428
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1429
    ^ info
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1430
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1431
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1432
     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
  1433
     SourceCodeManager revisionLogOf:XtBoxNew 
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1434
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1435
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1436
    "Created: 6.11.1995 / 18:56:00 / cg"
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  1437
    "Modified: 10.1.1997 / 13:30:00 / cg"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1438
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1439
213
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1440
revisionsOf:aClass
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1441
    "return a collection of revisions (as strings) found in the repository.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1442
     The most recent (newest) revision will be the first in the list.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1443
     Return nil on failure."
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1444
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1445
    |log revisions|
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1446
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1447
    log := self revisionLogOf:aClass.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1448
    log isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1449
    revisions := log at:#revisions ifAbsent:nil.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1450
    revisions isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1451
    ^ revisions collect:[:rev | rev at:#revision].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1452
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1453
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1454
     SourceCodeManager revisionsOf:Array       
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1455
     SourceCodeManager newestRevisionOf:Array 
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1456
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1457
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1458
    "Modified: 10.4.1996 / 23:14:24 / cg"
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1459
    "Created: 19.4.1996 / 17:24:34 / cg"
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1460
!
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  1461
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1462
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1463
    "send a full historyLog to some stream.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1464
     This walks over all possible repository roots."
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1465
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1466
    |inStream  recordType fileName user date time rev pkgDir 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1467
     clsName cls clsRev goalString prevUser roots  
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1468
     revInfo cvsRoot prevCvsRoot|
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1469
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1470
    goalString := ''.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1471
    (timeGoal notNil and:[timeGoal notEmpty]) ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1472
        goalString := ' since ' , timeGoal.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1473
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1474
    userFilter notNil ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1475
        goalString := ', for user' , user
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1476
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1477
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1478
    aStream nextPutLine:'**** source repository history' , goalString , ' ****'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1479
    aStream cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1480
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1481
    self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1482
        reportHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1483
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1484
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1485
        filterRepository:repositoryFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1486
        inTo:[:info |
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1487
            user := info at:#user ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1488
            recordType := info at:#cvsRecordType ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1489
            fileName := info at:#fileName ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1490
            date := info at:#date ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1491
            time := info at:#time ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1492
            rev := info at:#revision ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1493
            pkgDir := info at:#directory ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1494
            clsName := info at:#className ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1495
            cvsRoot := info at:#cvsRoot ifAbsent:'?'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1496
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1497
            cvsRoot ~= prevCvsRoot ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1498
                aStream cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1499
                aStream nextPutLine:'>>>> repository: ' , cvsRoot , ' <<<<'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1500
                aStream cr; cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1501
                aStream nextPutLine:'  date  time        user                     file    rev        module/package'.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1502
                prevUser := nil.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1503
                prevCvsRoot := cvsRoot.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1504
            ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1505
            prevUser ~= user ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1506
                aStream cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1507
                prevUser := user.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1508
            ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1509
            aStream nextPutAll:recordType; space; 
904
1db5b3ee4b37 *** empty log message ***
ps
parents: 880
diff changeset
  1510
                    nextPutAll:(date printString paddedTo:5); space; nextPutAll:(time printString paddedTo:5); space;
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1511
                    nextPutAll:(user leftPaddedTo:10); space;             
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1512
                    nextPutAll:(fileName leftPaddedTo:24); space;                 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1513
                    nextPutAll:(rev decimalPaddedTo:8 and:3 at:$. withLeft:(Character space) right:nil); tab;              
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1514
                    nextPutAll:(pkgDir paddedTo:20).
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1515
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1516
            "/
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1517
            "/ for your convenience:
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1518
            "/  check what the actual version is in the image
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1519
            "/
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1520
            clsName notNil ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1521
                revInfo := nil.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1522
                cls := Smalltalk classNamed:clsName.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1523
                (cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1524
                    rev ~= clsRev ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1525
                        revInfo := (' current: ' , clsRev)
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1526
                    ]
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1527
                ] ifFalse:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1528
                    cls isNil ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1529
                        revInfo := (' current: ** none **')
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1530
                    ] ifFalse:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1531
                        cls isLoaded not ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1532
                            revInfo := (' current: not loaded')
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1533
                        ] ifFalse:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1534
                            revInfo := (' current: ** no revision info **')
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1535
                        ]    
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1536
                    ]
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1537
                ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1538
                revInfo notNil ifTrue:[
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1539
                    aStream nextPutAll:revInfo
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1540
                ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1541
            ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1542
            aStream cr                              
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1543
        ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1544
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1545
    "Created: / 13.12.1995 / 10:28:27 / cg"
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1546
    "Modified: / 28.9.1998 / 16:47:08 / cg"
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1547
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1548
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1549
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1550
    "send a full historyLog to some stream.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1551
     This walks over all possible repository roots."
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1552
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1553
    ^ self
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1554
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1555
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1556
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1557
        filterRepository:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1558
        to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1559
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1560
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1561
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1562
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1563
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1564
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1565
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1566
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1567
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1568
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1569
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1570
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1571
    "Modified: 12.9.1996 / 02:36:32 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1572
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1573
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1574
writeHistoryLogSince:timeGoal to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1575
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1576
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1577
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1578
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1579
        filterSTSources:true 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1580
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1581
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1582
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1583
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1584
    "Created: 13.12.1995 / 10:28:27 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1585
    "Modified: 12.9.1996 / 02:36:38 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1586
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  1587
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1588
writeRevisionLogMessagesFrom:log to:aStream
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1589
    "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
  1590
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  1591
    ^ self writeRevisionLogMessagesFrom:log withHeader:true to:aStream
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1592
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1593
    "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
  1594
!
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1595
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1596
writeRevisionLogMessagesFrom:log withHeader:header to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1597
    "helper; send the revisionlog to aStream"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1598
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1599
    header ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1600
"/        (log at:#renamed ifAbsent:false) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1601
"/            aStream nextPutAll:'  Class was probably renamed; revision info is from original class.'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1602
"/            aStream cr; nextPutAll:'  You may have to create a new container for it.'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1603
"/            aStream cr; cr.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1604
"/        ].
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  1605
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1606
        aStream nextPutAll:'  Total revisions: '; nextPutLine:(log at:#numberOfRevisions) printString.
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1607
        aStream nextPutAll:'  Newest revision: '; nextPutLine:(log at:#newestRevision) printString.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1608
    ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1609
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1610
    (log at:#revisions) do:[:entry |
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1611
        |logMsg|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1612
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1613
        aStream cr.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1614
        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
  1615
        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
  1616
        aStream nextPutAll:' author: '; nextPutAll:(entry at:#author); tab.
549
8b4035c43732 Add lines: +xx -yy to revision log.
Stefan Vogel <sv@exept.de>
parents: 545
diff changeset
  1617
        aStream nextPutAll:' lines: '; nextPutAll:(entry at:#numberOfChangedLines).
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1618
        aStream cr.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1619
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1620
        logMsg := entry at:#logMessage.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1621
        (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
  1622
            logMsg := '*** empty log message ***'
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  1623
        ].
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1624
        aStream tab; nextPutLine:logMsg.
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1625
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1626
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1627
    "Created: 16.11.1995 / 13:25:30 / cg"
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1628
    "Modified: 8.11.1996 / 23:52:48 / cg"
549
8b4035c43732 Add lines: +xx -yy to revision log.
Stefan Vogel <sv@exept.de>
parents: 545
diff changeset
  1629
    "Modified: 27.11.1996 / 18:26:30 / stefan"
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1630
!
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1631
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  1632
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1633
    "extract a classes log and append it to aStream."
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1634
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1635
    |log |
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1636
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1637
    log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1638
    log isNil ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1639
        aStream nextPutAll:'** No revision log available **'.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1640
        ^ false
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1641
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1642
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1643
    self writeRevisionLogMessagesFrom:log to:aStream.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1644
    ^ true
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1645
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1646
    "
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  1647
     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
  1648
    "
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1649
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  1650
    "Created: 6.11.1995 / 18:56:00 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  1651
    "Modified: 14.2.1997 / 21:11:57 / cg"
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  1652
!
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  1653
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1654
writeRevisionLogOf:aClass to:aStream
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1655
    "extract a classes log and append it to aStream."
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1656
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1657
    ^ self
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1658
	writeRevisionLogOf:aClass fromRevision:nil toRevision:nil to:aStream
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  1659
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1660
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1661
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1662
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  1663
! !
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  1664
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  1665
!AbstractSourceCodeManager class methodsFor:'documentation'!
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1666
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  1667
version
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  1668
    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.115 2000-03-29 18:34:06 cg Exp $'
123
9a1dff152656 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 122
diff changeset
  1669
! !
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
  1670
AbstractSourceCodeManager initialize!