AbstractSourceCodeManager.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 04 Oct 2014 13:29:36 +0200
changeset 3631 c9ab267ee5d5
parent 3629 23e8091856fa
child 3647 41283198781e
permissions -rw-r--r--
Oops, fixes to class fileout to handle non-ASCII code correctly. Let the source code writer to check if special encoder is required.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
     3
              All Rights Reserved
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    13
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#AbstractSourceCodeManager
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    15
	instanceVariableNames:''
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    16
	classVariableNames:'DefaultManager CachingSources CacheDirectoryName UseWorkTree
2866
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
    17
		WorkTreeDirectoryName ManagerPerModule Verbose'
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    18
	poolDictionaries:''
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    19
	category:'System-SourceCodeManagement'
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
2445
vrany
parents: 2443
diff changeset
    22
Object subclass:#PackageAndManager
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    23
	instanceVariableNames:'package managerTypeName'
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    24
	classVariableNames:''
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    25
	poolDictionaries:''
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
    26
	privateIn:AbstractSourceCodeManager
2445
vrany
parents: 2443
diff changeset
    27
!
vrany
parents: 2443
diff changeset
    28
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    29
!AbstractSourceCodeManager class methodsFor:'documentation'!
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
copyright
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 COPYRIGHT (c) 1995 by Claus Gittinger
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
    34
              All Rights Reserved
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 This software is furnished under a license and may be used
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 only in accordance with the terms of that license and with the
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 inclusion of the above copyright notice.   This software may not
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 be provided or otherwise made available to, or used by, any
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 other person.  No title to or ownership of the software is
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    43
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    44
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    45
documentation
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    46
"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    47
    Abstract superclass for sourceCodeManagers.
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    48
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    49
    Concrete subclasses provide access to a source repository.
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    50
    Most protocol here traps into subclassResponsbility errors.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    51
    Please read more documentation in concrete subclasses 
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    52
    (especially: CVSSourceCodeManager) for how to use this manager and
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    53
    what to redefine in another repository manager if required.
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    54
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    55
    [author:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    56
        Claus Gittinger
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    57
"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
    58
! !
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    60
!AbstractSourceCodeManager class methodsFor:'initialization'!
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    61
2647
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    62
forgetDisabledModules
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    63
    ^ self
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    64
!
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    65
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    66
initCacheDirPath
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    67
    "initialize the name of the cacheDirectory.
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    68
     This is:
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    69
        <tempDir>/stx_sourceCache (non-UNIX)
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    70
        ~/.smalltalk/source-cache (UNIX, as <tempDir> is pruned upon each reboot)
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    71
    "
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    72
    "JV@2012-03-14: Changed to use .smalltalk/source-cache on UNIX machines"
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    73
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    74
    OperatingSystem isUNIXlike ifTrue:[
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    75
        CacheDirectoryName := '~/.smalltalk/sourceCache'.
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    76
        ^self
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    77
    ].
2231
d4c1c8005b69 changed: #initCacheDirPath
Claus Gittinger <cg@exept.de>
parents: 2227
diff changeset
    78
    CacheDirectoryName := (Filename defaultTempDirectory constructString:'stx_sourceCache').
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    79
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    80
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    81
    "
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    82
     self initCacheDirPath     
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    83
    "
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    84
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    85
    "Modified: / 12-07-1999 / 10:01:31 / cg"
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    86
    "Modified (comment): / 19-07-2012 / 14:03:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    87
!
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
initialize
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    90
    "setup for no caching and no workTree"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    91
1930
74929dd929d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
    92
    CachingSources isNil ifTrue:[CachingSources := false].
74929dd929d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
    93
    UseWorkTree    isNil ifTrue:[UseWorkTree := false].
3587
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    94
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    95
    self validateCacheDirPath.
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    96
    Smalltalk addDependent:self
2788
99dd9025c611 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2786
diff changeset
    97
99dd9025c611 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2786
diff changeset
    98
    "Modified: / 02-03-2012 / 17:00:11 / cg"
3587
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
    99
!
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   100
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   101
update:something with:aParameter from:changedObject
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   102
    "flush resources on language changes"
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   103
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   104
    something == #returnFromSnapshot ifTrue:[
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   105
        self validateCacheDirPath
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   106
    ]
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   107
!
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   108
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   109
validateCacheDirPath
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   110
    (CacheDirectoryName isNil 
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   111
    or:[CacheDirectoryName asFilename exists not]) ifTrue:[
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   112
        self initCacheDirPath   
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   113
    ].
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   114
! !
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   115
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   116
!AbstractSourceCodeManager class methodsFor:'accessing'!
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   117
1729
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   118
availableManagers
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   119
    ^ AbstractSourceCodeManager allSubclasses 
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   120
        reject:[:cls | (cls isAbstract) or:[cls isExperimental ]].
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   121
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   122
    "
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   123
     self availableManagers   
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   124
    "
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   125
!
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   126
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   127
cacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   128
    "return the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   129
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   130
     This cache is shared among all ST/X users on a system."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   131
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   132
    ^ CacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   133
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   134
    "Modified: 12.9.1996 / 02:20:45 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   135
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   136
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   137
cacheDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   138
    "set the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   139
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   140
     This cache is shared among all ST/X users on a system.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   141
     The directory is typically set via the launchers setting menu, or
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   142
     from a startup rc-file."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   143
2451
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   144
    CacheDirectoryName := aStringOrFilename.
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   145
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   146
    "HACK, HACK, since ManagerPerModule is lazy-initialize before
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   147
     preferences are read, sigh. We need a better system..."
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   148
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   149
    ManagerPerModule := nil.
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   150
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   151
    "Created: / 16-12-1995 / 15:18:43 / cg"
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   152
    "Modified: / 12-09-1996 / 02:21:35 / cg"
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   153
    "Modified (comment): / 09-07-2011 / 16:02:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   154
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   155
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   156
cachingSources
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   157
    "return true, if source caching is enabled.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   158
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   159
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   160
    ^ CachingSources
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   161
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   162
    "Created: 16.12.1995 / 15:17:50 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   163
    "Modified: 12.9.1996 / 02:22:19 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   164
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   165
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   166
cachingSources:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   167
    "enable/disable the caching of source files.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   168
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   169
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   170
    CachingSources := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   171
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   172
    "Created: 16.12.1995 / 15:18:13 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   173
    "Modified: 12.9.1996 / 02:22:42 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   174
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   175
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   176
defaultManager
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   177
    "return the default sourceCodeManager class"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   178
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   179
    ^ DefaultManager
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   180
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   181
    "Created: 7.12.1995 / 17:14:22 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   182
    "Modified: 12.9.1996 / 02:22:56 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   183
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   184
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   185
enabledManagers
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   186
    "Return list of source code managers that are enabled"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   187
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   188
    "If source code management is disabled, return #(). Following code
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   189
     is hack since  there is no global boolean flag, sigh"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   190
    ^(Smalltalk at:#SourceCodeManager) isNil ifTrue:[
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   191
        #()
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   192
    ] ifFalse:[
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   193
        self availableManagers select:[:manager|manager enabled].  
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   194
    ]
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   195
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   196
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   197
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   198
    "
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   199
     self enabledManagers   
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   200
    "
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   201
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   202
    "Created: / 23-01-2012 / 19:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   203
!
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   204
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   205
managerForMatchingModule:aPackageIDMatchString put:aSourceCodeManagerClass
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   206
    "update the per-module manager definitions, adding a manager class for a matchString"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   207
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   208
    ManagerPerModule isNil ifTrue:[
2446
vrany
parents: 2445
diff changeset
   209
        ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   210
    ].
2445
vrany
parents: 2443
diff changeset
   211
    ManagerPerModule do:[:each |
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   212
        |packageMatch|
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   213
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
   214
        packageMatch := each package.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   215
        (packageMatch = aPackageIDMatchString) ifTrue:[
2445
vrany
parents: 2443
diff changeset
   216
            each manager:aSourceCodeManagerClass.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   217
            ^ self
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   218
        ].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   219
    ].
2445
vrany
parents: 2443
diff changeset
   220
    ManagerPerModule add:
vrany
parents: 2443
diff changeset
   221
        (PackageAndManager 
vrany
parents: 2443
diff changeset
   222
            package: aPackageIDMatchString 
vrany
parents: 2443
diff changeset
   223
            manager: aSourceCodeManagerClass)
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   224
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   225
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   226
     self managerForModule:'stx:libbasic2' put:SVNSourceCodeManager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   227
     self managerForModule:'stx:libbasic2' put:CVSSourceCodeManager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   228
     self managerForModule:'stx:libbasic2'
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   229
     self managerForModule:'exept:expecco' 
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   230
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   231
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   232
    "Created: / 18-04-2011 / 19:48:19 / cg"
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
   233
    "Modified: / 07-07-2013 / 10:40:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   234
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   235
2557
vrany
parents: 2552
diff changeset
   236
managerForPackage:aPackageID
vrany
parents: 2552
diff changeset
   237
    "return the sourceCodeManager for a aPackageID, nil if unspecified in the manager per package list"
vrany
parents: 2552
diff changeset
   238
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   239
    "JV@2012-01-23: If source code management is disabled, return nil. Following code
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   240
     is hack since  there is no global boolean flag, sigh"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   241
    (Smalltalk at:#SourceCodeManager) isNil ifTrue:[ ^nil ].
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   242
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   243
    "JV@2012-01-23: HACK: Q: Shouldn't it filter configured manager through
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   244
     'enabled' managers?"         
2446
vrany
parents: 2445
diff changeset
   245
    self managerPerMatchingModuleDefinitions do:[:each |
vrany
parents: 2445
diff changeset
   246
        (each match:aPackageID) ifTrue:[^ each manager].
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   247
    ].
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   248
    ^ DefaultManager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   249
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   250
    "
3230
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
   251
     self managerForPackage:'stx:libbasic' 
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
   252
     self managerForPackage:'stx:libbasic2'
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
   253
     self managerForPackage:'exept:expecco'  
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   254
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   255
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   256
    "Created: / 18-04-2011 / 19:39:19 / cg"
2557
vrany
parents: 2552
diff changeset
   257
    "Created: / 10-10-2011 / 14:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   258
    "Modified: / 19-10-2011 / 16:45:38 / cg"
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   259
    "Modified (comment): / 23-01-2012 / 19:46:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   260
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   261
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   262
managerPerMatchingModuleDefinitions
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   263
    "return the sourceCodeManager definitions"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   264
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   265
    ManagerPerModule isNil ifTrue:[
2445
vrany
parents: 2443
diff changeset
   266
        ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   267
    ].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   268
    ^ ManagerPerModule
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   269
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   270
    "Created: / 18-04-2011 / 20:09:16 / cg"
2445
vrany
parents: 2443
diff changeset
   271
    "Modified: / 09-07-2011 / 13:36:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   272
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   273
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   274
managerPerMatchingModuleDefinitions:aCollection
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   275
    "set the sourceCodeManager definitions; must be an orderedCollection of packageMatchString -> manager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   276
     associations 
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   277
     (not a dictionary, because order is relevant in the matching process, where the first match counts)"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   278
2445
vrany
parents: 2443
diff changeset
   279
    ManagerPerModule := aCollection.
vrany
parents: 2443
diff changeset
   280
    UserPreferences current managerPerMatchingModuleDefinitions:aCollection
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   281
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   282
    "Created: / 18-04-2011 / 20:09:21 / cg"
2445
vrany
parents: 2443
diff changeset
   283
    "Modified: / 09-07-2011 / 13:36:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
   284
!
vrany
parents: 2443
diff changeset
   285
vrany
parents: 2443
diff changeset
   286
named: managerTypeName
vrany
parents: 2443
diff changeset
   287
vrany
parents: 2443
diff changeset
   288
    ^self availableManagers 
vrany
parents: 2443
diff changeset
   289
        detect:[:each|each managerTypeName = managerTypeName]
vrany
parents: 2443
diff changeset
   290
        ifNone:[nil]
vrany
parents: 2443
diff changeset
   291
vrany
parents: 2443
diff changeset
   292
    "
vrany
parents: 2443
diff changeset
   293
        AbstractSourceCodeManager named: 'CVS'
vrany
parents: 2443
diff changeset
   294
        AbstractSourceCodeManager named: 'Perforce'        
vrany
parents: 2443
diff changeset
   295
    "
vrany
parents: 2443
diff changeset
   296
vrany
parents: 2443
diff changeset
   297
    "Created: / 09-07-2011 / 13:51:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   298
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   299
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   300
repositoryInfoPerModule
2145
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   301
    "return the dictionary, which associates CVSRoots to module names.
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   302
     If no entry is contained in this dictionary for some module,
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   303
     the default cvsRoot (CVSRoot) will be used."
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   304
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   305
    ^ #()
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   306
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   307
    "Created: / 09-11-2006 / 15:25:17 / cg"
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   308
!
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   309
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   310
repositoryInfoPerModule:info
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   311
    "/ ignore here
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   312
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   313
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   314
repositoryName
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   315
    "return the name of the repository.
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   316
     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
   317
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   318
    ^ nil
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   319
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   320
    "Modified: 12.9.1996 / 02:20:45 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   321
    "Created: 14.9.1996 / 13:21:37 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   322
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   323
2592
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   324
repositoryNameForPackage:packageId 
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   325
    "Return the repository ULR for the given package. 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   326
     Used for testing/debugging source code management configuration"
2592
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   327
    
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   328
    ^ self subclassResponsibility
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   329
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   330
    "Created: / 10-10-2011 / 19:44:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   331
    "Modified (comment): / 21-12-2011 / 23:03:00 / cg"
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   332
!
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   333
2700
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   334
shownInBrowserMenus
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   335
    "can be redefined in subclasses which can be suppressed in the browser's menus"
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   336
2728
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   337
    ^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') ifAbsent:false.
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   338
2700
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   339
    "Created: / 08-01-2012 / 19:56:22 / cg"
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   340
!
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   341
2728
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   342
shownInBrowserMenus:aBoolean
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   343
    "can be redefined in subclasses which can be suppressed in the browser's menus"
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   344
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   345
    ^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') put:aBoolean.
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   346
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   347
    "Created: / 15-01-2012 / 14:09:21 / cg"
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   348
!
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   349
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   350
useWorkTree
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   351
    "return the setting of useWorkTree, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   352
     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
   353
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   354
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   355
    ^ UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   356
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   357
    "Created: 16.12.1995 / 15:36:48 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   358
    "Modified: 12.9.1996 / 02:24:01 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   359
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   360
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   361
useWorkTree:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   362
    "enable/disable the useWorkTree feature, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   363
     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
   364
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   365
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   366
    UseWorkTree := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   367
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   368
    "Created: 16.12.1995 / 15:37:29 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   369
    "Modified: 12.9.1996 / 02:24:38 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   370
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   371
2557
vrany
parents: 2552
diff changeset
   372
utilities
2936
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   373
    "Returns a 'utilities' object that can be used by tools. 
2557
vrany
parents: 2552
diff changeset
   374
vrany
parents: 2552
diff changeset
   375
     By default, it returns an instance of
vrany
parents: 2552
diff changeset
   376
     SourceCodeManagerUtilities with receiver as its
vrany
parents: 2552
diff changeset
   377
     manager, but individual managers may override this
vrany
parents: 2552
diff changeset
   378
     method and supply its own, customized utilities."
vrany
parents: 2552
diff changeset
   379
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   380
    ^ (self isContainerBased
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   381
            ifTrue: [ SourceCodeManagerUtilitiesForContainerBasedManagers ]
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   382
            ifFalse: [ SourceCodeManagerUtilitiesForWorkspaceBasedManagers ]
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   383
      ) forManager: self
2557
vrany
parents: 2552
diff changeset
   384
2936
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   385
    "
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   386
     SourceCodeManager defaultManager
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   387
     SourceCodeManager defaultManager utilities
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   388
    "
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   389
2557
vrany
parents: 2552
diff changeset
   390
    "Created: / 10-10-2011 / 15:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   391
    "Modified (format): / 25-07-2012 / 17:08:05 / cg"
2557
vrany
parents: 2552
diff changeset
   392
!
vrany
parents: 2552
diff changeset
   393
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   394
workTreeDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   395
    "return the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   396
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   397
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   398
    ^ WorkTreeDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   399
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   400
    "Created: 16.12.1995 / 15:35:21 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   401
    "Modified: 12.9.1996 / 02:25:13 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   402
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   403
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   404
workTreeDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   405
    "set the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   406
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   407
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   408
    WorkTreeDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   409
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   410
    "Created: 16.12.1995 / 15:35:34 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   411
    "Modified: 12.9.1996 / 02:25:19 / cg"
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   412
! !
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   413
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   414
!AbstractSourceCodeManager class methodsFor:'basic access'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   415
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   416
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
   417
    "checkin of a class into the source repository.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   418
     Return true if ok, false if not."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   419
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   420
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   421
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   422
    "Created: 14.2.1997 / 21:17:33 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   423
    "Modified: 14.2.1997 / 21:18:48 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   424
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   425
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   426
checkoutModule:aModule directory:aPackage andDo:aBlock
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   427
    "check out everything from a package into a temporary directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   428
     Then evaluate aBlock, passing the name of that temp-directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   429
     Afterwards, the tempDir is removed.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   430
     Return true, if OK, false if any error occurred."
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   431
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   432
    ^ self subclassResponsibility
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   433
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   434
    "Created: / 23-08-2006 / 14:07:08 / cg"
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   435
!
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   436
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   437
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
   438
    "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
   439
     A revision of nil selects the current (in image) revision.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   440
     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
   441
     which itself is extracted from the classes packageString."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   442
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   443
    ^ self subclassResponsibility
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   444
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   445
    "Modified: 14.2.1997 / 21:18:35 / cg"
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   446
!
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   447
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   448
streamForExtensionFile:fileName package:package directory:dir module:mod cache:doCache
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   449
    |defClass extensionsRevisionString extensionsRevisionInfo rev|
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   450
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   451
    defClass := ProjectDefinition definitionClassForPackage:package.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   452
    extensionsRevisionString := defClass perform:(self nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   453
    extensionsRevisionString isNil ifTrue:[
3385
b4a3a5381e7c class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3371
diff changeset
   454
        Transcript showCR:'SourceCodeManager [warning]: no valid version info for extensions of "',package,'"'.
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   455
        ^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   456
    ].
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   457
2399
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   458
    extensionsRevisionInfo := self revisionInfoFromString:extensionsRevisionString inClass:nil.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   459
    extensionsRevisionInfo isNil ifTrue:[
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   460
        self halt:'oops - possibly corrupted extensions version string'.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   461
        "/ check for umlaut-remover/adder bug from felix in extensionsRevisionString !!!!!!!!
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   462
        ^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   463
    ].
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   464
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   465
    self assert:(fileName = 'extensions.st').
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   466
    self assert:(fileName = extensionsRevisionInfo fileName).
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   467
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   468
    rev := extensionsRevisionInfo revision.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   469
    ^ self streamForClass:nil fileName:fileName revision:rev directory:dir module:mod cache:doCache.
2399
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   470
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   471
    "Modified: / 01-07-2011 / 13:52:38 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   472
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   473
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   474
!AbstractSourceCodeManager class methodsFor:'basic administration'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   475
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   476
checkForExistingContainer:fileName inModule:moduleName directory:dirName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   477
    "check for a container to be present"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   478
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   479
    ^ self subclassResponsibility.
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   480
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   481
    "Created: / 13-09-2006 / 18:22:24 / cg"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   482
!
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   483
1785
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   484
checkForExistingContainer:fileName inPackage:aPackage
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   485
    "check if a source-code container is present in a packages directory."
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   486
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   487
    |packageDir moduleDir|
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   488
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   489
    packageDir := aPackage asPackageId directory.
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   490
    moduleDir := aPackage asPackageId module. 
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   491
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   492
    ^ self 
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   493
        checkForExistingContainer:fileName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   494
        inModule:moduleDir 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   495
        directory:packageDir
1785
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   496
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   497
    "Created: / 13-09-2006 / 18:10:30 / cg"
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   498
!
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   499
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   500
checkForExistingContainerForClass:aClass
1013
c455100cbaa8 comments added
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   501
    "check if a source-code container for a given class is present in the repository."
c455100cbaa8 comments added
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   502
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   503
    |sourceInfo packageDir moduleDir classFileName|
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   504
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   505
    sourceInfo := self sourceInfoOfClass:aClass.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   506
    sourceInfo isNil ifTrue:[
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   507
        ('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
   508
        ^ false
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   509
    ].
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   510
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   511
    packageDir := self directoryFromSourceInfo:sourceInfo.
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   512
    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
   513
    classFileName := self containerFromSourceInfo:sourceInfo.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   514
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   515
    ^ self 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   516
        checkForExistingContainer:classFileName 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   517
        inModule:moduleDir 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   518
        directory:packageDir
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   519
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   520
    "Created: / 13-05-1998 / 22:35:50 / cg"
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   521
    "Modified: / 13-09-2006 / 18:23:20 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   522
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   523
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   524
checkForExistingModule:moduleName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   525
    "check for a module directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   526
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   527
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   528
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   529
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   530
    "Modified: 14.2.1997 / 21:19:01 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   531
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   532
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   533
checkForExistingModule:moduleDir directory:packageDir
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   534
    "check for a package directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   535
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   536
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   537
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   538
    "Created: / 23-08-2006 / 14:03:06 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   539
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   540
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   541
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   542
    "create a new container & check into it an initial version of aClass"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   543
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   544
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   545
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   546
    "Created: 9.12.1995 / 19:02:47 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   547
    "Modified: 14.2.1997 / 21:19:11 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   548
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   549
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   550
createContainerFor:cls inModule:moduleName package:packageDir container:classFileName
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   551
    "create a new container & check into it an initial version of aClass"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   552
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   553
    ^ self checkinClass:cls fileName:classFileName directory:packageDir module:moduleName logMessage:'Initial check in' force:false.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   554
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   555
    "Created: / 23-07-2012 / 19:14:34 / cg"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   556
!
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   557
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   558
createModule:moduleName
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   559
    "create a new module directory"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   560
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   561
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   562
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   563
    "Created: 9.12.1995 / 19:02:23 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   564
    "Modified: 14.2.1997 / 21:19:16 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   565
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   566
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   567
createModule:module directory:directory
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   568
    "create a new package directory"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   569
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   570
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   571
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   572
    "Created: / 23-08-2006 / 14:04:41 / cg"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   573
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   574
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   575
initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   576
    "return a string usable as initial revision string"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   577
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   578
    ^ self subclassResponsibility
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   579
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   580
    "Created: / 23-08-2006 / 14:05:42 / cg"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   581
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   582
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   583
revisionLogOf:clsOrNil 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   584
    fromRevision:firstRev toRevision:lastRef 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   585
    fileName:classFileName directory:packageDir module:moduleDir 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   586
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   587
    ^ self 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   588
        revisionLogOf:clsOrNil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   589
        fromRevision:firstRev
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   590
        toRevision:lastRef
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   591
        numberOfRevisions:nil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   592
        fileName:classFileName
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   593
        directory:packageDir
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   594
        module:moduleDir
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   595
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   596
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   597
revisionLogOf:clsOrNil 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   598
    fromRevision:rev1OrNil toRevision:rev2OrNil numberOfRevisions:limitOrNil 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   599
    fileName:classFileName directory:packageDir module:moduleDir 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   600
3484
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   601
    "Return info about the repository container and (part of) the revisionlog as a collection 
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   602
     of revision entries. Return nil on failure.
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   603
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   604
     This must be implemented by a concrete source-code manager
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   605
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   606
     If numRevisionsOrNil is notNil, it limits the number of revision records returned -
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   607
     only numRevions of the newest revision infos will be collected.
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   608
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   609
     The returned information is a structure (IdentityDictionary)
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   610
     filled with:
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   611
            #container          -> the RCS/CVS container file name 
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   612
            #cvsRoot            -> the CVS root (repository) 
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   613
            #filename           -> the actual source file name
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   614
            #newestRevision     -> the revisionString of the newest revision
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   615
            #numberOfRevisions  -> the number of revisions in the container (nil for all)
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   616
            #revisions          -> collection of per-revision info (see below)
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   617
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   618
            firstRevOrNil / lastRevOrNil specify from which revisions a logEntry is wanted:
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   619
             -If firstRevOrNil is nil, the first revision is the initial revision
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   620
              otherwise, the log starts with that revision.
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   621
             -If lastRevOrNil is nil, the last revision is the newest revision
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   622
              otherwise, the log ends with that revision.
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   623
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   624
             -If both are nil, all logEntries are extracted.
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   625
             -If both are 0 (not nil), no logEntries are extracted (i.e. only the header).
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   626
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   627
            per revision info consists of one record per revision:
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   628
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   629
              #revision              -> the revision string
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   630
              #author                -> who checked that revision into the repository
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   631
              #date                  -> when was it checked in
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   632
              #state                 -> the RCS state
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   633
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   634
              #logMessage            -> the checkIn log message
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   635
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   636
            revisions are ordered newest first 
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   637
            (i.e. the last entry is for the initial revision; the first for the most recent one)
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   638
            Attention: if state = 'dead' that revision is no longer valid.
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   639
        "
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   640
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   641
    self subclassResponsibility
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   642
3484
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   643
    "Created: / 15-11-1995 / 18:12:51 / cg"
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   644
    "Modified: / 14-02-1997 / 21:14:01 / cg"
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   645
    "Modified: / 11-02-2014 / 13:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   646
! !
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   647
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   648
!AbstractSourceCodeManager class methodsFor:'cache administration'!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   649
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   650
condenseSourceCache
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   651
    "remove all cached old versions (i.e. leave the newest only)"
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   652
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   653
    |extractBaseAndVersion versionIsGreater vsnNumberString baseName|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   654
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   655
    CacheDirectoryName isNil ifTrue:[^ self].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   656
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   657
    extractBaseAndVersion := 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   658
        [:filenameString |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   659
            |i|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   660
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   661
            i := filenameString size.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   662
            [i > 0 and:[(filenameString at:i) isDigit or:[(filenameString at:i) == $.]]] whileTrue:[ i := i - 1 ].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   663
            vsnNumberString := filenameString copyFrom:i + 1.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   664
            (filenameString at:i) == $_ ifTrue:[i := i - 1].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   665
            baseName := filenameString copyTo:i.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   666
        ].        
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   667
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   668
    versionIsGreater :=
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   669
        [:vA :vB |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   670
            |seqA seqB sequenceIsGreater|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   671
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   672
            seqA := (vA asCollectionOfSubstringsSeparatedBy:$.) collect:[:each | Integer readFrom:each].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   673
            seqB := (vB asCollectionOfSubstringsSeparatedBy:$.) collect:[:each | Integer readFrom:each].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   674
            sequenceIsGreater :=
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   675
                [:seqA :seqB :index |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   676
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   677
                    |elA elB|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   678
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   679
                    elA := seqA at:index.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   680
                    elB := seqB at:index.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   681
                    elA > elB ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   682
                        true
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   683
                    ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   684
                        elA < elB ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   685
                            false
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   686
                        ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   687
                            sequenceIsGreater value:seqA value:seqB value:index+1.
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   688
                        ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   689
                    ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   690
                ].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   691
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   692
            sequenceIsGreater value:seqA value:seqB value:1.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   693
        ].    
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   694
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   695
    CacheDirectoryName asFilename withAllDirectoriesDo:[:d |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   696
        |allFiles newestVersions|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   697
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   698
        newestVersions := Dictionary new.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   699
        allFiles := d files.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   700
        allFiles do:[:eachFilename |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   701
            |prevVsnString|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   702
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   703
            extractBaseAndVersion value:eachFilename baseName.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   704
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   705
            vsnNumberString notEmpty ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   706
                prevVsnString := newestVersions at:baseName ifAbsent:nil.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   707
                prevVsnString isNil ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   708
                    newestVersions at:baseName put:vsnNumberString.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   709
                ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   710
                    (versionIsGreater value:vsnNumberString value:prevVsnString) ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   711
                        newestVersions at:baseName put:vsnNumberString
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   712
                    ]
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   713
                ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   714
            ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   715
        ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   716
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   717
        allFiles do:[:eachFilename |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   718
            extractBaseAndVersion value:eachFilename baseName.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   719
            (vsnNumberString isEmpty 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   720
            or:[(vsnNumberString ~= (newestVersions at:baseName))]) ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   721
                eachFilename remove
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   722
            ]
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   723
        ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   724
    ]
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   725
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   726
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   727
     self condenseSourceCache
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   728
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   729
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   730
    "Modified: / 29-08-2006 / 11:25:25 / cg"
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   731
!
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   732
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   733
flushSourceCache
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   734
    "remove all cached versions"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   735
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   736
    |d|
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   737
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   738
    CacheDirectoryName notNil ifTrue:[
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   739
        d := CacheDirectoryName asFilename.
1860
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   740
        d isDirectory ifTrue:[
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   741
            d directoryContentsAsFilenames do:[:eachFile |
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   742
                eachFile recursiveRemove
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   743
            ]
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   744
        ].
2550
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   745
    ].
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   746
    Method flushSourceStreamCache.
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   747
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   748
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   749
     self flushSourceCache
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   750
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   751
2550
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   752
    "Modified: / 30-09-2011 / 13:33:33 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   753
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   754
2866
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   755
!AbstractSourceCodeManager class methodsFor:'debugging'!
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   756
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   757
verboseSourceCodeAccess
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   758
    ^ Verbose ? false
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   759
!
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   760
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   761
verboseSourceCodeAccess:aBoolean
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   762
    Verbose := aBoolean
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   763
! !
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   764
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   765
!AbstractSourceCodeManager class methodsFor:'obsolete backward compatibility'!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   766
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   767
checkForExistingContainerInModule:moduleDir directory:packageDir container:fileName
2082
1220f55f306b Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 2052
diff changeset
   768
    <resource: #obsolete>
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   769
    "check for a container to exist"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   770
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   771
    self obsoleteMethodWarning.
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   772
    ^ self checkForExistingContainer:fileName inModule:moduleDir directory:packageDir
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   773
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   774
    "Modified: / 13-09-2006 / 18:23:45 / cg"
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   775
!
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   776
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   777
checkForExistingContainerInModule:moduleName package:dirName container:fileName
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   778
    "check for a container to be present"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   779
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   780
    <resource: #obsolete>
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   781
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   782
    self obsoleteMethodWarning.
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   783
    ^ self 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   784
        checkForExistingContainer:fileName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   785
        inModule:moduleName 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   786
        directory:dirName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   787
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   788
    "Modified: / 13-09-2006 / 18:23:35 / cg"
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   789
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   790
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   791
checkForExistingModule:moduleDir package:packageDir
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   792
    "check for a package directory to be present"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   793
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   794
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   795
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   796
    ^ self checkForExistingModule:moduleDir directory:packageDir.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   797
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   798
    "Created: / 09-12-1995 / 19:02:23 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   799
    "Modified: / 23-08-2006 / 14:03:25 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   800
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   801
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   802
checkoutModule:aModule package:aPackage andDo:aBlock
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   803
    "check out everything from a package into a temporary directory.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   804
     Then evaluate aBlock, passing the name of that temp-directory.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   805
     Afterwards, the tempDir is removed.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   806
     Return true, if OK, false if any error occurred."
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   807
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   808
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   809
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   810
    ^ self checkoutModule:aModule directory:aPackage andDo:aBlock
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   811
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   812
    "Modified: / 23-08-2006 / 14:07:31 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   813
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   814
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   815
createModule:module package:package
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   816
    "create a new package directory"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   817
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   818
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   819
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   820
    ^ self createModule:module directory:package.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   821
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   822
    "Created: / 09-12-1995 / 19:02:23 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   823
    "Modified: / 23-08-2006 / 14:04:59 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   824
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   825
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   826
getExistingContainersInModule:aModule package:aPackage
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   827
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   828
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   829
    "return a collection containing the names of existing containers"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   830
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   831
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   832
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   833
    ^ self getExistingContainersInModule:aModule directory:aPackage
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   834
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   835
    "Created: / 20-05-1998 / 19:49:12 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   836
    "Modified: / 23-08-2006 / 14:12:24 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   837
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   838
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   839
getExistingPackagesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   840
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   841
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   842
    "return a collection containing the names of existing packages"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   843
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   844
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   845
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   846
    ^ self getExistingDirectoriesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   847
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   848
    "Created: / 20-05-1998 / 19:38:34 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   849
    "Modified: / 23-08-2006 / 14:14:04 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   850
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   851
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   852
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   853
    "return a string usable as initial revision string"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   854
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   855
    <resource: #obsolete>
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
   856
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   857
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   858
    ^ self initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   859
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   860
    "Created: / 14-02-1997 / 21:01:41 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   861
    "Modified: / 23-08-2006 / 14:06:18 / cg"
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
   862
    "Modified (format): / 21-12-2011 / 18:58:53 / cg"
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   863
! !
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   864
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   865
!AbstractSourceCodeManager class methodsFor:'private'!
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   866
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   867
checkMethodPackagesOf:aClass
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   868
    "check if aClass contains methods from another package;
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   869
     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
   870
     Raises abortSignal if checkIn is to be suppressed.
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   871
     returns:
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   872
        #base   - only check in methods from the classes package
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   873
        #all    - check in all
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   874
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   875
     the old code looked for all extensions, and allowed them to be moved to the base-package.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   876
     This was dangerous, as if one presses yes too quickly, extensions move to the base too easy.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   877
     The new code only allows for extensions from the __NOPROJECT__ package to be moved.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   878
     Extensions always remain extensions, and must be moved by an explicit method-menu action.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   879
    "
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   880
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   881
    |checkInClassPackageOnly clsPackage otherPackages otherPackageNames methodsFromOtherPackages
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   882
     methodCategoriesInOtherPackages methodCategoryInOtherPackages
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   883
     msg answer isDefaultAnswer labels actions hasUnassignedExtensions
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   884
     unassignedMethods methodCategoriesWithUnassignedMethods methodCategoryWithUnassignedMethods 
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
   885
     args anyPackageChange|
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   886
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   887
    checkInClassPackageOnly := false.
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   888
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   889
    clsPackage := aClass package.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   890
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   891
    otherPackages := Set new.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   892
    methodsFromOtherPackages := OrderedCollection new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   893
    hasUnassignedExtensions := false.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   894
    unassignedMethods := OrderedCollection new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   895
    methodCategoriesWithUnassignedMethods := Set new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   896
    methodCategoriesInOtherPackages := Set new.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   897
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   898
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   899
        |mthdPackage|
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   900
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   901
        (mthdPackage := mthd package) ~= clsPackage ifTrue:[
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   902
            mthdPackage = PackageId noProjectID ifTrue:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   903
                hasUnassignedExtensions := true.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   904
                unassignedMethods add:mthd.        
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   905
                methodCategoriesWithUnassignedMethods add:(mthd category).
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   906
            ] ifFalse:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   907
                methodsFromOtherPackages add:mthd.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   908
                otherPackages add:mthdPackage.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   909
                methodCategoriesInOtherPackages add:(mthd category).
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   910
            ].
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   911
        ]
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   912
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   913
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   914
    hasUnassignedExtensions ifFalse:[
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   915
        aClass allPrivateClassesDo:[:eachPrivateClass |
1028
e839e2bcf1d7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
   916
            aClass setPackage:clsPackage.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   917
            eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   918
                mthd setPackage:clsPackage
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   919
            ]
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   920
        ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   921
        ^ #base
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   922
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   923
1029
2bb7575ddf46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   924
    otherPackages := otherPackages asOrderedCollection sort.
2043
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   925
    otherPackageNames := 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   926
        String streamContents:[:stream| 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   927
            otherPackages 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   928
                do:[:eachPackageName| eachPackageName printOn:stream] 
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   929
                separatedBy:[stream nextPutAll:', '].
d90c7d3c1ef5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2030
diff changeset
   930
        ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   931
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   932
    methodCategoriesInOtherPackages size == 1 ifTrue:[
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   933
        methodCategoryInOtherPackages := methodCategoriesInOtherPackages anElement.
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   934
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   935
    methodCategoriesWithUnassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   936
        methodCategoryWithUnassignedMethods := methodCategoriesWithUnassignedMethods anElement.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   937
    ].
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   938
1021
0448114aab01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1018
diff changeset
   939
    isDefaultAnswer := false.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   940
    (SourceCodeManagerUtilities yesToAllNotification notNil 
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   941
    and:[SourceCodeManagerUtilities yesToAllNotification isHandled]) ifTrue:[
1021
0448114aab01 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1018
diff changeset
   942
        answer := isDefaultAnswer := true.
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   943
    ] ifFalse:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   944
        methodCategoriesWithUnassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   945
            unassignedMethods size == 1 ifTrue:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   946
                msg := 'The class ''%1'' contains the unassigned (loose) method: %6'.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   947
            ] ifFalse:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   948
                msg := 'The class ''%1'' contains %3 unassigned (loose) method(s)'.
2468
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
   949
            ].
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
   950
            msg := msg , '\(In the ''%4'' category).'.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   951
        ] ifFalse:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   952
            msg := 'The class ''%1'' contains %3 unassigned (loose) methods in %5 categories.'.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   953
        ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   954
        unassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   955
            msg := msg , '\\Move this method to the ''%2'' package ?'.
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
   956
            msg := msg , '\\Hint: if this is meant to be an extension of another package,\move it to the appropriate package and checkIn the extension(s).'.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   957
        ] ifFalse:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   958
            msg := msg , '\\Move those to the ''%2'' package ?'.
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
   959
            msg := msg , '\\Hint: if these are meant to be extensions of another package,\move them to the appropriate package and checkIn the extensions.'.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
   960
        ].
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
   961
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   962
        args := Array
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   963
                    with:aClass name allBold
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   964
                    with:clsPackage allBold
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   965
                    with:unassignedMethods size
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   966
                    with:methodCategoryWithUnassignedMethods
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   967
                    with:methodCategoriesWithUnassignedMethods size
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   968
                    with:unassignedMethods first selector allBold.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   969
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   970
        SourceCodeManagerUtilities yesToAllNotification isHandled       
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   971
        ifTrue:[
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   972
            labels := #('Cancel' 'No' 'Browse' 'Yes to all' 'Yes').
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   973
            actions := #(#cancel false #browse #yesToAll true).
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   974
        ] ifFalse:[
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   975
            labels := #('Cancel' 'No' 'Browse' 'Yes').
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   976
            actions := #(#cancel false #browse true).
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   977
        ].
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   978
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   979
        answer := OptionBox 
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   980
                      request:(SystemBrowser classResources
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   981
                                stringWithCRs:msg
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   982
                                withArgs:args) 
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
   983
                      label:'Change packageID ?'
1392
4469708537e8 dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents: 1348
diff changeset
   984
                      image:(InfoBox iconBitmap)
1218
7bf09a49d58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1217
diff changeset
   985
                      buttonLabels:(Dialog resources array:labels)
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
   986
                      values:actions
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
   987
                      default:true.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   988
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   989
        answer == #browse ifTrue:[
3318
267b801d90e0 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3280
diff changeset
   990
            UserPreferences systemBrowserClass
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   991
                browseMethods:unassignedMethods
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   992
                title:('Unassigned (loose) Methods in %1' bindWith:aClass name)
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   993
                sort:true.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   994
            answer := #cancel.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   995
        ].
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   996
"/        answer == #browseExtensions ifTrue:[
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   997
"/            UserPreferences current systemBrowserClass
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   998
"/                browseMethods:methodsFromOtherPackages
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   999
"/                title:('Extensions for %1' bindWith:aClass name)
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1000
"/                sort:true.
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1001
"/            answer := #cancel.
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1002
"/        ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1003
    ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1004
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1005
    answer == #cancel ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1006
        AbortSignal raise
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1007
    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1008
    answer == #yesToAll ifTrue:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1009
        SourceCodeManagerUtilities yesToAllNotification raiseWith:true.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1010
        answer := true.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1011
    ].
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
  1012
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1013
    "/ ok, move them over
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
  1014
    answer == true ifTrue:[
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1015
        "/ change all method's packageID to the classes packageId
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1016
        anyPackageChange := false.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1017
        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2208
a66ff7ef9153 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2202
diff changeset
  1018
            mthd package == PackageId noProjectID ifTrue:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1019
                mthd makeLocalStringSource.
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1020
                mthd setPackage:clsPackage.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1021
                anyPackageChange := true.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1022
            ]
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1023
        ].
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1024
        aClass allPrivateClassesDo:[:eachPrivateClass |
1028
e839e2bcf1d7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  1025
            aClass setPackage:clsPackage.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1026
            eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1027
                mthd package ~= clsPackage ifTrue:[
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1028
                    mthd makeLocalStringSource.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1029
                    mthd setPackage:clsPackage.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1030
                    anyPackageChange := true.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1031
                ]
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1032
            ]
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1033
        ].
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1034
        anyPackageChange ifTrue:[
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1035
            aClass changed:#projectOrganization.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1036
            Smalltalk changed:#projectOrganization with:(Array with:aClass). 
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1037
        ].
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1038
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1039
    ^ #base
1112
c395948357d3 care for userPref-browser-setting (in browse-action)
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1040
2468
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
  1041
    "Modified: / 24-07-2011 / 07:13:58 / cg"
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1042
!
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1043
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1044
checkTabSpaceConventionIn: aStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1045
    "This method checks whether data in given stream follows 
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1046
     tab-space discipline.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1047
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1048
     More precisely, this checks that each line starts with zero or more
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1049
     tabs (16r9) followed by 0-7 spaces (16r32) followed by non-space non-tab
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1050
     character.
3510
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1051
     This is done for two reasons:
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1052
      1) Makefiles (and Make.proto/Make.spec) files MUST not have leading spaces in their rules, but tabs.
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1053
        otherwise, make fails badly.
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1054
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1055
      2) for diff-comparison, a consisten tab/space discipline avoids false diff-positivies, which resulted from simple
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1056
        edititing with different editors with different tab conventions.
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1057
     "
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1058
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1059
    | checkStream |
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1060
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1061
    aStream isFileStream ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1062
        aStream flush.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1063
        checkStream := aStream pathName asFilename readStream .
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1064
    ] ifFalse:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1065
        aStream isExternalStream not ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1066
            checkStream := aStream contents asString readStream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1067
        ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1068
    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1069
    [
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1070
        [ checkStream atEnd ] whileFalse:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1071
            | line done nspaces |
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1072
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1073
            nspaces := 0.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1074
            line := checkStream nextLine readStream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1075
            done := line atEnd.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1076
            [ done ] whileFalse:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1077
                | c |
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1078
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1079
                c := line next.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1080
                c == Character space ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1081
                    nspaces := nspaces + 1.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1082
                    nspaces == 8 ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1083
"/                        self breakPoint: #jv info: 'Oops, every consecutive 8 spaces should be a tab!! CHECK THE CALLER NOW!!!!!!'.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1084
"/ 
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1085
                        "/ There are only two solutions: either (i) relax the rule and do not make any conversion
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1086
                        "/ (ii) or write a sed script to fix all sources, commit and then debug why it is so,
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1087
                        "/ Otherwise, we merging will forever be pain in the...
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1088
                        self breakPoint: #cg info: 'Oops, every consecutive 8 spaces should be a tab!! CHECK THE CALLER NOW!!!!!!'.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1089
                    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1090
                ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1091
                c == Character tab  ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1092
                    nspaces ~~ 0 ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1093
"/                        self breakPoint: #jv info: 'Oops, spaces followed by tab!! CHECK THE CALLER NOW!!!!!!'.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1094
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1095
                        "/ There are only two solutions: either (i) relax the rule and do not make any conversion
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1096
                        "/ (ii) or write a sed script to fix all sources, commit and then debug why it is so,
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1097
                        "/ Otherwise, we merging will forever be pain in the...
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1098
                        self breakPoint: #cg info: 'Oops, spaces followed by tab!! CHECK THE CALLER NOW!!!!!!'.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1099
                    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1100
                ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1101
                done := (c ~~ Character space  and:[c ~~ Character tab ]) or:[line atEnd].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1102
            ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1103
        ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1104
    ] ensure:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1105
        checkStream close.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1106
    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1107
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1108
    "
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1109
    Good:
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1110
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[9 32 32 32 32 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1111
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 9 32 32 32 32 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1112
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1113
    Bad:
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1114
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[32 32 32 32  32 32 32 32 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1115
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1116
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 9 32 32 32 32 32 32 32 32 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1117
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[97 10 10 10 32 32 32 32 9 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1118
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1119
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1120
    "
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1121
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1122
    "Created: / 29-11-2013 / 12:01:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1123
    "Modified (format): / 29-11-2013 / 14:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1124
!
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1125
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1126
compileVersionMethod:methodName of:aClass for:newRevisionString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1127
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1128
    |cls mthd code|
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1129
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1130
    cls := aClass theMetaclass.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1131
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1132
    self assert: cls programmingLanguage isSmalltalk.
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1133
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1134
    code :=
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1135
methodName , '
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1136
    ^ ''' , newRevisionString , '''
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1137
'.
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1138
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1139
    mthd := Compiler 
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1140
                compile:code  
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1141
                forClass:cls
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1142
                inCategory:#documentation
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1143
                notifying:nil
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1144
                install:true
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1145
                skipIfSame:false
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1146
                silent:true.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1147
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1148
    mthd notNil ifTrue:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1149
        mthd setPackage:aClass package
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1150
    ]
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1151
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1152
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1153
containerFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1154
    "given a sourceInfo, return the classes container"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1155
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1156
    (info includesKey:#fileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1157
        ^ info at:#fileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1158
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1159
    (info includesKey:#expectedFileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1160
        ^ info at:#expectedFileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1161
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1162
    ^ (info at:#classFileNameBase) , '.st'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1163
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1164
    "Modified: 12.9.1996 / 02:31:52 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1165
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1166
3268
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1167
createTempDirectory:packageDir forModule:moduleDir in:aParentDir
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1168
    "create a temp directory for checking out"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1169
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1170
    |tempdir dir|
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1171
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1172
    "/ if CVSTempDir isNil, use current.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1173
    OsError handle:[:ex |
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1174
        self reportError:('cannot create temporary directory').
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1175
        ^ nil.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1176
    ] do:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1177
        tempdir := Filename newTemporaryDirectoryIn:aParentDir.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1178
    ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1179
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1180
    moduleDir notNil ifTrue:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1181
        dir := tempdir construct:moduleDir.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1182
        dir makeDirectory.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1183
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1184
        packageDir notNil ifTrue:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1185
            dir := dir construct:packageDir.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1186
            dir recursiveMakeDirectory.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1187
        ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1188
        dir exists ifFalse:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1189
            (tempdir construct:moduleDir) recursiveRemove.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1190
            tempdir recursiveRemove.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1191
            self reportError:('cannot create temporary directory').
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1192
            ^ nil.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1193
        ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1194
    ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1195
    ^ tempdir
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1196
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1197
    "self createTempDirectory:'fooPackage' forModule:'fooModule'"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1198
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1199
    "Created: / 09-12-1995 / 19:14:35 / cg"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1200
    "Modified: / 19-12-1995 / 16:13:02 / stefan"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1201
    "Modified: / 29-08-2006 / 13:16:23 / cg"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1202
!
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1203
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1204
directoryFromContainerPath:containerPath forClass:aClass
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1205
    "given a full path as in an RCS header, 
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1206
     extract the directory (i.e. package)."
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1207
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1208
    ^ self directoryFromContainerPath:containerPath forPackage:(aClass package)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1209
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1210
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1211
     CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st' forClass:Array
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1212
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1213
!
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1214
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1215
directoryFromContainerPath:containerPath forPackage:packageID
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1216
    "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
  1217
     extract the directory (i.e. package)."
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1218
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1219
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1220
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1221
    path := self pathInRepositoryFrom:containerPath forPackage:packageID.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1222
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1223
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1224
    "/ these are always UNIX filenames ...
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1225
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1226
    idx ~~ 0 ifTrue:[
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1227
        path := path copyFrom:(idx + 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1228
    ].
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1229
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1230
    "/ the code below used to be:
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1231
    "/     ^ path asFilename directoryName
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1232
    "/ however, that only works under UNIX, since
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1233
    "/ we MUST return a unix pathname here.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1234
    "/ therefore, do what unix would do here ...
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1235
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1236
    idx := path lastIndexOf:$/.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1237
    idx == 0 ifTrue:[
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1238
        "/ huh ?
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1239
        ^ path
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1240
    ].
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1241
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1242
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1243
    "
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1244
     CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1245
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1246
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1247
    "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
  1248
    "Modified: / 25.9.1998 / 15:38:59 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1249
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1250
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1251
directoryFromSourceInfo:info
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1252
    "given a sourceInfo, return the classes package directory"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1253
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  1254
    ^ info at:#directory ifAbsent:nil.
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1255
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1256
    "Created: / 23-08-2006 / 14:10:29 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1257
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1258
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1259
moduleFromContainerPath:containerPath forClass:aClass
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1260
    "given a full path as in an RCS header, extract the module."
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1261
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1262
    ^ self moduleFromContainerPath:containerPath forPackage:aClass package
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1263
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1264
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1265
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st' forClass:Array
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1266
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1267
!
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1268
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1269
moduleFromContainerPath:containerPath forPackage:packageID
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1270
    "given a full path as in an RCS header, extract the module."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1271
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1272
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1273
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1274
    path := self pathInRepositoryFrom:containerPath forPackage:packageID.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1275
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1276
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1277
    "/ these are always UNIX filenames
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1278
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1279
    idx == 0 ifTrue:[^ path].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1280
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1281
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1282
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1283
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1284
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1285
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1286
    "Created: / 25.11.1995 / 18:42:20 / cg"
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1287
    "Modified: / 11.8.1998 / 23:01:24 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1288
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1289
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1290
moduleFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1291
    "given a sourceInfo, return the classes module directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1292
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1293
    ^ info at:#module.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1294
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1295
    "Created: 6.2.1996 / 17:26:38 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1296
    "Modified: 12.9.1996 / 02:32:23 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1297
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1298
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1299
packageFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1300
    "given a sourceInfo, return the classes package directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1301
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
  1302
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1303
    self obsoleteMethodWarning.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1304
    ^ info at:#directory.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1305
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1306
    "Created: / 06-02-1996 / 17:26:23 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1307
    "Modified: / 23-08-2006 / 14:11:18 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1308
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1309
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1310
pathInRepositoryFrom:containerPath forPackage:packageID
2915
f0e6c9528a5e added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents: 2866
diff changeset
  1311
    "this tries to extract the path within a repository, 
f0e6c9528a5e added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents: 2866
diff changeset
  1312
     given some path as present in an RCS Header string.
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1313
     Typically, this ought to be that string directly; 
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1314
     however, if the repository directory is accessed via a symbolic link during
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1315
     ci/co, some systems extract different strings with co.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1316
     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
  1317
     and extracted sources had /phys/ibm/CVS in their header.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1318
     Do not depend on the code below to work correctly all the time."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1319
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1320
    |top lastTop idx|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1321
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1322
    containerPath isNil ifTrue:[^ nil].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1323
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1324
    packageID notNil ifTrue:[
1348
4b2b7b73098e path extraction
Claus Gittinger <cg@exept.de>
parents: 1346
diff changeset
  1325
        idx := containerPath lastIndexOfSubCollection:(packageID copyReplaceAll:$: with:$/).
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1326
        idx ~~ 0 ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1327
            ^ containerPath copyFrom:idx.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1328
        ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1329
    ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1330
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1331
    "/
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1332
    "/ the following is heuristics, in case that the packageID is not known
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1333
    "/ (should not be required)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1334
    "/
1499
9f17ad89deb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1498
diff changeset
  1335
    top := self repositoryTopDirectoryFromCVSRoot.
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1336
    top notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1337
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1338
        (containerPath startsWith:(top , '/')) ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1339
            ^ containerPath copyFrom:(top size + 2).
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1340
        ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1341
        (containerPath startsWith:(top)) ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1342
            ^ containerPath copyFrom:(top size + 1).
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1343
        ].
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1344
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1345
        "/ hardcase - the repository-filename in the versionInfo
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1346
        "/ does not match my repository top.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1347
        "/ check for mangled prefix (happens with symbolic links)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1348
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1349
        lastTop := '/' , top asFilename baseName, '/'.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1350
        idx := containerPath indexOfSubCollection:lastTop.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1351
        idx ~~ 0 ifTrue:[
3512
a69619b661ea class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3511
diff changeset
  1352
            ('SourceCodeManager [warning]: repository path mismatch: ' , (containerPath copyTo:idx-1) , lastTop , ' vs. ' , top , '/') infoPrintCR.
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1353
            'SourceCodeManager [info]: warning: assuming that mismatch is ok.' infoPrintCR.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1354
            ^ containerPath copyFrom:(idx + lastTop size).
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1355
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1356
    ].
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1357
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1358
    ^ nil
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1359
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1360
    "
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1361
     SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st'    forPackage:Array package 
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1362
     SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' forPackage:Array package 
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1363
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1364
     SourceCodeManager pathInRepositoryFrom:'/files/CVS/stx/libbasic/Array.st'    forPackage:nil          
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1365
     SourceCodeManager pathInRepositoryFrom:'/phys/ibm/CVS/stx/libbasic/Array.st' forPackage:nil 
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1366
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1367
1498
67b278e62f29 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1368
    "Created: / 25-11-1995 / 18:42:20 / cg"
67b278e62f29 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1369
    "Modified: / 21-06-2006 / 12:06:14 / cg"
2915
f0e6c9528a5e added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents: 2866
diff changeset
  1370
    "Modified (comment): / 24-09-2012 / 11:10:50 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1371
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1372
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1373
postCheckInClass:aClass
871
93f994512ade checkin from browser
ps
parents: 870
diff changeset
  1374
    "invoked after a checkIn"
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1375
928
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1376
    |p|
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1377
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1378
    (p := Project current) notNil ifTrue:[
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1379
        p condenseChangesForClassCheckin:aClass.
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1380
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1381
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1382
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1383
    "/ Set the source code for every method of the checked in class
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1384
    "/ Ensure that the source code for the compiled methods is the original one
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1385
    "/ Done to avoid checking out from the repository using binaryRevision and sourcePosition
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1386
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1387
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
3396
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1388
        mthd package = aClass package ifTrue:[
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1389
            mthd makeLocalStringSource.
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1390
        ]
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1391
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1392
    aClass allPrivateClassesDo:[:eachPrivateClass |
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1393
        eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
3396
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1394
            mthd package = aClass package ifTrue:[
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1395
                mthd makeLocalStringSource.
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1396
            ].
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1397
        ]
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1398
    ].
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1399
!
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1400
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1401
postCheckInExtensionsForPackage:aPackageId
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1402
    "invoked after a checkIn"
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1403
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1404
    |p extensionMethods|
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1405
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1406
    (p := Project current) notNil ifTrue:[
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1407
        p condenseChangesForExtensionsCheckInInPackage:aPackageId.
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1408
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1409
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1410
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1411
    "/ Set the source code for every extension method of the checked in aPackageId
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1412
    "/ Ensure that the source code for the compiled methods is the original one
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1413
    "/ Done to avoid checking out from the repository
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1414
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1415
    extensionMethods := Smalltalk allExtensionsForPackage:aPackageId.
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1416
    extensionMethods do:[:mthd |
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1417
        mthd makeLocalStringSource.
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1418
    ].
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1419
!
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1420
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1421
reportError:msg
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1422
    |fullMsg|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1423
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1424
    fullMsg := self class name,' [error]: ',msg.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1425
    fullMsg errorPrintCR.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1426
    SourceCodeManagerError raiseErrorString:fullMsg.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1427
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1428
    "Created: / 29-08-2006 / 12:44:19 / cg"
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1429
!
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1430
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1431
repositoryTopDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1432
    "return the name of the repository"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1433
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1434
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1435
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1436
    "Created: 25.11.1995 / 18:38:59 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1437
    "Modified: 12.9.1996 / 02:32:40 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1438
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1439
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1440
sourceCacheDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1441
    "return the sourceCache directories name"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1442
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1443
    |dir nm|
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1444
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1445
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1446
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1447
    (dir := nm asFilename) exists ifFalse:[
3234
eb81b9f6e323 exception access
Claus Gittinger <cg@exept.de>
parents: 3230
diff changeset
  1448
        OsError catch:[
2232
ee754b28809e changed: #sourceCacheDirectory
Claus Gittinger <cg@exept.de>
parents: 2231
diff changeset
  1449
            dir recursiveMakeDirectory.
1060
bf0279994422 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1038
diff changeset
  1450
        ].
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1451
        dir exists ifFalse:[
2232
ee754b28809e changed: #sourceCacheDirectory
Claus Gittinger <cg@exept.de>
parents: 2231
diff changeset
  1452
            ('SourceCodeManager [warning]: could not create cache dir "',CacheDirectoryName,'"') errorPrintCR.
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1453
            ^ nil
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1454
        ].
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1455
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1456
        "/ make it read/writable for everyone
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1457
        "/
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1458
        dir makeReadableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1459
        dir makeWritableForAll.
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1460
        dir makeExecutableForAll.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1461
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1462
    ^ dir
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1463
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1464
    "Modified: 10.1.1997 / 15:13:20 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1465
!
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1466
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1467
sourceInfoOfClass:aClass
751
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1468
    "helper: return a classes sourceCodeInfo by extracting its
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1469
     versionString components."
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1470
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1471
    |cls packageInfo revInfo actualSourceFileName classFileNameBase
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1472
     newInfo container expectedFileName
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1473
     directoryFromVersion moduleFromVersion fileNameFromVersion 
3280
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1474
     directoryFromPackage moduleFromPackage repairedPath|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1475
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1476
    cls := aClass theNonMetaclass.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1477
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1478
    newInfo := IdentityDictionary new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1479
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1480
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1481
    "/ the info given by the classes source ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1482
    "/ (i.e. its revisionString)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1483
    "/
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1484
    revInfo := cls revisionInfoOfManager: self.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1485
    revInfo notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1486
        revInfo keysAndValuesDo:[:key :value |
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1487
            newInfo at:key put:value
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1488
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1489
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1490
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1491
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1492
    "/ the info given by the classes binary ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1493
    "/ (i.e. its package-ID)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1494
    "/ if present, we better trust that one.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1495
    "/ however, it only contains partial information (module:directory:libName).
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1496
    "/ (but is available even without a source)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1497
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1498
    packageInfo := cls packageSourceCodeInfo.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1499
    packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1500
        packageInfo keysAndValuesDo:[:key :value |
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1501
            newInfo at:key put:value
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1502
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1503
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1504
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1505
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1506
    "/ no information
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1507
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1508
    (packageInfo isNil and:[revInfo isNil]) ifTrue:[
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1509
        ('SourceCodeManager [warning]: class `' , cls name , ''' has neither source nor compiled-in info') infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1510
        ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1511
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1512
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1513
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1514
    "/ validate for conflicts
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1515
    "/ trust binary if in doubt
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1516
    "/ (in case some cheater edited the version string)
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1517
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1518
    revInfo notNil ifTrue:[
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1519
        container := revInfo at:#repositoryPathName ifAbsent:nil.
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1520
        (container notNil) ifTrue:[
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1521
            moduleFromVersion := self moduleFromContainerPath:container forClass:aClass.
1125
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1522
            moduleFromVersion notNil ifTrue:[
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1523
                newInfo at:#module put:moduleFromVersion.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1524
            ].
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1525
            directoryFromVersion := self directoryFromContainerPath:container forClass:aClass.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1526
            directoryFromVersion notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1527
                newInfo at:#directory put:directoryFromVersion.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1528
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1529
            fileNameFromVersion := container asFilename baseName.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1530
            (fileNameFromVersion endsWith:',v') ifTrue:[
3230
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
  1531
                fileNameFromVersion := fileNameFromVersion copyButLast:2.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1532
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1533
            newInfo at:#fileName put:fileNameFromVersion.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1534
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1535
            packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1536
                (packageInfo includesKey:#directory) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1537
                    directoryFromPackage := packageInfo at:#directory.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1538
                    moduleFromPackage := packageInfo at:#module.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1539
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1540
                    (directoryFromPackage ~= directoryFromVersion 
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1541
                    or:[moduleFromPackage ~= moduleFromVersion]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1542
                        (directoryFromVersion isNil or:[moduleFromVersion isNil]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1543
                            directoryFromPackage ~= 'no package' ifTrue:[
1125
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1544
                                moduleFromVersion notNil ifTrue:[
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1545
                                    ('SourceCodeManager [warning]: conflicting source infos (binary: ' 
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1546
                                        , (moduleFromPackage ? 'nil')  , '/' , (directoryFromPackage  ? 'nil')
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1547
                                        , ' vs. source:'
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1548
                                        , (moduleFromVersion ? 'nil') , '/' , (directoryFromVersion ? 'nil')
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1549
                                        , ')') infoPrintCR.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1550
                                    ('SourceCodeManager [info]: using binary info: ' 
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1551
                                        , moduleFromPackage , '/' , directoryFromPackage
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1552
                                    ) infoPrintCR.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1553
                                ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1554
                                newInfo at:#directory put:directoryFromPackage.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1555
                                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
  1556
                            ]
187
fdda79120bbb in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents: 185
diff changeset
  1557
                        ] ifFalse:[
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1558
                            directoryFromPackage ~= 'no package' ifTrue:[
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1559
                                ('SourceCodeManager [warning]: conflicting source infos (binary: ' 
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1560
                                    , moduleFromPackage  , '/' , directoryFromPackage
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1561
                                    , ' vs. source:'
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1562
                                    , moduleFromVersion  , '/' , directoryFromVersion
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1563
                                    , ')') infoPrintCR.
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1564
                            ]
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1565
                        ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1566
                    ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1567
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1568
            ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1569
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1570
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1571
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1572
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1573
    "/ the filename I'd expect from its name ...
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1574
    "/
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  1575
    classFileNameBase := cls classBaseFilename.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1576
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1577
    (newInfo includesKey:#fileName) ifFalse:[
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1578
        newInfo at:#fileName put:classFileNameBase
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1579
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1580
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1581
    "/ guess on the container
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1582
    ((newInfo includesKey:#directory) and:[newInfo includesKey:#module]) ifTrue:[
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1583
        |pathInRepository|
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1584
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1585
        container isNil ifTrue:[
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1586
            container := (newInfo at:#module)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1587
                         , '/'
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1588
                         , (newInfo at:#directory)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1589
                         , '/'
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1590
                         , classFileNameBase , ',v'.
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1591
        ].
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1592
        pathInRepository := (newInfo at:#module)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1593
                     , '/'
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1594
                     , (newInfo at:#directory)
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1595
                     , '/'
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1596
                     , classFileNameBase.
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1597
        newInfo at:#pathInRepository put:pathInRepository.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1598
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1599
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1600
    container notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1601
        newInfo at:#repositoryPathName put:container.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1602
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1603
3280
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1604
    (newInfo includesKey:#pathInRepository) ifFalse:[
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1605
        (fileNameFromVersion := newInfo at:#fileName ifAbsent:nil) notNil ifTrue:[
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1606
            (repairedPath := cls projectDirectory asFilename construct:fileNameFromVersion) exists ifTrue:[
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1607
                Transcript showCR:('Oldstyle, broken or invalid version-info in class: ',cls name allBold,'. Please check').
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1608
                newInfo at:#pathInRepository put:repairedPath pathName.
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1609
            ].
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1610
        ].
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1611
    ].
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1612
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1613
    "/ check ..
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1614
    revInfo notNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1615
        actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1616
        actualSourceFileName notNil ifTrue:[
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1617
            expectedFileName := classFileNameBase.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1618
            actualSourceFileName ~= expectedFileName ifTrue:[
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1619
                ('SourceCodeManager [warning]: source of class ' , cls name , ' in ' , actualSourceFileName , ';') infoPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1620
                ('SourceCodeManager [info]: (expected: ' , expectedFileName , '); renamed or missing abbreviation ?') infoPrintCR.
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1621
                ('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
  1622
                newInfo at:#expectedFileName put:expectedFileName.
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1623
                newInfo at:#renamed put:true.
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1624
                classFileNameBase := actualSourceFileName
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1625
            ]
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1626
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1627
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1628
1888
61dad1bbee19 use nameWithoutSuffix
Claus Gittinger <cg@exept.de>
parents: 1881
diff changeset
  1629
    newInfo at:#classFileNameBase put:(classFileNameBase asFilename nameWithoutSuffix).
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1630
    ^ newInfo
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1631
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1632
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1633
     self sourceInfoOfClass:Array
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1634
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1635
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1636
    "Modified: / 22-10-2008 / 20:49:15 / cg"
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1637
    "Modified: / 19-07-2012 / 13:38:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1638
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1639
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1640
updateVersionMethod:selector of:aClass for:newRevisionString
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1641
    "{ Pragma: +optSpace }"
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1642
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1643
    "helper for the checkin procedure.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1644
     Update my #version_XXX method, to now return newRevisionString."
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1645
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1646
    Class methodRedefinitionNotification answer:#keep do:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1647
        Class withoutUpdatingChangesDo:[
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1648
            |oldVersion|
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1649
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1650
"/            "/ must preserve the binary version, as methods still have the offsets into the old source file inside
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1651
"/            oldVersion := aClass revision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1652
"/            aClass setBinaryRevision:oldVersion.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1653
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1654
            self compileVersionMethod:selector of:aClass for:newRevisionString.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1655
        ]
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1656
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1657
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1658
    "Modified: / 29-09-2011 / 21:59:41 / cg"
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1659
    "Created: / 02-12-2011 / 14:18:14 / cg"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1660
!
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1661
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1662
updateVersionMethodOf:aClass for:newRevisionString
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1663
    "{ Pragma: +optSpace }"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1664
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1665
    "helper for the checkin procedure.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1666
     Update my #version_XXX method, to now return newRevisionString."
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1667
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1668
    self updateVersionMethod:(self nameOfVersionMethodInClasses) of:aClass for:newRevisionString.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1669
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1670
    "Updates the old method #version (if present)"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1671
    true "(aClass theMetaclass includesSelector: Class nameOfOldVersionMethod)" ifTrue: [
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1672
        self updateVersionMethod:(Class nameOfOldVersionMethod) of:aClass for:newRevisionString.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1673
    ].
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1674
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1675
    "Modified: / 02-12-2011 / 14:19:37 / cg"
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1676
! !
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1677
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1678
!AbstractSourceCodeManager class methodsFor:'queries'!
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1679
2730
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1680
enabled
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1681
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1682
    "JV@2012-01-19: Quick hack, see senders. Is that what you mean?"
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1683
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1684
    ^self askFor:#shownInBrowserMenus
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1685
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1686
    "Created: / 19-01-2012 / 10:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1687
!
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1688
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1689
isContainerBased
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1690
    "true, if the SCM uses some kind of source container (,v files).
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1691
     False, if it is like a database or filesystem."
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1692
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1693
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1694
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1695
    "Created: / 21-12-2011 / 18:53:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1696
!
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1697
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1698
isExperimental
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1699
    ^ false
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1700
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1701
    "Created: / 16-08-2006 / 11:22:47 / cg"
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1702
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1703
2763
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1704
isExtensionsVersionMethodSelector: selector 
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1705
    "true if the given selector is for one of the manager's extensions version methods.
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1706
     These are all named extensionVersion_XXX, where XXX is manager-specific (CVS, P4, SVN etc.).
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1707
     For backward compatibility (times, when there was only one CVS sourcecode manager,
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1708
     the selector named 'extensionsVersion' alone also counts as a version method
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1709
     (which might be a somewhat bad idea in the long term...)."
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1710
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1711
    selector isNil ifTrue: [^ false].
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1712
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1713
    ^ selector == self nameOfVersionMethodForExtensions 
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1714
    or:[selector startsWith: self prefixOfVersionMethodForExtensionsSelector]
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1715
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1716
    "Modified (comment): / 09-07-2011 / 12:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1717
    "Created: / 26-01-2012 / 14:30:45 / cg"
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1718
!
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1719
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1720
isResponsibleForModule:module
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1721
    ^ self repositoryInfoPerModule keys includes:module
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1722
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1723
    "Created: / 09-11-2006 / 15:24:57 / cg"
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1724
!
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1725
2445
vrany
parents: 2443
diff changeset
  1726
isResponsibleForPackage:aStringOrSymbol
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1727
    "Returns true if the manager can handle source code for given package.
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1728
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1729
     Answering true does not imply that receiver is configured default
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1730
     manager for that package, it only means that it has a repository
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1731
     configured for given package."
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1732
2445
vrany
parents: 2443
diff changeset
  1733
    self subclassResponsibility
vrany
parents: 2443
diff changeset
  1734
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1735
    "Modified (comment): / 11-10-2011 / 11:58:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2634
865f10de3c93 comment/format in: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1736
    "Modified (format): / 01-12-2011 / 20:56:32 / cg"
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1737
!
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1738
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1739
isRevision:revision1 after:revision2
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1740
    "true, if the dotted revision string revision1 is > than revision2"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1741
3417
848ad94c1e8f class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3399
diff changeset
  1742
    ^ (revision1 compareAsVersionNumberWith:revision2) > 0
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1743
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1744
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1745
     SourceCodeManager isRevision:'1' after:'2'      
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1746
     SourceCodeManager isRevision:'2' after:'1'      
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1747
     SourceCodeManager isRevision:'1.1' after:'2.1.2' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1748
     SourceCodeManager isRevision:'2.1' after:'1.2.3' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1749
     SourceCodeManager isRevision:'1' after:'1.1'    
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1750
     SourceCodeManager isRevision:'1.1' after:'1'    
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1751
     SourceCodeManager isRevision:'1.1' after:'1.2' 
3417
848ad94c1e8f class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3399
diff changeset
  1752
     SourceCodeManager isRevision:'1.10' after:'1.2' 
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1753
     SourceCodeManager isRevision:'1.2' after:'1.1' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1754
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.5' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1755
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.3' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1756
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3'   
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1757
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3.4'   
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1758
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1759
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1760
    "Created: / 21-12-2011 / 19:15:35 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1761
!
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1762
2916
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1763
isRevision:revision1 sameOrAfter:revision2
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1764
    "true, if the dotted revision string revision1 is >= than revision2"
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1765
3417
848ad94c1e8f class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3399
diff changeset
  1766
    ^ (revision1 compareAsVersionNumberWith:revision2) >= 0
2916
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1767
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1768
    "Created: / 26-09-2012 / 18:15:58 / cg"
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1769
!
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1770
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1771
isVersionMethodForExtensionsSelector: selector
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1772
    <resource: #obsolete>
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1773
 
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1774
    "true if the given selector is for one of the manager's extensions version methods.
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1775
     These are all named extensionVersion_XXX, where XXX is manager-specific (CVS, P4, SVN etc.).
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1776
     For backward compatibility (times, when there was only one CVS sourcecode manager,
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1777
     the selector named 'extensionsVersion' alone also counts as a version method
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1778
     (which might be a somewhat bad idea in the long term...)."
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1779
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1780
    self obsoleteMethodWarning:'use isExtensionsVersionMethodSelector'.
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1781
    ^self isExtensionsVersionMethodSelector: selector
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1782
!
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1783
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1784
isVersionMethodSelector: selector 
2342
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1785
    "true if the given selector is for one of the manager's version methods.
2445
vrany
parents: 2443
diff changeset
  1786
     These are all named version_XXX, where XXX is manager-specific (CVS, P4, SVN etc.).
2342
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1787
     For backward compatibility (times, when there was only one CVS sourcecode manager,
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1788
     the selector named 'version' alone also counts as a version method
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1789
     (which might be a somewhat bad idea in the long term...)."
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1790
2195
2062d4138045 changed: #isVersionMethodSelector:
fm
parents: 2192
diff changeset
  1791
    selector isNil ifTrue: [^ false].
2062d4138045 changed: #isVersionMethodSelector:
fm
parents: 2192
diff changeset
  1792
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1793
    ^ selector == self nameOfVersionMethodInClasses 
2530
331e4ee893f7 comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2529
diff changeset
  1794
    or:[selector startsWith: self prefixOfVersionMethodSelector]
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1795
2445
vrany
parents: 2443
diff changeset
  1796
    "Modified (comment): / 09-07-2011 / 12:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2530
331e4ee893f7 comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2529
diff changeset
  1797
    "Modified (format): / 29-09-2011 / 14:56:15 / cg"
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1798
!
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1799
2552
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1800
managerTypeName
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1801
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1802
    "Answers version manager name suitable for UI,
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1803
     i,e., CVS, SubVersion, Perforce"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1804
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1805
    ^ self subclassResponsibility
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1806
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1807
    "Modified (comment): / 03-10-2011 / 13:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1808
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1809
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1810
managerTypeNameShort
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1811
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1812
    "Answers short version manager name suitable for UI,
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1813
     i,e., CVS, SVN, P4. Used in cases where sorter strings
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1814
     are preferred. Defaults to #managerTypeName"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1815
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1816
    ^self managerTypeName
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1817
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1818
    "Created: / 03-10-2011 / 13:28:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1819
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1820
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1821
nameOfVersionMethodForExtensions
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1822
    "that is the old name; now, we use extensionsVersion_<SCM>"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1823
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1824
    ^ #'extensionsVersion'
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1825
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1826
    "Modified (comment): / 29-09-2011 / 13:27:04 / cg"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1827
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1828
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1829
nameOfVersionMethodInClasses
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1830
    "that is the old name; now, we use version_<SCM>"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1831
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1832
    ^ #'version'
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1833
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1834
    "Modified (comment): / 29-09-2011 / 13:27:09 / cg"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1835
!
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1836
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1837
performsCompilabilityChecks
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1838
    "Should return true, if the manager itself performs
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1839
     compilability checks, false otherwise.
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1840
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1841
     Basically a hack, see my senders..."
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1842
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1843
    ^false"/by default
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1844
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1845
    "Created: / 11-04-2012 / 16:54:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1846
!
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1847
2762
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1848
prefixOfVersionMethodForExtensionsSelector
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1849
    "all scm-extensionsVersion methods start with this prefix"
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1850
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1851
    ^ 'extensionsVersion_'
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1852
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1853
    "Created: / 26-01-2012 / 14:29:32 / cg"
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1854
!
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1855
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1856
prefixOfVersionMethodSelector
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1857
    "all scm-version methods start with this prefix"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1858
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1859
    ^ 'version_'
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1860
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1861
    "Created: / 29-09-2011 / 13:26:29 / cg"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1862
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1863
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1864
revisionAfter:aRevisionString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1865
    "generate the next revision number after the given number"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1866
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1867
    |idx|
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1868
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1869
    idx := aRevisionString lastIndexOf:$..
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1870
    idx == 0 ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1871
        ^ ((Integer readFrom:aRevisionString) + 1) printString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1872
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1873
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1874
    ^ (aRevisionString copyTo:idx) , ((Integer readFrom:(aRevisionString copyFrom:(idx+1)))+1) printString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1875
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1876
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1877
     SourceCodeManager revisionAfter:'1.2.3.4' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1878
     SourceCodeManager revisionAfter:'123'  
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1879
     SourceCodeManager revisionAfter:'1.24'  
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1880
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1881
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1882
    "Created: 20.11.1995 / 12:54:05 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1883
    "Modified: 12.9.1996 / 02:33:03 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1884
!
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1885
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1886
settingsApplicationClass
2350
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  1887
    "link to my settings application (needed for the settings dialog"
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  1888
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1889
    self subclassResponsibility
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1890
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1891
    "Created: / 19-04-2011 / 12:43:54 / cg"
2350
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  1892
    "Modified: / 19-04-2011 / 13:52:45 / cg"
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1893
!
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1894
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1895
sourceCodeManagerForPackage:aPackageID
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1896
    |module mgr|
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1897
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  1898
    "JV@2012-01-23: If source code management is disabled, return #(). Following code
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  1899
     is hack since there is no global boolean flag, sigh"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  1900
    (Smalltalk at:#SourceCodeManager) isNil ifTrue:[ ^ nil ].
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  1901
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1902
    aPackageID notNil ifTrue:[
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1903
        "/ see if there is a package-specific manager
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  1904
        (mgr := self managerForPackage:aPackageID) notNil ifTrue:[^ mgr].
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1905
2445
vrany
parents: 2443
diff changeset
  1906
       "/ more or less obsolete now - I know which manager is to be used per package
vrany
parents: 2443
diff changeset
  1907
"/        self availableManagers do:[:mgr |
vrany
parents: 2443
diff changeset
  1908
"/            (mgr isResponsibleForPackage:aPackageID) ifTrue:[^ mgr ].
vrany
parents: 2443
diff changeset
  1909
"/        ].
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1910
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1911
        "/ old stuff: see if there is a module-specific manager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1912
        module := aPackageID upTo:$:.
2225
fm
parents: 2224
diff changeset
  1913
        self availableManagers do:[:mgr |
fm
parents: 2224
diff changeset
  1914
            (mgr isResponsibleForModule:module) ifTrue:[^ mgr ].
fm
parents: 2224
diff changeset
  1915
        ]
fm
parents: 2224
diff changeset
  1916
    ].
fm
parents: 2224
diff changeset
  1917
    ^ Smalltalk at:#SourceCodeManager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1918
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1919
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1920
     self sourceCodeManagerForPackage:'stx:libbasic'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1921
     self sourceCodeManagerForPackage:'stx:libboss'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1922
     self managerForMatchingModule:'stx:libba*' put:SVNSourceCodeManager.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1923
     self sourceCodeManagerForPackage:'stx:libbasic'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1924
     self sourceCodeManagerForPackage:'stx:libboss'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1925
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1926
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  1927
    "Modified: / 18-04-2011 / 19:53:03 / cg"
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  1928
    "Modified: / 23-01-2012 / 19:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2225
fm
parents: 2224
diff changeset
  1929
!
fm
parents: 2224
diff changeset
  1930
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1931
supportsCheckinLogMessages
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1932
    "true, if log-messages are supported"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1933
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1934
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1935
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1936
    "Created: / 21-12-2011 / 18:02:34 / cg"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1937
!
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1938
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1939
versionMethodKeyword
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1940
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1941
    "Answers the keyword used by the version management system to
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1942
     expand a current version in a file (_without_ dollars). For
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1943
     CVS it is 'Header', for SVN 'Id', others may use different
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1944
     keywords. If nil is returned, then the version management does
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1945
     not use any keyword."
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1946
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1947
    "/TODO: Now, 'Header' is returned for backward compatibility. In future
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1948
    "/it should be changed to self subclassResponsibility
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1949
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1950
    ^'Header'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1951
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1952
    "Created: / 27-09-2011 / 14:52:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1953
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1954
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1955
versionMethodTemplateForJavaScript
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1956
    ^ self versionMethodTemplateForJavaScriptFor:(self nameOfVersionMethodInClasses)
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1957
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1958
    "
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1959
     CVSSourceCodeManager versionMethodTemplateForJavaScript
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1960
    "
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1961
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1962
    "Created: / 19-08-2011 / 01:20:28 / cg"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1963
!
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1964
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1965
versionMethodTemplateForJavaScriptFor:aSelector
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1966
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1967
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1968
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1969
    ^
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1970
"'function ',"aSelector,'() {
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1971
    return "$' , self versionMethodKeyword , '$";
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1972
}'
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1973
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1974
    "Created: / 19-08-2011 / 01:20:56 / cg"
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1975
    "Modified: / 20-09-2012 / 12:13:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1976
!
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1977
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1978
versionMethodTemplateForRuby
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1979
    ^ self versionMethodTemplateForRubyFor:(self nameOfVersionMethodInClasses)
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1980
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1981
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1982
     CVSSourceCodeManager versionMethodTemplateForRuby
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1983
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1984
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1985
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1986
versionMethodTemplateForRubyFor:aSelector
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1987
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1988
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1989
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1990
    ^
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1991
'def self.',aSelector,'()
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1992
    return "$' , self versionMethodKeyword , '$"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1993
end'
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1994
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  1995
    "Modified (comment): / 19-08-2011 / 01:19:40 / cg"
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  1996
    "Modified: / 27-09-2011 / 16:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1997
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1998
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1999
versionMethodTemplateForSmalltalk
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2000
    ^ self versionMethodTemplateForSmalltalkFor:(self nameOfVersionMethodInClasses)
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2001
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2002
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2003
     CVSSourceCodeManager versionMethodTemplateForSmalltalk
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2004
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2005
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2006
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2007
versionMethodTemplateForSmalltalkFor:aSelector
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2008
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2009
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2010
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2011
    ^
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2012
aSelector,'
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2013
    ^ ''$', self versionMethodKeyword , '$''
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2014
'
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2015
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2016
    "Modified (comment): / 19-08-2011 / 01:19:08 / cg"
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2017
    "Modified: / 27-09-2011 / 16:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  2018
! !
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  2019
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  2020
!AbstractSourceCodeManager class methodsFor:'source code access'!
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2021
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2022
basicCheckinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force
3624
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2023
    "low level checkin of a class into the source repository. Does not deal with any version method updates,
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2024
     only does the checkin, using a temporary file.
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2025
     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
  2026
3624
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2027
    aClass isPrivate ifTrue:[
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2028
        self reportError:'refuse to check in private classes.'.
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2029
        ^ false.
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2030
    ].
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2031
    ^ self 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2032
        withClass:aClass 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2033
        classFileName:classFileName 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2034
        filedOutToTemporaryFileDo:[:tempFile |
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2035
            self 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2036
                checkinClass:aClass
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2037
                fileName:classFileName 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2038
                directory:packageDir 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2039
                module:moduleDir
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2040
                source:(tempFile name)
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2041
                logMessage:logMessage
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2042
                force:force.
114
bb18f2290ec6 dont write a changeLog if nothing changed (i.e. no checkin was done)
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
  2043
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2044
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2045
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2046
     SourceCodeManager checkinClass:Array
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2047
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2048
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2049
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2050
    "Created: / 21-12-2011 / 19:30:06 / cg"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2051
!
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2052
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2053
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2054
    "checkin of a class into the source repository.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2055
     Return true if ok, false if not."
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2056
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2057
    ^ self
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2058
        checkinClass:aClass 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2059
        fileName:classFileName 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2060
        directory:packageDir 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2061
        module:moduleDir 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2062
        logMessage:logMessage
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2063
        force:false
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2064
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2065
    "Modified: 11.9.1996 / 16:15:43 / cg"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2066
!
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2067
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2068
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2069
    "checkin of a class into the source repository.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2070
     Return true if ok, false if not."
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2071
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2072
    |className answer allLabel allValue 
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2073
     nameOfVersionMethodInClasses revision|
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2074
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2075
    className := aClass name.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2076
    nameOfVersionMethodInClasses := self nameOfVersionMethodInClasses.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2077
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2078
    (revision := aClass revision) isNil ifTrue:[ 
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2079
        force ifFalse:[
2980
7dab3220c55b class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
  2080
            ('SourceCodeManager [warning]: class ' , className, ' has no revision string') errorPrintCR.
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2081
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2082
            AbortAllOperationWantedQuery query ifTrue:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2083
                allLabel := #('Cancel All').
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2084
                allValue := #(cancelAll).
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2085
            ] ifFalse:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2086
                allLabel := #().
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2087
                allValue := #().
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2088
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2089
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2090
            ((aClass theMetaclass includesSelector:#version)
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2091
               or:[aClass theMetaclass includesSelector: nameOfVersionMethodInClasses]) ifTrue:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2092
                answer := OptionBox 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2093
                            request:('Class %1 has no (usable) revision string.\\Check in as newest ?' bindWith:className allBold) withCRs
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2094
                            label:'Confirm'
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2095
                            buttonLabels:(allLabel , #('Cancel' 'CheckIn')) 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2096
                            values:(allValue , #(false #checkIn))
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2097
                            default:#checkIn.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2098
            ] ifFalse:[
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2099
                force ifTrue:[
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2100
                    revision := self newestRevisionInFile:classFileName directory:packageDir module:moduleDir.
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2101
                    revision isNil ifTrue:[
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2102
                        revision := '1.0'   "/ initial checkin
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2103
                    ].
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2104
                ] ifFalse:[
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2105
                    revision := '1.0'   "/ initial checkin
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2106
                ].
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2107
                answer := #create.
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2108
"/                answer := OptionBox 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2109
"/                            request:('Class %1 has no revision string.\\Check in as newest ?' bindWith:className allBold) withCRs
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2110
"/                            label:'Confirm'
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2111
"/                            buttonLabels:(allLabel , #('Cancel' 'CheckIn' 'Create & CheckIn')) 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2112
"/                            values:(allValue , #(false #checkIn #create))
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2113
"/                            default:#create.
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2114
            ].
2980
7dab3220c55b class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
  2115
            answer == false ifTrue:[ AbortOperationRequest raise. ^ false ].
7dab3220c55b class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
  2116
            answer == #cancelAll ifTrue:[ AbortAllOperationRequest raise. ^ false ].
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2117
            answer == #create ifTrue:[ 
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2118
                self updateVersionMethodOf:aClass for:(self revisionStringFor:aClass inModule:moduleDir directory:packageDir container:classFileName revision:revision).
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2119
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2120
        ]
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2121
    ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2122
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2123
    "Ensure that the method #version_XXX is present before checking in XXX. 
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2124
     It will be missing when checking in classes with only the old method #version"
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2125
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2126
    ^ self basicCheckinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage force:force.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2127
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2128
    "
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2129
     SourceCodeManager checkinClass:Array
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2130
    "
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2131
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2132
    "Created: / 11-09-1996 / 16:15:17 / cg"
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2133
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2134
    "Modified: / 21-12-2011 / 19:30:38 / cg"
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2135
!
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2136
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2137
checkinClass:aClass logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2138
    "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
  2139
     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
  2140
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2141
    |sourceInfo packageDir moduleDir classFileName|
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2142
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2143
    sourceInfo := self sourceInfoOfClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2144
    sourceInfo isNil ifTrue:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2145
        self reportError:('no sourceInfo for class: ' , aClass name).
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2146
        ^ false
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2147
    ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2148
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2149
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2150
    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
  2151
    classFileName := self containerFromSourceInfo:sourceInfo.
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2152
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2153
    ^ self 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2154
        checkinClass:aClass 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2155
        fileName:classFileName 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2156
        directory:packageDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2157
        module:moduleDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2158
        logMessage:logMessage
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2159
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2160
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2161
    "
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2162
     SourceCodeManager checkinClass:Array logMessage:'foo'
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2163
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2164
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2165
    "Created: / 06-11-1995 / 18:56:00 / cg"
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2166
    "Modified: / 29-08-2006 / 12:46:28 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2167
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2168
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2169
getFile:fileName revision:revision directory:packageDir module:moduleDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2170
    |s contents|
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2171
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2172
    s := self 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2173
            streamForFile:fileName 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2174
            revision:revision 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2175
            directory:packageDir
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2176
            module:moduleDir.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2177
    s isNil ifTrue:[^ nil].
3582
9ea25bf13e00 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3512
diff changeset
  2178
    contents := s contentsAsString.
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2179
    s close.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2180
    ^ contents
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2181
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2182
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2183
     SourceCodeManager 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2184
        getFile:'Make.spec' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2185
        revision:#newest 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2186
        directory:'libbasic2' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2187
        module:'stx'
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2188
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2189
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2190
    "Created: / 29-08-2006 / 15:47:08 / cg"
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2191
!
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2192
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2193
getMostRecentSourceStreamForClassNamed:aClassName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2194
    "given a class, return an open stream to its most recent source
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2195
     (not knowing anything about its version).
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2196
     Used when autoloading classes."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2197
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2198
    ^ self
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2199
        getMostRecentSourceStreamForClassNamed:aClassName 
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2200
        inPackage:nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2201
!
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2202
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2203
getMostRecentSourceStreamForClassNamed:aClassName inPackage:forcedPackage
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2204
    "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
  2205
     (not knowing anything about its version).
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2206
     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
  2207
     recent found in the repostitory.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2208
     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
  2209
     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
  2210
     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
  2211
     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
  2212
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  2213
    |cls sourceInfo classFileName packageDir moduleDir s components i|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2214
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2215
    cls := Smalltalk classNamed:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2216
    cls notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2217
        sourceInfo := self sourceInfoOfClass:cls.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2218
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2219
    sourceInfo notNil ifTrue:[
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2220
        packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2221
        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
  2222
        classFileName := self containerFromSourceInfo:sourceInfo.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2223
    ] ifFalse:[
1838
91828978bae1 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1837
diff changeset
  2224
        classFileName := (Smalltalk fileNameForClass:aClassName), '.st'.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2225
        packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2226
        packageDir notNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2227
            (packageDir startsWith:'stx/') ifTrue:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2228
                "this is a backward compatibility leftover - will vanish"
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2229
                packageDir := packageDir copyFrom:5.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2230
            ] ifFalse:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2231
                i := packageDir indexOf:$:.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2232
                i ~~ 0 ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2233
                    moduleDir := packageDir copyTo:i-1.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2234
                    packageDir := packageDir copyFrom:i+1
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2235
                ]
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2236
            ]
744
eaf185681d85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2237
        ].
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2238
        moduleDir isNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2239
            moduleDir := 'stx'
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2240
        ].
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2241
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2242
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2243
    packageDir isNil ifTrue:[
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2244
        forcedPackage isNil ifTrue:[
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2245
            'SourceCodeManager [warning]: could not extract packageDir' errorPrintCR.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2246
            ^ nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2247
        ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2248
        moduleDir := forcedPackage asPackageId module.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2249
        packageDir := forcedPackage asPackageId directory.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2250
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2251
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2252
    s := self 
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2253
        streamForClass:nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2254
        fileName:classFileName 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2255
        revision:#newest 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2256
        directory:packageDir 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2257
        module:moduleDir
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2258
        cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2259
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2260
    s isNil ifTrue:[
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2261
        "/ guessed moduleDir ?
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2262
        
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2263
        sourceInfo isNil ifTrue:[
1417
2707849f626a No need to use Filename>>#concreteClass
Stefan Vogel <sv@exept.de>
parents: 1392
diff changeset
  2264
            components := Filename components:packageDir.
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2265
            moduleDir := components first.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2266
            packageDir := (Filename fromComponents:(components copyFrom:2)) asString.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2267
            s := self 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2268
                streamForClass:nil
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2269
                fileName:classFileName 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2270
                revision:#newest 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2271
                directory:packageDir 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2272
                module:moduleDir
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2273
                cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2274
        ]
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2275
    ].
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2276
    ^ s.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2277
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2278
    "Created: / 12-10-1996 / 17:22:54 / cg"
1838
91828978bae1 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1837
diff changeset
  2279
    "Modified: / 06-10-2006 / 16:17:33 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2280
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2281
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2282
getMostRecentSourceStreamForFile:aFileName inPackage:aPackage
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2283
    "given a filename, return an open stream to its most recent contents
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2284
     (not knowing anything about its version).
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2285
     Used when autoloading extensions or to compare a classes source with the most
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2286
     recent found in the repostitory."
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2287
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2288
    |directory module|
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2289
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2290
    module := aPackage asPackageId module.
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2291
    directory := aPackage asPackageId directory.
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2292
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2293
    ^ self 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2294
        streamForFile:aFileName 
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2295
        revision:#newest 
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2296
        directory:directory 
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2297
        module:module.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2298
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2299
    "Created: / 12-10-1996 / 17:22:54 / cg"
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2300
    "Modified: / 29-08-2006 / 15:49:02 / cg"
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2301
!
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2302
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2303
getSourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2304
    "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
  2305
     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
  2306
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2307
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2308
    ^ self getSourceStreamFor:aClass revision:nil
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2309
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2310
    "Created: 12.10.1996 / 17:21:03 / cg"
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2311
    "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
  2312
!
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2313
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2314
getSourceStreamFor:aClass revision:aRevisionStringOrNil
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2315
    "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
  2316
     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
  2317
     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
  2318
     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
  2319
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2320
    ^ self getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:true
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2321
!
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2322
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2323
getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:cache
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2324
    "extract a classes source code and return an open readStream on it.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2325
     A revision of nil selects the current (in image) revision.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2326
     The classes source code is extracted using the revision and the sourceCodeInfo,
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2327
     which itself is extracted from the classes packageString."
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2328
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2329
    |classFileName binaryRevision revision revisionUsed
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2330
     packageDir moduleDir sourceInfo revForMeOrNil|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2331
943
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2332
    aRevisionStringOrNil == #newest ifTrue:[
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2333
        ^ self getMostRecentSourceStreamForClassNamed:(aClass theNonMetaclass name).
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2334
    ].
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2335
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2336
    (revisionUsed := aRevisionStringOrNil) isNil ifTrue:[
2510
45b4c466a799 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2505
diff changeset
  2337
        revision := aClass revisionOfManager:self.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2338
        binaryRevision := aClass binaryRevision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2339
        binaryRevision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2340
            revision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2341
                ('SourceCodeManager [warning]: class "%1" has no revision string' bindWith:aClass name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2342
                ^ nil.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2343
            ].
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2344
            revisionUsed := revision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2345
        ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2346
            "/ see if this is a versionString for me (i.e. if I can extract my version string from it)
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2347
            revForMeOrNil := self revisionInfoFromString:aClass binaryRevisionString.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2348
            revForMeOrNil isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2349
                revision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2350
                    ('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - cannot extract version' 
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2351
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2352
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2353
                        with:self name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2354
                ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2355
                    ('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - trusting revision %2' 
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2356
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2357
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2358
                        with:self name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2359
                ].
2546
be9e1b778210 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  2360
                ^ nil
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2361
            ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2362
                revision ~= binaryRevision ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2363
                    ('SourceCodeManager [info]: "%1" has %4-revision (%2) vs. binary revision (%3) - trusting binaryRevision' 
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2364
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2365
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2366
                        with:self name) infoPrintCR.
2547
ccb236fb305e changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  2367
                    "/ self halt.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2368
                ].
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2369
                revisionUsed := binaryRevision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2370
            ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2371
        ]
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2372
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2373
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2374
    sourceInfo := self sourceInfoOfClass:aClass.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
  2375
    sourceInfo isNil ifTrue:[
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2376
"/       ('SourceCodeManager [warning]: no sourceInfo for class "%1"' bindWith:aClass name) infoPrintCR.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2377
"/        ^ nil
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2378
        "/ let's hope...
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2379
        classFileName := aClass classFilename.
2926
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2380
        packageDir := aClass package asPackageId directory.
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2381
        moduleDir := aClass package asPackageId module.
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2382
    ] ifFalse:[
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2383
        packageDir := self directoryFromSourceInfo:sourceInfo.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2384
        packageDir isNil ifTrue:[
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2385
            packageDir := aClass package asPackageId directory.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2386
            moduleDir := aClass package asPackageId module.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2387
        ] ifFalse:[
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2388
            moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2389
        ].
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2390
        classFileName := self containerFromSourceInfo:sourceInfo.
2926
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2391
    ].
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2392
    ^ self 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2393
        streamForClass:aClass
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2394
        fileName:classFileName 
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2395
        revision:revisionUsed 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2396
        directory:packageDir 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2397
        module:moduleDir
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2398
        cache:cache
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
  2399
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2400
    "Created: / 12-10-1996 / 17:21:52 / cg"
2547
ccb236fb305e changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  2401
    "Modified: / 29-09-2011 / 22:02:55 / cg"
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2402
!
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2403
3511
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2404
loadPackageWithId:aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded
2226
eab85424d4ff changed: #loadPackageWithId:fromRepositoryAsAutoloaded:
fm
parents: 2225
diff changeset
  2405
    "Should be redefined by sub classes.
3511
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2406
     Raise an exception, if load failed."
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2407
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2408
    PackageLoadError raiseRequestWith:aPackageId.
2225
fm
parents: 2224
diff changeset
  2409
!
fm
parents: 2224
diff changeset
  2410
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2411
streamForFile:fileName revision:revision directory:packageDir module:moduleDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2412
    ^ self
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2413
        streamForClass:nil
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2414
        fileName:fileName 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2415
        revision:revision 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2416
        directory:packageDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2417
        module:moduleDir
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2418
        cache:true
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2419
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2420
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2421
     SourceCodeManager 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2422
        streamForFile:'Make.spec' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2423
        revision:#newest 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2424
        directory:'libbasic2' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2425
        module:'stx'
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2426
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2427
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2428
    "Created: / 29-08-2006 / 15:41:43 / cg"
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2429
!
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2430
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2431
withClass:aClass classFileName:classFileName filedOutToTemporaryFileDo:aBlock
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2432
    "helper. fileout and eval aBlock"
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2433
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2434
    |tempDir tempFile ok packageMode filter|
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2435
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2436
    packageMode := self checkMethodPackagesOf:aClass.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2437
    packageMode == #base ifTrue:[
2979
ca2676ba02a1 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2975
diff changeset
  2438
        filter := [:mthd | mthd package == aClass package].
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2439
    ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2440
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2441
    tempDir := Filename newTemporaryDirectory.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2442
    ok := false.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2443
    [
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2444
        |aStream|
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2445
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2446
        tempFile := tempDir construct:classFileName.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2447
        [
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2448
            aStream := tempFile writeStream.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2449
        ] on:FileStream openErrorSignal do:[:ex|
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2450
            self reportError:('temporary fileout failed').
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2451
            ^ false
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2452
        ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2453
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2454
        Method flushSourceStreamCache.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2455
        Class fileOutErrorSignal handle:[:ex |
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2456
            aStream close.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2457
            self reportError:('fileout failed (',ex description,')').
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2458
            ^ false
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2459
        ] do:[
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2460
            self 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2461
                fileOutSourceCodeOf:aClass 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2462
                on:aStream 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2463
                withTimeStamp:false 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2464
                withInitialize:true 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2465
                withDefinition:true
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2466
                methodFilter:filter.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2467
        ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2468
        aStream close.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2469
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2470
        tempFile exists ifFalse:[
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2471
            self reportError:'temporary fileout failed'.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2472
            ^ false.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2473
        ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2474
        ok := aBlock value:tempFile 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2475
    ] ensure:[
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2476
        tempDir recursiveRemove
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2477
    ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2478
    ^ ok
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2479
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2480
    "
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2481
     SourceCodeManager checkinClass:Array
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2482
    "
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2483
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2484
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2485
    "Modified: / 20-08-2011 / 14:52:01 / cg"
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2486
    "Created: / 25-07-2012 / 19:38:23 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2487
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2488
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  2489
!AbstractSourceCodeManager class methodsFor:'source code administration'!
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
  2490
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2491
ensureDollarsInVersionMethod:aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2492
    "given the source code of my version method, ensure that it contains dollars for
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2493
     proper keyword expansion"
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2494
2191
fm
parents: 2183
diff changeset
  2495
    |versionString|
fm
parents: 2183
diff changeset
  2496
fm
parents: 2183
diff changeset
  2497
    versionString := aString copyWithout: $§.
fm
parents: 2183
diff changeset
  2498
    ^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString.
fm
parents: 2183
diff changeset
  2499
fm
parents: 2183
diff changeset
  2500
    "
fm
parents: 2183
diff changeset
  2501
     self ensureDollarsInVersionMethod:'foo ^ ''hello'' ' 
fm
parents: 2183
diff changeset
  2502
     self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' ' 
fm
parents: 2183
diff changeset
  2503
     self ensureDollarsInVersionMethod:'foo ^ ''   hello   '' '    
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2504
     self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '      
2191
fm
parents: 2183
diff changeset
  2505
    -- errors:
fm
parents: 2183
diff changeset
  2506
     self ensureDollarsInVersionMethod:'foo ^ ''$Head'' '    
fm
parents: 2183
diff changeset
  2507
     self ensureDollarsInVersionMethod:'foo ^ ''Header$'' '    
fm
parents: 2183
diff changeset
  2508
    "
fm
parents: 2183
diff changeset
  2509
!
fm
parents: 2183
diff changeset
  2510
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2511
ensureKeyword: keyword inVersionMethod: source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2512
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2513
    | startQuote endQuote doubleColon |
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2514
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2515
    "/nil keyword means that given source code management system
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2516
    "/does not expand keywords (StORE or Monticello, for example)
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2517
    keyword isNil ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2518
        ^source.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2519
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2520
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2521
    startQuote := source indexOf: $'.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2522
    startQuote == 0 ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2523
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2524
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2525
    (source at: startQuote + 1) == $$ ifFalse:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2526
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2527
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2528
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2529
    endQuote := source lastIndexOf: $'.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2530
    startQuote == endQuote ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2531
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2532
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2533
    (source at: endQuote - 1) == $$ ifFalse:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2534
        self error:'Does not seem to be a valid version method source. Invalid source?'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2535
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2536
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2537
    doubleColon := source indexOf: $: startingAt: startQuote + 2.
2763
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  2538
    "/ There may be no double colon at all, if the version method
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  2539
    "/ is fresh, like 'dollar-Header-dollar' (no real dollar here, as cvs expands the string)
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2540
    (doubleColon == 0 or:[doubleColon > endQuote]) ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2541
        doubleColon := endQuote - 1.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2542
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2543
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2544
    (source copyFrom: startQuote + 2 to: doubleColon - 1) = keyword ifTrue:[
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2545
        "/ Good, desired keyword is already there
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2546
        ^source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2547
    ].
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2548
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2549
    ^(source copyTo: startQuote + 1) , keyword , (source copyFrom: doubleColon)
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2550
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2551
    "Created: / 27-09-2011 / 15:00:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2763
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  2552
    "Modified (comment): / 26-01-2012 / 14:52:19 / cg"
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2553
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2554
2191
fm
parents: 2183
diff changeset
  2555
ensureKeywordExpansionWith: aCharacter inVersionMethod:aString
fm
parents: 2183
diff changeset
  2556
    "given the source code of my version method, ensure that it contains aCharacter for
fm
parents: 2183
diff changeset
  2557
     proper keyword expansion"
fm
parents: 2183
diff changeset
  2558
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2559
    |indexOfFirstQuote indexOfNextAfterFirstQuote indexOfSecondDollar indexOfNextAfterSecondDollar indexOfLastQuote|
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2560
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2561
    indexOfFirstQuote := aString indexOf:$'.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2562
    indexOfFirstQuote == 0 ifTrue:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2563
        "/ no ' found - mhmh is this a valid version method's source ?
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2564
        ^ aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2565
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2566
    indexOfNextAfterFirstQuote := aString indexOfNonSeparatorStartingAt:indexOfFirstQuote+1.
2191
fm
parents: 2183
diff changeset
  2567
    (aString at:indexOfNextAfterFirstQuote) = aCharacter ifTrue:[
fm
parents: 2183
diff changeset
  2568
        indexOfSecondDollar := aString indexOf:aCharacter startingAt:indexOfNextAfterFirstQuote+1.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2569
        ((indexOfSecondDollar == 0) 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2570
        or:[ indexOfNextAfterSecondDollar := aString indexOfNonSeparatorStartingAt:indexOfSecondDollar+1.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2571
             (aString at:indexOfNextAfterSecondDollar) ~= $' 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2572
        ]) ifTrue:[ 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2573
            self error:'invalid source (no valid version method string)' 
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2574
        ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2575
        "/ fine
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2576
        ^ aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2577
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2578
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2579
    indexOfLastQuote := aString lastIndexOf:$'.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2580
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2581
    ^ (aString copyTo:indexOfFirstQuote)
2191
fm
parents: 2183
diff changeset
  2582
        , aCharacter asString
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2583
        ,(aString copyFrom:indexOfFirstQuote+1 to:indexOfLastQuote-1)
2191
fm
parents: 2183
diff changeset
  2584
        ,aCharacter asString ,(aString copyFrom:indexOfLastQuote)
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2585
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2586
    "
2191
fm
parents: 2183
diff changeset
  2587
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '  
fm
parents: 2183
diff changeset
  2588
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''   hello   '' '
fm
parents: 2183
diff changeset
  2589
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '    
fm
parents: 2183
diff changeset
  2590
fm
parents: 2183
diff changeset
  2591
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' '  
fm
parents: 2183
diff changeset
  2592
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''   hello   '' '
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2593
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '    
2191
fm
parents: 2183
diff changeset
  2594
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2595
    -- errors:
2191
fm
parents: 2183
diff changeset
  2596
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '  
fm
parents: 2183
diff changeset
  2597
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '   
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2598
    "
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2599
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2600
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2601
ensureKeywordInVersionMethod: source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2602
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2603
    ^self ensureKeyword: self versionMethodKeyword inVersionMethod: source
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2604
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2605
    "Created: / 27-09-2011 / 14:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2606
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2607
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2608
ensureNoDollarsInVersionMethod:aString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2609
    "given the source code of another manager's version method, ensure that it does NOT
2191
fm
parents: 2183
diff changeset
  2610
     contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
fm
parents: 2183
diff changeset
  2611
fm
parents: 2183
diff changeset
  2612
    |versionString|
fm
parents: 2183
diff changeset
  2613
fm
parents: 2183
diff changeset
  2614
    versionString := aString copyWithout: $$.
fm
parents: 2183
diff changeset
  2615
    ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2616
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2617
    "
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2618
        self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '           
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  2619
        self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' '                
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2620
        self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' '             
2191
fm
parents: 2183
diff changeset
  2621
        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '    
fm
parents: 2183
diff changeset
  2622
fm
parents: 2183
diff changeset
  2623
      -- errors:
fm
parents: 2183
diff changeset
  2624
fm
parents: 2183
diff changeset
  2625
        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '   
fm
parents: 2183
diff changeset
  2626
        self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '             
fm
parents: 2183
diff changeset
  2627
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2628
    "
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2629
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2630
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2631
fileOutSourceCodeExtensions: extensions package: package on: stream
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2632
    "File out extension methods for given package on stream. 
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2633
     Not programming-language safe  - can handle smalltalk methods."
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2634
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2635
    ^self fileOutSourceCodeExtensions: extensions package: package on: stream version: true.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2636
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2637
    "Created: / 02-02-2012 / 15:30:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2638
    "Modified: / 07-11-2012 / 23:51:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2639
!
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2640
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2641
fileOutSourceCodeExtensions: extensions package: pkg on: stream version: versionIt
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2642
    "File out extension methods for given package on stream. 
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2643
     Not programming-language safe  - can handle smalltalk methods."
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2644
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2645
    | source |
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2646
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2647
    self assert: (extensions allSatisfy:[:m|m programmingLanguage isSmalltalk]).
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2648
    source := self utilities sourceCodeForExtensions:extensions package:pkg forManager:self.
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2649
    source isWideString ifTrue:[
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2650
        | s |
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2651
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2652
        s:= EncodedStream stream: stream encoder: (CharacterEncoder encoderForUTF8).      
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2653
        s nextPutAll: '"{ Encoding: utf8 }"'; cr;cr.
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2654
        s nextPutAll: source.
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2655
    ] ifFalse:[
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2656
        stream nextPutAll: source.
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2657
    ].
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2658
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2659
    self checkTabSpaceConventionIn: stream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2660
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2661
    "Created: / 07-11-2012 / 23:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2662
    "Modified: / 29-11-2013 / 13:10:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2663
!
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2664
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2665
fileOutSourceCodeOf:aClass on:aStream
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2666
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2667
    self withSourceRewriteHandlerDo:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2668
        aClass fileOutOn:aStream withTimeStamp:false.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2669
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2670
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2671
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2672
fileOutSourceCodeOf:aClass on:aStream 
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2673
      withTimeStamp:withTimeStamp withInitialize:withInitialize withDefinition:withDefinition
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2674
      methodFilter:methodFilter
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2675
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2676
    | filter |
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2677
    "JV@2012-02-02: Do not fileout extensionVersion methods, that one is filed out
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2678
     when extensions are filed out."
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2679
    (aClass inheritsFrom: ProjectDefinition) ifTrue:[
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  2680
        filter := [:m| (methodFilter value: m) 
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  2681
                        and:[ (self isExtensionsVersionMethodSelector:m selector) not
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  2682
                         "m selector ~~ self nameOfVersionMethodForExtensions"] 
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  2683
                  ]
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2684
    ] ifFalse:[
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2685
        filter := methodFilter.
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2686
    ].
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2687
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2688
    self withSourceRewriteHandlerDo:[
3628
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2689
        | writer |
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2690
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2691
        writer := aClass programmingLanguage sourceFileWriterClass new.
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2692
        writer generatingSourceForOriginal:false.
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2693
        writer 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2694
            fileOut:aClass 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2695
            on:aStream 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2696
            withTimeStamp:withTimeStamp 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2697
            withInitialize:withInitialize 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2698
            withDefinition:withDefinition 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2699
            methodFilter:methodFilter 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2700
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2701
"/        aClass fileOutOn:aStream 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2702
"/               withTimeStamp:withTimeStamp 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2703
"/               withInitialize:withInitialize 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2704
"/               withDefinition:withDefinition
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2705
"/               methodFilter:filter.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2706
    ].
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2707
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2708
    self checkTabSpaceConventionIn: aStream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2709
3631
c9ab267ee5d5 Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3629
diff changeset
  2710
    "Modified: / 04-10-2014 / 12:12:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2711
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2712
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2713
getExistingContainersInModule:aModule directory:aPackage
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2714
    "{ Pragma: +optSpace }"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2715
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2716
    "return a collection containing the names of existing containers"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2717
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2718
    ^ self subclassResponsibility
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2719
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2720
    "Created: / 23-08-2006 / 14:12:07 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2721
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2722
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2723
getExistingDirectoriesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2724
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2725
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2726
    "return a collection containing the names of existing packages"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2727
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2728
    ^ self subclassResponsibility
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2729
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2730
    "Created: / 23-08-2006 / 14:13:52 / cg"
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2731
!
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2732
676
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2733
getExistingModules
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2734
    "{ Pragma: +optSpace }"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2735
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2736
    "return a collection containing the names of existing modules"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2737
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2738
    ^ self subclassResponsibility
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2739
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2740
    "Modified: / 29.1.1997 / 18:57:29 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2741
    "Created: / 20.5.1998 / 19:38:23 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2742
!
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2743
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2744
initialRCSRevisionStringFor:aClass in:dir container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2745
    "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
  2746
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2747
    "/ do not make the string below into one string;
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2748
    "/ 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
  2749
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2750
    |nm oldRev idx special|
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2751
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2752
    nm := fileName.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2753
    (nm endsWith:',v') ifTrue:[
3230
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
  2754
        nm := nm copyButLast:2
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2755
    ].
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2756
    (nm endsWith:'.st') ifFalse:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2757
        nm := nm , '.st'
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2758
    ].
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2759
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2760
    oldRev := aClass revisionString.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2761
    special := ''.
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2762
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2763
    oldRev notNil ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2764
        idx := oldRev lastIndexOf:$[.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2765
        idx ~~ 0 ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2766
            idx := oldRev indexOf:$[ startingAt:idx+1.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2767
            idx ~~ 0 ifTrue:[
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2768
                special := ' ' , (oldRev copyFrom:idx).
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2769
            ]
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2770
        ]
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2771
    ].
122
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2772
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2773
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2774
    ^ '$' , 'Header: ' , dir , '/' , fileName , ',v $'
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2775
      , special
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2776
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2777
    "Modified: 17.9.1996 / 15:57:15 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  2778
    "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
  2779
!
4dd60cb14bc6 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 121
diff changeset
  2780
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2781
knownTagsAndRevisionsFor:aClass
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2782
    "retrieve a list of symbolic tags -> versionNr associations
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2783
     known for that class.
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2784
     I.e. which tags/symbolic versions exist, and which revision-nr is attached to it"
2319
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2785
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2786
    |log|
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2787
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2788
    log := aClass sourceCodeManager revisionLogOf:aClass fromRevision:nil toRevision:nil finishAfter:20.
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2789
    log isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2790
        SourceCodeManagerError 
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2791
            raiseRequestWith:aClass
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2792
            errorString: 'Could not fetch log (cvs connection error?)'.
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2793
        ^ #()
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2794
    ].
2827
f473f55da102 **** new version from Christian
Claus Gittinger <cg@exept.de>
parents: 2821
diff changeset
  2795
    ^ (log at:#symbolicNames ifAbsent:[ #() ]).
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2796
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2797
    "Created: / 08-02-2011 / 10:18:00 / cg"
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2798
!
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2799
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2800
knownTagsFor:aClass
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2801
    "retrieve a list of symbolic tags known for that class.
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2802
     I.e. which tags/symbolic versions exist"
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2803
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2804
    |tagRevisionMapping|
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2805
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2806
    tagRevisionMapping := self knownTagsAndRevisionsFor:aClass.
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2807
    tagRevisionMapping isEmptyOrNil ifTrue:[^ tagRevisionMapping].
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2808
    ^ tagRevisionMapping keys
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2809
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2810
    "Modified: / 08-02-2011 / 10:18:34 / cg"
2319
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2811
!
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2812
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2813
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
  2814
    "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
  2815
     Return nil on failure."
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2816
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2817
    |log|
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2818
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2819
    log := self
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2820
            revisionLogOf:nil 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2821
            fromRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2822
            toRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2823
            fileName:classFileName 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2824
            directory:packageDir 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2825
            module:moduleDir.
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2826
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2827
    log isNil ifTrue:[^ nil].
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2828
    ^ 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
  2829
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2830
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2831
     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
  2832
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2833
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2834
    "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
  2835
!
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2836
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2837
newestRevisionLogEntryOf:aClass
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2838
    "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
  2839
     Return nil on failure."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2840
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2841
    ^ 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
  2842
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2843
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2844
     SourceCodeManager newestRevisionLogEntryOf:Array       
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2845
     SourceCodeManager newestRevisionLogEntryOf:Connection 
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2846
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2847
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2848
    "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
  2849
    "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
  2850
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2851
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2852
newestRevisionOf:aClass
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2853
    "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
  2854
     Return nil on failure."
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2855
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  2856
    |sourceInfo packageDir moduleDir classFileName|
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2857
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2858
    sourceInfo := self sourceInfoOfClass:aClass.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2859
    sourceInfo isNil ifTrue:[^ nil].
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2860
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2861
    packageDir := self directoryFromSourceInfo:sourceInfo.
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  2862
    packageDir isNil ifTrue:[^ nil].
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2863
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2864
    classFileName := self containerFromSourceInfo:sourceInfo.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2865
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2866
    ^ self newestRevisionInFile:classFileName directory:packageDir module:moduleDir
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2867
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2868
"/    |log|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2869
"/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2870
"/    log := self revisionLogOf:aClass fromRevision:0 toRevision:0.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2871
"/    log isNil ifTrue:[^ nil].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2872
"/    ^ log at:#newestRevision ifAbsent:nil
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2873
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2874
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2875
     SourceCodeManager newestRevisionOf:Array       
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2876
     SourceCodeManager newestRevisionOf:Connection 
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2877
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2878
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  2879
    "Modified: / 20-08-2011 / 14:56:04 / cg"
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2880
!
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2881
2683
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2882
removeContainer: container inModule: module directory: directory
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2883
    "remove a container"
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2884
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2885
    ^ self subclassResponsibility
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2886
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2887
    "Modified (comment): / 23-12-2011 / 19:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2888
!
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  2889
2937
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2890
revisionForTag:tagName inClass:aClass
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2891
    "retrieve the revision number associated to a particular tag/symbolic version.
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2892
     Nil if unknown"
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2893
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2894
    |tagsAndVersions|
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2895
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2896
    tagsAndVersions := self knownTagsAndRevisionsFor:aClass.
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2897
    tagsAndVersions isEmptyOrNil ifTrue:[ ^ nil ].
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2898
    ^ tagsAndVersions at:tagName ifAbsent:nil.
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2899
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2900
    "
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2901
     SourceCodeManager revisionForTag:'stable' inClass:Array
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2902
    "
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2903
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2904
    "Created: / 08-02-2011 / 10:18:00 / cg"
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2905
!
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  2906
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2907
revisionInfoFromRCSString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2908
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2909
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2910
    "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
  2911
     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
  2912
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  2913
    ^ CVSVersionInfo fromRCSString:aString.
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2914
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2915
    "
968
7fa6a836642b comments
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2916
     SourceCodeManager revisionInfoFromString:'$' , 'Revision: 1.122 $'
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2917
     SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2918
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2919
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  2920
    "Modified: / 22-10-2008 / 20:18:58 / cg"
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2921
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2922
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2923
revisionInfoFromStandardVersionString:aString 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2924
    "{ Pragma: +optSpace }"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2925
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2926
    "return a VersionInfo object filled with revision info.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2927
     This extracts the relevant info from aString which is in the format as created
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2928
     by standardRevisionStringFor:...."
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2929
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2930
    |info path version user ts timeStamp idx1 idx2|
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2931
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2932
    "/ 'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826'
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2933
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2934
    idx1 := aString indexOfSubCollection:'Path: '.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2935
    idx1 ~~ 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2936
        idx1 := idx1 + 'Path: ' size.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2937
        idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2938
        path := aString copyFrom:idx1 to:idx2-1.     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2939
    ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2940
    idx1 := aString indexOfSubCollection:'Version: '.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2941
    idx1 ~~ 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2942
        idx1 := idx1 + 'Version: ' size.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2943
        idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2944
        idx2 == 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2945
            version := aString copyFrom:idx1     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2946
        ] ifFalse:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2947
            version := aString copyFrom:idx1 to:idx2-1.     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2948
        ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2949
    ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2950
    idx1 := aString indexOfSubCollection:'User: '.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2951
    idx1 ~~ 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2952
        idx1 := idx1 + 'User: ' size.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2953
        idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2954
        idx2 == 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2955
            user := aString copyFrom:idx1     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2956
        ] ifFalse:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2957
            user := aString copyFrom:idx1 to:idx2-1.     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2958
        ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2959
    ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2960
    idx1 := aString indexOfSubCollection:'Time: '.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2961
    idx1 ~~ 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2962
        idx1 := idx1 + 'Time: ' size.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2963
        idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2964
        idx2 == 0 ifTrue:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2965
            ts := aString copyFrom:idx1     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2966
        ] ifFalse:[
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2967
            ts := aString copyFrom:idx1 to:idx2-1.     
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2968
        ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2969
        timeStamp := Timestamp readIso8601FormatFrom:ts
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2970
    ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2971
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2972
    info := VersionInfo new.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2973
    path notNil ifTrue:[ info fileName:(path asFilename baseName) ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2974
    info revision:version.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2975
    user notNil ifTrue:[ info user:user ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2976
    timeStamp notNil ifTrue:[ info timeStamp:timeStamp ].
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2977
    ^ info
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2978
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2979
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2980
     self revisionInfoFromString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2981
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2982
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2983
    "Created: / 23-07-2012 / 18:45:41 / cg"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2984
!
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  2985
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2986
revisionInfoFromString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2987
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2988
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2989
    "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
  2990
     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
  2991
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2992
    ^ self subclassResponsibility
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2993
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2994
    "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
  2995
    "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
  2996
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2997
2552
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2998
revisionInfoFromString: vsnString inClass: class
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  2999
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3000
    ^self revisionInfoFromString: vsnString
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3001
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3002
    "Modified: / 03-10-2011 / 13:05:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3003
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3004
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3005
revisionLogOf:aClass
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3006
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3007
     the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3008
     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
  3009
     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
  3010
     filled with:
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3011
            #container          -> the RCS container file name
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3012
            #filename           -> the actual source file name
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3013
            #newestRevision     -> the revisionString of the newest revision
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3014
            #numberOfRevisions  -> the number of revisions in the container
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3015
            #revisions          -> collection of per-revision info
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3016
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3017
            per revision info consists of one record per revision:
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3018
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3019
              #revision              -> the revision string
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3020
              #author                -> who checked that revision into the repository
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3021
              #date                  -> when was it checked in
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3022
              #state                 -> the RCS state
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3023
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3024
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3025
            revisions are ordered newest first 
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3026
            (i.e. the last entry is for the initial revision; the first for the most recent one)
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3027
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3028
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3029
    ^ self
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3030
        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
  3031
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3032
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3033
     SourceCodeManager revisionLogOf:Array 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3034
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3035
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3036
    "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
  3037
    "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
  3038
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3039
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3040
revisionLogOf:aClass fromRevision:rev1
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3041
    "return info about the repository container and
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3042
     (part of) the revisionlog as a collection of revision entries.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3043
     Return nil on failure.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3044
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3045
     The returned information is a structure (IdentityDictionary)
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3046
     filled with:
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3047
            #container          -> the RCS container file name 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3048
            #filename           -> the actual source file name
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3049
            #newestRevision     -> the revisionString of the newest revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3050
            #numberOfRevisions  -> the number of revisions in the container
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3051
            #revisions          -> collection of per-revision info (see below)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3052
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3053
         for some classes, additional info is returned:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3054
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3055
            #renamed            -> true if the class has been renamed or copied
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3056
                                   and the sourceInfo is from the previous one
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3057
            #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
  3058
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3059
            rev1 specifies from which revisions a logEntry is wanted:
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3060
              If rev1 is nil, the first revision is the initial revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3061
              otherwise, the log starts with that revision.
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3062
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3063
            per revision info consists of one record per revision:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3064
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3065
              #revision              -> the revision string
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3066
              #author                -> who checked that revision into the repository
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3067
              #date                  -> when was it checked in
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3068
              #state                 -> the RCS state
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3069
              #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
  3070
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3071
            revisions are ordered newest first 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3072
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3073
                  the first for the most recent one)
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3074
        "
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3075
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3076
    ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3077
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3078
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3079
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40'
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3080
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3081
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3082
    "Created: 6.11.1995 / 18:56:00 / cg"
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3083
    "Modified: 10.1.1997 / 13:29:50 / cg"
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3084
!
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3085
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3086
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3087
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3088
     (part of) the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3089
     Return nil on failure.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3090
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3091
     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
  3092
     filled with:
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3093
            #container          -> the RCS container file name 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3094
            #filename           -> the actual source file name
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3095
            #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
  3096
            #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
  3097
            #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
  3098
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3099
         for some classes, additional info is returned:
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3100
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3101
            #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
  3102
                                   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
  3103
            #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
  3104
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3105
            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
  3106
              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
  3107
              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
  3108
              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
  3109
              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
  3110
              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
  3111
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3112
            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
  3113
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3114
              #revision              -> the revision string
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3115
              #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
  3116
              #date                  -> when was it checked in
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3117
              #state                 -> the RCS state
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3118
              #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
  3119
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3120
            revisions are ordered newest first 
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3121
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3122
                  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
  3123
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3124
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3125
    ^ self
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3126
        revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3127
        finishAfter:nil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3128
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3129
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3130
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCountOrNil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3131
    "return info about the repository container and
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3132
     (part of) the revisionlog as a collection of revision entries.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3133
     Return nil on failure.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3134
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3135
     The returned information is a structure (IdentityDictionary)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3136
     filled with:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3137
            #container          -> the RCS container file name 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3138
            #filename           -> the actual source file name
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3139
            #newestRevision     -> the revisionString of the newest revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3140
            #numberOfRevisions  -> the number of revisions in the container
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3141
            #revisions          -> collection of per-revision info (see below)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3142
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3143
         for some classes, additional info is returned:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3144
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3145
            #renamed            -> true if the class has been renamed or copied
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3146
                                   and the sourceInfo is from the previous one
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3147
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3148
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3149
            rev1 / rev2 specify from which revisions a logEntry is wanted:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3150
              If rev1 is nil, the first revision is the initial revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3151
              otherwise, the log starts with that revision.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3152
              If rev2 is nil, the last revision is the newest revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3153
              otherwise, the log ends with that revision.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3154
              If both are nil, no logEntries are extracted (i.e. only the header).
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3155
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3156
            per revision info consists of one record per revision:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3157
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3158
              #revision              -> the revision string
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3159
              #author                -> who checked that revision into the repository
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3160
              #date                  -> when was it checked in
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3161
              #state                 -> the RCS state
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3162
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3163
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3164
            revisions are ordered newest first 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3165
            (i.e. the last entry is for the initial revision; 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3166
                  the first for the most recent one)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3167
        "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3168
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  3169
    |sourceInfo packageDir moduleDir classFileName info|
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3170
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3171
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3172
    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
  3173
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3174
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3175
    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
  3176
    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
  3177
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3178
    info := self 
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3179
        revisionLogOf:aClass
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3180
        fromRevision:rev1 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3181
        toRevision:rev2
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3182
        numberOfRevisions:maxCountOrNil
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3183
        fileName:classFileName
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3184
        directory:packageDir 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3185
        module:moduleDir.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3186
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3187
    info notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3188
"/        (sourceInfo includesKey:#renamed) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3189
"/            info at:#renamed put:(sourceInfo at:#renamed)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3190
"/        ].
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3191
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3192
            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
  3193
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3194
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3195
    ^ info
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3196
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3197
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3198
     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
  3199
     SourceCodeManager revisionLogOf:XtBoxNew 
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3200
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3201
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3202
    "Created: / 06-11-1995 / 18:56:00 / cg"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3203
    "Modified: / 23-08-2006 / 14:10:50 / cg"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3204
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3205
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3206
revisionLogOf:aClass numberOfRevisions:numRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3207
    "return info about the repository container and
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3208
     (part of) the revisionlog (numRevisions newest revisions) 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3209
     as a collection of revision entries.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3210
     Return nil on failure.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3211
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3212
     The returned information is a structure (IdentityDictionary)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3213
     filled with:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3214
            #container          -> the RCS container file name 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3215
            #filename           -> the actual source file name
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3216
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  3217
            #numberOfRevisions  -> the number of revisions in the container (nil for all)
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3218
            #revisions          -> collection of per-revision info (see below)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3219
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3220
         for some classes, additional info is returned:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3221
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3222
            #renamed            -> true if the class has been renamed or copied
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3223
                                   and the sourceInfo is from the previous one
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3224
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3225
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3226
            rev1 / rev2 specify from which revisions a logEntry is wanted:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3227
              If rev1 is nil, the first revision is the initial revision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3228
              otherwise, the log starts with that revision.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3229
              If rev2 is nil, the last revision is the newest revision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3230
              otherwise, the log ends with that revision.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3231
              If both are nil, no logEntries are extracted (i.e. only the header).
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3232
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3233
            per revision info consists of one record per revision:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3234
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3235
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3236
              #author                -> who checked that revision into the repository
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3237
              #date                  -> when was it checked in
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3238
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3239
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3240
              #logMessage            -> the checkIn log message
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3241
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3242
            revisions are ordered newest first 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3243
            (i.e. the last entry is for the initial revision; 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3244
                  the first for the most recent one)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3245
        "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3246
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3247
    |sourceInfo packageDir moduleDir classFileName info|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3248
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3249
    sourceInfo := self sourceInfoOfClass:aClass.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3250
    sourceInfo isNil ifTrue:[^ nil].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3251
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3252
    packageDir := self directoryFromSourceInfo:sourceInfo.
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3253
    moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3254
    classFileName := self containerFromSourceInfo:sourceInfo.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3255
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3256
    info := self 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3257
        revisionLogOf:aClass
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3258
        numberOfRevisions:numRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3259
        fileName:classFileName
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3260
        directory:packageDir 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3261
        module:moduleDir.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3262
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3263
    info notNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3264
"/        (sourceInfo includesKey:#renamed) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3265
"/            info at:#renamed put:(sourceInfo at:#renamed)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3266
"/        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3267
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3268
            info at:#expectedFileName put:(sourceInfo at:#expectedFileName)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3269
        ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3270
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3271
    ^ info
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3272
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3273
    "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3274
     SourceCodeManager revisionLogOf:Array numberOfRevisions:10 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3275
    "
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3276
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3277
    "Modified: / 23-08-2006 / 14:10:52 / cg"
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3278
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3279
2600
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3280
revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDir module:moduleDir
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3281
    ^ self 
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3282
        revisionLogOf:clsOrNil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3283
        fromRevision:nil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3284
        toRevision:nil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3285
        numberOfRevisions:numRevisions
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3286
        fileName:classFileName
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3287
        directory:packageDir
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3288
        module:moduleDir
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3289
!
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3290
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3291
revisionLogOfContainer:classFileName directory:packageDir module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3292
    "return info about the repository container and
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3293
     (part of) the revisionlog as a collection of revision entries.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3294
     Return nil on failure.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3295
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3296
     The returned information is a structure (IdentityDictionary)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3297
     filled with:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3298
            #container          -> the RCS container file name 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3299
            #filename           -> the actual source file name
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3300
            #newestRevision     -> the revisionString of the newest revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3301
            #numberOfRevisions  -> the number of revisions in the container
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3302
            #revisions          -> collection of per-revision info (see below)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3303
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3304
            per revision info consists of one record per revision:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3305
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3306
              #revision              -> the revision string
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3307
              #author                -> who checked that revision into the repository
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3308
              #date                  -> when was it checked in
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3309
              #state                 -> the RCS state
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3310
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3311
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3312
            revisions are ordered newest first 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3313
            (i.e. the last entry is for the initial revision; 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3314
                  the first for the most recent one)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3315
        "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3316
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3317
    ^ self
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3318
        revisionLogOf:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3319
        fromRevision:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3320
        toRevision:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3321
        fileName:classFileName 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3322
        directory:packageDir 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3323
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3324
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3325
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3326
     CVSSourceCodeManager
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3327
        revisionLogInFile:'Array.st' directory:'libbasic' module:'stx'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3328
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3329
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3330
    "Modified: 10.1.1997 / 13:29:06 / cg"
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3331
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3332
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3333
revisionLogOfContainer:fileName module:moduleDir directory:packageDir fromRevision:rev1 toRevision:rev2
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3334
    "return info about the repository container and
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3335
     (part of) the revisionlog as a collection of revision entries.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3336
     Return nil on failure.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3337
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3338
     The returned information is a structure (IdentityDictionary)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3339
     filled with:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3340
            #container          -> the RCS container file name 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3341
            #filename           -> the actual source file name
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3342
            #newestRevision     -> the revisionString of the newest revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3343
            #numberOfRevisions  -> the number of revisions in the container
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3344
            #revisions          -> collection of per-revision info (see below)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3345
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3346
         for some classes, additional info is returned:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3347
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3348
            #renamed            -> true if the class has been renamed or copied
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3349
                                   and the sourceInfo is from the previous one
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3350
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3351
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3352
            rev1 / rev2 specify from which revisions a logEntry is wanted:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3353
              If rev1 is nil, the first revision is the initial revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3354
              otherwise, the log starts with that revision.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3355
              If rev2 is nil, the last revision is the newest revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3356
              otherwise, the log ends with that revision.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3357
              If both are nil, no logEntries are extracted (i.e. only the header).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3358
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3359
            per revision info consists of one record per revision:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3360
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3361
              #revision              -> the revision string
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3362
              #author                -> who checked that revision into the repository
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3363
              #date                  -> when was it checked in
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3364
              #state                 -> the RCS state
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3365
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3366
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3367
            revisions are ordered newest first 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3368
            (i.e. the last entry is for the initial revision; 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3369
                  the first for the most recent one)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3370
        "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3371
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3372
    |info|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3373
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3374
    info := self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3375
        revisionLogOf:nil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3376
        fromRevision:rev1 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3377
        toRevision:rev2
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3378
        fileName:fileName
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3379
        directory:packageDir 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3380
        module:moduleDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3381
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3382
    ^ info
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3383
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3384
    "
1980
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3385
     SourceCodeManager 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3386
        revisionLogOfContainer:'Array.st' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3387
        module:'stx' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3388
        directory:'libbasic' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3389
        fromRevision:'1.1' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3390
        toRevision:nil 
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3391
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3392
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3393
    "Created: / 23-08-2006 / 14:14:59 / cg"
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3394
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3395
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3396
revisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3397
    "utility function: return a string usable as initial revision string.
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3398
     Can be redefined in subclasses"
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3399
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3400
    ^ self standardRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3401
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3402
    "
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3403
     self 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3404
        revisionStringFor:Array 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3405
        inModule:'stx' 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3406
        directory:'libbasic' 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3407
        container:'Array.st' 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3408
        revision:'123'          
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3409
    "
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3410
!
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3411
213
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3412
revisionsOf:aClass
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3413
    "return a collection of revisions (as strings) found in the repository.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3414
     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
  3415
     Return nil on failure."
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3416
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3417
    |log revisions|
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3418
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3419
    log := self revisionLogOf:aClass.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3420
    log isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3421
    revisions := log at:#revisions ifAbsent:nil.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3422
    revisions isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3423
    ^ revisions collect:[:rev | rev at:#revision].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3424
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3425
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3426
     SourceCodeManager revisionsOf:Array       
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3427
     SourceCodeManager newestRevisionOf:Array 
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3428
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3429
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3430
    "Modified: 10.4.1996 / 23:14:24 / cg"
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3431
    "Created: 19.4.1996 / 17:24:34 / cg"
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3432
!
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3433
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3434
standardRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3435
    "utility function: return a string usable as initial revision string"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3436
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3437
    ^ 'Path: %1/%2/%3, Version: %4, User: %5, Time: %6'
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3438
        bindWith:moduleDir
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3439
        with:packageDir
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3440
        with:fileName
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3441
        with:revisionString
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3442
        with:(OperatingSystem getLoginName)
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3443
        with:(Timestamp now printStringIso8601Format)
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3444
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3445
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3446
     self 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3447
        revisionStringFor:Array 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3448
        inModule:'stx' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3449
        directory:'libbasic' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3450
        container:'Array.st' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3451
        revision:'123'          
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3452
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3453
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3454
    "Created: / 23-07-2012 / 18:46:29 / cg"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3455
!
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3456
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3457
withSourceRewriteHandlerDo:aBlock
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  3458
    "hook for just-in-time rewriting of a method's sourceCode while filing out
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  3459
     used when saving version_XXX methods in a non-XXX sourceCodeManager"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3460
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3461
    AbstractSourceFileWriter methodSourceRewriteQuery handle:[:rewriteQuery |
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3462
        |m newSource selector|
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3463
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3464
        m := rewriteQuery method.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3465
        m isVersionMethod ifFalse:[                                                            
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3466
            rewriteQuery proceedWith:rewriteQuery source.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3467
        ].
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3468
        selector := m selector.
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3469
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3470
        ((self isVersionMethodSelector:selector) "selector = self nameOfVersionMethodInClasses" 
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3471
        or:[(self isExtensionsVersionMethodSelector:selector) "selector = self nameOfVersionMethodForExtensions" 
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3472
        or:[selector = Class nameOfOldVersionMethod]]) ifTrue:[
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3473
            "/ it's my version method - make sure that it has $'s around...
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3474
            newSource := self ensureDollarsInVersionMethod:rewriteQuery source.
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3475
            (selector = Class nameOfOldVersionMethod) ifTrue:[
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3476
                "/ #version method: make sure that it contains proper
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3477
                "/ keyword (Header for CVS/P4, Id for SVN...
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3478
                newSource := self ensureKeywordInVersionMethod: newSource.
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3479
            ]
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3480
        ] ifFalse:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3481
            "/ it's another manager's version method - make sure that it has NONONO $'s around...
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3482
            newSource := self ensureNoDollarsInVersionMethod:rewriteQuery source.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3483
        ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3484
        rewriteQuery proceedWith:newSource
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3485
    ] do:aBlock.
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3486
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3487
    "Modified: / 27-09-2011 / 16:48:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3488
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3489
3595
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3490
writeHistoryLogSince:timeGoal filterSTSources:filterSTSourcesBoolean 
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3491
        filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter 
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3492
        filterProjects:projectFilterArg to:aStream
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3493
    "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
  3494
     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
  3495
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3496
    |projectFilter goalString prevUser prevCvsRoot |
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3497
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3498
    projectFilter := projectFilterArg isEmptyOrNil ifTrue:nil ifFalse:projectFilterArg.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3499
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3500
    goalString := ''.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3501
    projectFilter notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3502
        projectFilter size == 1 ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3503
            goalString := goalString , 'of ',projectFilter first.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3504
        ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3505
            projectFilter size == 2 ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3506
                goalString := goalString , 'of ',projectFilter first,' and ',projectFilter second.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3507
            ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3508
                goalString := goalString , 'of ',projectFilter size printString,' projects'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3509
            ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3510
        ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3511
        goalString := goalString,' '
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3512
    ].
1447
2ac1cf09722b isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  3513
    (timeGoal notEmptyOrNil) ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3514
        goalString := goalString , 'since ' , timeGoal,' '.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3515
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3516
    userFilter notNil ifTrue:[
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3517
        userFilter isString ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3518
            goalString := 'by user ',userFilter
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3519
        ] ifFalse:[
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3520
            userFilter size == 1 ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3521
                goalString := 'by user ',(userFilter first) 
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3522
            ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3523
                goalString := 'by users ',(userFilter first),'...',(userFilter last) 
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3524
            ]
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3525
        ].
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3526
        goalString := goalString,' '.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3527
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3528
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3529
    aStream nextPutLine:'**** repository history ' , goalString , '****'.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3530
    aStream cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3531
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3532
    self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3533
        reportHistoryLogSince:timeGoal 
2100
cdbd6a3ada7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2082
diff changeset
  3534
        filterSTSources:filterSTSourcesBoolean 
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3535
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3536
        filterRepository:repositoryFilter 
1038
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3537
        filterModules:moduleFilter
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3538
        inTo:[:info |
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3539
            |user recordType fileName date time rev pkgDir 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3540
             module directory pkg
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3541
             clsName cvsRoot cls clsRev revInfo|
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3542
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3543
            pkgDir := info at:#directory ifAbsent:'?'.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3544
            module := pkgDir upTo:$/.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3545
            directory := pkgDir copyFrom:(module size+2).
1910
a260d4326328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  3546
            pkg := (PackageId module:module directory:directory) asString.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3547
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3548
            (projectFilter isEmptyOrNil
3595
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3549
                or:[ projectFilter contains:[:pat | pat match:pkg caseSensitive:false] ]
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3550
            ) ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3551
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3552
                user := info at:#user ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3553
                recordType := info at:#cvsRecordType ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3554
                fileName := info at:#fileName ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3555
                date := info at:#date ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3556
                time := info at:#time ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3557
                rev := info at:#revision ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3558
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3559
                clsName := info at:#className ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3560
                cvsRoot := info at:#cvsRoot ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3561
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3562
                cvsRoot ~= prevCvsRoot ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3563
                    aStream cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3564
                    aStream nextPutLine:'>>>> repository: ' , cvsRoot , ' <<<<'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3565
                    aStream cr; cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3566
                    aStream nextPutLine:'     Date    Time        User    Rev    File                           Package'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3567
                    prevUser := nil.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3568
                    prevCvsRoot := cvsRoot.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3569
                ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3570
                prevUser ~= user ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3571
                    aStream cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3572
                    prevUser := user.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3573
                ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3574
                aStream 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3575
                    nextPutAll:recordType; space; 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3576
                    nextPutAll:(date printString paddedTo:10); space; nextPutAll:(time printString paddedTo:5); space;
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3577
                    nextPutAll:(user leftPaddedTo:10); space;             
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3578
                    nextPutAll:(rev decimalPaddedTo:8 and:4 at:$. withLeft:(Character space) right:nil); tab;              
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3579
                    nextPutAll:(fileName paddedTo:30); space;                 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3580
                    nextPutAll:pkg.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3581
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3582
                "/
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3583
                "/ for your convenience:
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3584
                "/  check what the actual version is in the image
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3585
                "/
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3586
                clsName notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3587
                    revInfo := nil.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3588
                    cls := Smalltalk classNamed:clsName.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3589
                    (cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3590
                        rev ~= clsRev ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3591
                            revInfo := (' current: ' , clsRev)
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3592
                        ]
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3593
                    ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3594
                        cls isNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3595
                            revInfo := (' current: ** none **')
1480
c42afcba343a Fix "cvs history"
Stefan Vogel <sv@exept.de>
parents: 1467
diff changeset
  3596
                        ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3597
                            cls isLoaded ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3598
                                revInfo := (' current: ** no revision info **')
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3599
                            ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3600
                                revInfo := (' current: ** not loaded **')
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3601
                            ]    
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3602
                        ]
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3603
                    ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3604
                    revInfo notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3605
                        aStream nextPutAll:revInfo
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3606
                    ].
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3607
                ].
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3608
                aStream cr                              
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3609
            ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3610
        ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3611
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3612
    "Created: / 12-09-2006 / 15:18:35 / cg"
1910
a260d4326328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  3613
    "Modified: / 18-11-2006 / 17:09:55 / cg"
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3614
!
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3615
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3616
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter to:aStream
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3617
    "send a full historyLog to some stream.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3618
     This walks over all possible repository roots."
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3619
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3620
    self
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3621
        writeHistoryLogSince:timeGoal 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3622
        filterSTSources:filter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3623
        filterUser:userFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3624
        filterRepository:repositoryFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3625
        filterModules:moduleFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3626
        filterProjects:nil 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3627
        to:aStream
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3628
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3629
    "Modified: / 12-09-2006 / 15:19:11 / cg"
1038
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3630
!
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3631
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3632
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter to:aStream
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3633
    "send a full historyLog to some stream.
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3634
     This walks over all possible repository roots."
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3635
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3636
    ^self
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3637
        writeHistoryLogSince:timeGoal 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3638
        filterSTSources:filter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3639
        filterUser:userFilter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3640
        filterRepository:repositoryFilter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3641
        filterModules:nil to:aStream
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3642
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3643
    "Modified: / 17.1.2001 / 13:15:54 / cg"
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3644
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3645
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3646
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
  3647
    "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
  3648
     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
  3649
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3650
    ^ self
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3651
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3652
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3653
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3654
        filterRepository:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3655
        to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3656
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3657
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3658
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3659
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3660
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3661
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3662
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3663
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3664
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3665
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3666
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3667
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3668
    "Modified: 12.9.1996 / 02:36:32 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3669
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3670
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3671
writeHistoryLogSince:timeGoal to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3672
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3673
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3674
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3675
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3676
        filterSTSources:true 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3677
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3678
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3679
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3680
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3681
    "Created: 13.12.1995 / 10:28:27 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  3682
    "Modified: 12.9.1996 / 02:36:38 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3683
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  3684
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3685
writeRevisionLogMessagesFrom:log to:aStream
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3686
    "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
  3687
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3688
    ^ 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
  3689
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3690
    "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
  3691
!
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3692
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3693
writeRevisionLogMessagesFrom:log withHeader:header to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3694
    "helper; send the revisionlog to aStream"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3695
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3696
    |tags|
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3697
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3698
    header ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3699
"/        (log at:#renamed ifAbsent:false) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3700
"/            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
  3701
"/            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
  3702
"/            aStream cr; cr.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3703
"/        ].
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  3704
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3705
        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
  3706
        aStream nextPutAll:'  Newest revision: '; nextPutLine:(log at:#newestRevision) printString.
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3707
        tags := log at:#symbolicNames ifAbsent:nil.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3708
        tags notNil ifTrue:[
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3709
            aStream nextPutAll:'  Stable revision: '; nextPutAll:(tags at:'stable' ifAbsent:'none'); cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3710
            aStream nextPutAll:'  Symbolic names: '; cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3711
            "sort tags by tag name"
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3712
            tags := tags associations sort:[:a :b| a key < b key].
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3713
            tags do:[:eachAssociation|
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3714
                aStream tab; nextPutAll:eachAssociation key; 
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3715
                             nextPutAll:': '; 
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3716
                             nextPutAll:eachAssociation value; cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3717
            ]
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  3718
        ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3719
    ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3720
2821
687ec021401e changed: #writeRevisionLogMessagesFrom:withHeader:to:
Stefan Vogel <sv@exept.de>
parents: 2788
diff changeset
  3721
    (log at:#revisions ifAbsent:#()) do:[:entry |
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3722
        |logMsg|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3723
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3724
        aStream cr.
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3725
        aStream nextPutAll:'  revision '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3726
            show:(entry at:#revision); tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3727
        aStream nextPutAll:' date: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3728
            show:((entry at:#date ifAbsent:nil) ? '?'); space;
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3729
            show:((entry at:#time ifAbsent:nil) ? '?'); tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3730
        aStream nextPutAll:' author: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3731
            show:(entry at:#author ifAbsent:nil) ? '?'; tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3732
        aStream nextPutAll:' lines: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3733
            show:(entry at:#numberOfChangedLines ifAbsent:nil) ? '?'; cr.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3734
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3735
        logMsg := entry at:#logMessage ifAbsent:''.
1467
26f9edcb3542 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
  3736
        (logMsg isBlank or:[logMsg withoutSeparators = '.']) ifTrue:[
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3737
            logMsg := '*** empty log message ***'
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3738
        ].
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3739
        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
  3740
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3741
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3742
    "Created: / 16-11-1995 / 13:25:30 / cg"
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3743
    "Modified: / 27-11-1996 / 18:26:30 / stefan"
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  3744
    "Modified: / 21-12-2011 / 23:33:53 / cg"
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3745
!
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3746
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3747
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount to:aStream
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3748
    "extract a classes log and append it to aStream."
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3749
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3750
    |log |
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3751
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3752
    log := self revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3753
    log isNil ifTrue:[
1024
7344e4e24b1c missing repository-log message beautified
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
  3754
        aStream cr; nextPutAll:'  ** No revision log available **'.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3755
        ^ false
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3756
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3757
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3758
    self writeRevisionLogMessagesFrom:log to:aStream.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3759
    ^ true
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3760
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3761
    "
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3762
     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
  3763
    "
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3764
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  3765
    "Created: 6.11.1995 / 18:56:00 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  3766
    "Modified: 14.2.1997 / 21:11:57 / cg"
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3767
!
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3768
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3769
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3770
    "extract a classes log and append it to aStream."
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3771
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3772
    ^ self
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3773
        writeRevisionLogOf:aClass 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3774
        fromRevision:rev1 toRevision:rev2 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3775
        finishAfter:nil to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3776
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3777
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3778
     SourceCodeManager writeRevisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' to:Transcript 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3779
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3780
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3781
    "Created: 6.11.1995 / 18:56:00 / cg"
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3782
    "Modified: 14.2.1997 / 21:11:57 / cg"
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3783
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3784
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3785
writeRevisionLogOf:aClass short:shortOrNot to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3786
    "extract a classes log and append it to aStream."
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3787
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3788
    ^ self
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3789
        writeRevisionLogOf:aClass 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3790
        fromRevision:nil 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3791
        toRevision:nil 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3792
        finishAfter:(shortOrNot ifTrue:20 ifFalse:nil)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3793
        to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3794
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3795
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3796
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3797
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3798
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3799
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3800
writeRevisionLogOf:aClass to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3801
    "extract a classes log and append it to aStream."
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3802
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3803
    ^ self writeRevisionLogOf:aClass short:false to:aStream
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3804
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3805
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3806
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3807
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  3808
! !
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  3809
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3810
!AbstractSourceCodeManager class methodsFor:'subclass responsibility'!
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3811
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3812
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter 
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3813
        filterRepository:repositoryFilter filterModules:moduleFilter inTo:aBlock
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3814
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3815
    ^ self subclassResponsibility
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3816
! !
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  3817
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3818
!AbstractSourceCodeManager class methodsFor:'testing'!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3819
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3820
isCVS
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3821
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3822
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3823
    "Created: / 16-08-2006 / 10:58:27 / cg"
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3824
!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3825
2786
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  3826
isGit
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  3827
    ^ false
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  3828
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  3829
    "Created: / 02-03-2012 / 16:44:02 / cg"
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  3830
!
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  3831
2725
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3832
isMercurial
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3833
    ^ false
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3834
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3835
    "Created: / 14-01-2012 / 21:54:19 / cg"
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3836
!
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  3837
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  3838
isSVN
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3839
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3840
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  3841
    "Created: / 16-08-2006 / 10:58:27 / cg"
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3842
!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3843
1890
9a64ba9dcf37 changed #methodChange:
Claus Gittinger <cg@exept.de>
parents: 1889
diff changeset
  3844
isSmallTeam
1889
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3845
    ^ false
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3846
1890
9a64ba9dcf37 changed #methodChange:
Claus Gittinger <cg@exept.de>
parents: 1889
diff changeset
  3847
    "Created: / 09-11-2006 / 14:30:22 / cg"
1889
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3848
!
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  3849
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3850
isStore
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3851
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3852
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3853
    "Created: / 16-08-2006 / 10:59:26 / cg"
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3854
! !
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  3855
2445
vrany
parents: 2443
diff changeset
  3856
!AbstractSourceCodeManager::PackageAndManager class methodsFor:'instance creation'!
vrany
parents: 2443
diff changeset
  3857
vrany
parents: 2443
diff changeset
  3858
package: package manager: manager
vrany
parents: 2443
diff changeset
  3859
vrany
parents: 2443
diff changeset
  3860
    ^self new
vrany
parents: 2443
diff changeset
  3861
        package: package;
vrany
parents: 2443
diff changeset
  3862
        manager: manager.
vrany
parents: 2443
diff changeset
  3863
vrany
parents: 2443
diff changeset
  3864
    "Created: / 09-07-2011 / 13:58:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3865
! !
vrany
parents: 2443
diff changeset
  3866
vrany
parents: 2443
diff changeset
  3867
!AbstractSourceCodeManager::PackageAndManager methodsFor:'accessing'!
vrany
parents: 2443
diff changeset
  3868
vrany
parents: 2443
diff changeset
  3869
manager
vrany
parents: 2443
diff changeset
  3870
vrany
parents: 2443
diff changeset
  3871
    ^AbstractSourceCodeManager named: managerTypeName
vrany
parents: 2443
diff changeset
  3872
vrany
parents: 2443
diff changeset
  3873
    "Created: / 09-07-2011 / 13:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3874
!
vrany
parents: 2443
diff changeset
  3875
vrany
parents: 2443
diff changeset
  3876
manager: aSourceCodeManager
vrany
parents: 2443
diff changeset
  3877
vrany
parents: 2443
diff changeset
  3878
    managerTypeName := aSourceCodeManager managerTypeName
vrany
parents: 2443
diff changeset
  3879
vrany
parents: 2443
diff changeset
  3880
    "Created: / 09-07-2011 / 13:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3881
!
vrany
parents: 2443
diff changeset
  3882
vrany
parents: 2443
diff changeset
  3883
managerTypeName
vrany
parents: 2443
diff changeset
  3884
    ^ managerTypeName
vrany
parents: 2443
diff changeset
  3885
!
vrany
parents: 2443
diff changeset
  3886
vrany
parents: 2443
diff changeset
  3887
managerTypeName:something
vrany
parents: 2443
diff changeset
  3888
    managerTypeName := something.
vrany
parents: 2443
diff changeset
  3889
!
vrany
parents: 2443
diff changeset
  3890
vrany
parents: 2443
diff changeset
  3891
package
vrany
parents: 2443
diff changeset
  3892
    ^ package
vrany
parents: 2443
diff changeset
  3893
!
vrany
parents: 2443
diff changeset
  3894
vrany
parents: 2443
diff changeset
  3895
package:something
vrany
parents: 2443
diff changeset
  3896
    package := something.
vrany
parents: 2443
diff changeset
  3897
! !
vrany
parents: 2443
diff changeset
  3898
2477
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3899
!AbstractSourceCodeManager::PackageAndManager methodsFor:'comparing'!
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3900
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3901
= aPackageAndManagerOrNil
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3902
    aPackageAndManagerOrNil isNil ifTrue:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3903
    aPackageAndManagerOrNil package = package ifFalse:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3904
    aPackageAndManagerOrNil managerTypeName = managerTypeName ifFalse:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3905
    ^ true
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3906
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3907
    "Created: / 19-08-2011 / 01:47:34 / cg"
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3908
!
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3909
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3910
hash
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3911
    ^ package hash bitXor: managerTypeName hash
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3912
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3913
    "Created: / 19-08-2011 / 01:47:56 / cg"
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3914
! !
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  3915
2445
vrany
parents: 2443
diff changeset
  3916
!AbstractSourceCodeManager::PackageAndManager methodsFor:'displaying'!
vrany
parents: 2443
diff changeset
  3917
vrany
parents: 2443
diff changeset
  3918
displayStringForManagerTypeName
vrany
parents: 2443
diff changeset
  3919
    ^ self manager isNil 
vrany
parents: 2443
diff changeset
  3920
        ifFalse:[ managerTypeName ]
vrany
parents: 2443
diff changeset
  3921
        ifTrue:
vrany
parents: 2443
diff changeset
  3922
            [ (managerTypeName , ' (unavailable)') asText colorizeAllWith:Color gray ].
vrany
parents: 2443
diff changeset
  3923
vrany
parents: 2443
diff changeset
  3924
    "Created: / 09-07-2011 / 14:05:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  3925
!
vrany
parents: 2443
diff changeset
  3926
vrany
parents: 2443
diff changeset
  3927
displayStringForPackage
vrany
parents: 2443
diff changeset
  3928
    ^ self manager isNil 
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  3929
        ifTrue:[ package asText colorizeAllWith:Color gray ]
2445
vrany
parents: 2443
diff changeset
  3930
        ifFalse:[ package ]
vrany
parents: 2443
diff changeset
  3931
vrany
parents: 2443
diff changeset
  3932
    "Created: / 09-07-2011 / 14:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  3933
    "Modified: / 03-12-2011 / 11:31:49 / cg"
2445
vrany
parents: 2443
diff changeset
  3934
! !
vrany
parents: 2443
diff changeset
  3935
2623
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3936
!AbstractSourceCodeManager::PackageAndManager methodsFor:'printing & storing'!
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3937
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3938
printOn:aStream
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3939
    "append a printed representation if the receiver to the argument, aStream"
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3940
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3941
    super printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3942
    aStream nextPut: $(.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3943
    package printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3944
    aStream nextPutAll:' -> '.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3945
    managerTypeName printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3946
    aStream nextPut: $).
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3947
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3948
    "Modified: / 25-11-2011 / 18:35:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3949
! !
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  3950
2445
vrany
parents: 2443
diff changeset
  3951
!AbstractSourceCodeManager::PackageAndManager methodsFor:'queries'!
vrany
parents: 2443
diff changeset
  3952
vrany
parents: 2443
diff changeset
  3953
match: packageId
vrany
parents: 2443
diff changeset
  3954
    | manager |
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3955
2445
vrany
parents: 2443
diff changeset
  3956
    manager := self manager.
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3957
    manager isNil ifTrue:[^false].
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3958
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3959
    ^ (package match: packageId) 
2445
vrany
parents: 2443
diff changeset
  3960
        and: [manager isResponsibleForPackage: packageId]
vrany
parents: 2443
diff changeset
  3961
vrany
parents: 2443
diff changeset
  3962
    "
vrany
parents: 2443
diff changeset
  3963
     self managerForModule:'stx:libbasic' 
vrany
parents: 2443
diff changeset
  3964
     self managerForModule:'stx:libbasic2'
vrany
parents: 2443
diff changeset
  3965
     self managerForModule:'exept:expecco'  
vrany
parents: 2443
diff changeset
  3966
    "
vrany
parents: 2443
diff changeset
  3967
vrany
parents: 2443
diff changeset
  3968
    "Created: / 09-07-2011 / 14:26:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  3969
    "Modified (format): / 18-11-2011 / 14:07:53 / cg"
2445
vrany
parents: 2443
diff changeset
  3970
! !
vrany
parents: 2443
diff changeset
  3971
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  3972
!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
  3973
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3974
version
3631
c9ab267ee5d5 Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3629
diff changeset
  3975
    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.331 2014-10-04 11:29:36 vrany Exp $'
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  3976
!
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  3977
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  3978
version_CVS
3631
c9ab267ee5d5 Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3629
diff changeset
  3979
    ^ '$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.331 2014-10-04 11:29:36 vrany Exp $'
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3980
!
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3981
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  3982
version_SVN
3631
c9ab267ee5d5 Oops, fixes to class fileout to handle non-ASCII code correctly.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3629
diff changeset
  3983
    ^ '$Id: AbstractSourceCodeManager.st,v 1.331 2014-10-04 11:29:36 vrany Exp $'
123
9a1dff152656 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 122
diff changeset
  3984
! !
1202
86cb235976ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1161
diff changeset
  3985
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  3986
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
  3987
AbstractSourceCodeManager initialize!