AbstractSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Wed, 19 Feb 2020 20:11:43 +0100
changeset 4549 a9f1d97402c8
parent 4540 720d5dedacd9
child 4552 51e05f330692
permissions -rw-r--r--
#DOCUMENTATION by cg class: ChangeSet::DiffSet comment/format in: #changed: #changed:onlyInReceiver:onlyInArg:same: #onlyInArg: #onlyInReceiver: #same #same:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
     1
"{ Encoding: utf8 }"
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
     2
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
     5
              All Rights Reserved
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 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
     8
 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
     9
 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
    10
 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
    11
 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
    12
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
919
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
20e138a64538 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
    15
3709
2bbbe39feab4 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3684
diff changeset
    16
"{ NameSpace: Smalltalk }"
2bbbe39feab4 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3684
diff changeset
    17
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
Object subclass:#AbstractSourceCodeManager
4170
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    19
	instanceVariableNames:''
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    20
	classVariableNames:'CacheDirectoryName CachingSources DefaultManager ManagerPerModule
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    21
		PackagesWithoutExtensionMethodConfirmation
4219
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
    22
		SuppressExtensionMethodConfirmation UseWorkTree Verbose
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
    23
		WorkTreeDirectoryName'
4170
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    24
	poolDictionaries:''
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    25
	category:'System-SourceCodeManagement'
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
2445
vrany
parents: 2443
diff changeset
    28
Object subclass:#PackageAndManager
4170
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    29
	instanceVariableNames:'package managerTypeName'
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    30
	classVariableNames:''
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    31
	poolDictionaries:''
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
    32
	privateIn:AbstractSourceCodeManager
2445
vrany
parents: 2443
diff changeset
    33
!
vrany
parents: 2443
diff changeset
    34
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    35
!AbstractSourceCodeManager class methodsFor:'documentation'!
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
copyright
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 COPYRIGHT (c) 1995 by Claus Gittinger
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
    40
              All Rights Reserved
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
 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
    43
 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
    44
 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
    45
 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
    46
 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
    47
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    49
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    50
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    51
documentation
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    52
"
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    53
    Abstract superclass for sourceCodeManagers.
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    54
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    55
    Concrete subclasses provide access to a source repository.
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    56
    Most protocol here traps into subclassResponsbility errors.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    57
    Please read more documentation in concrete subclasses 
2400
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    58
    (especially: CVSSourceCodeManager) for how to use this manager and
68c2bf64fe78 changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 2399
diff changeset
    59
    what to redefine in another repository manager if required.
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    60
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    61
    [author:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
    62
        Claus Gittinger
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    63
"
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
    64
! !
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
    66
!AbstractSourceCodeManager class methodsFor:'initialization'!
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    67
2647
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    68
forgetDisabledModules
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
    69
    "intentionally left blank"
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
    70
2647
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    71
    ^ self
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
    72
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
    73
    "Modified (comment): / 18-05-2018 / 12:37:57 / Stefan Vogel"
2647
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    74
!
69c582668ce8 added: #forgetDisabledModules
Claus Gittinger <cg@exept.de>
parents: 2638
diff changeset
    75
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    76
initCacheDirPath
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
    77
    "initialize the name of the cacheDirectory.
796
c46ebd7ed4a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 795
diff changeset
    78
     This is:
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    79
        <tempDir>/stx_sourceCache (non-UNIX)
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    80
        ~/.smalltalk/source-cache (UNIX, as <tempDir> is pruned upon each reboot)
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    81
    "
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
    82
    "JV@2012-03-14: Changed to use .smalltalk/source-cache on UNIX machines"
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
    83
    "CG: why only on unix machines???"
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
    84
    
4010
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    85
    |dir|
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    86
    
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
    87
    CachingSources isNil ifTrue:[
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
    88
        CachingSources := true.
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
    89
    ].
4010
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    90
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    91
    dir := Filename homeDirectory / '.smalltalk/sourceCache'. 
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    92
    dir isWritableDirectory ifFalse:[
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    93
        dir := Filename defaultTempDirectory / 'stx_sourceCache'.
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    94
    ].  
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    95
    CacheDirectoryName := dir pathName.
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    96
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    97
"/    OperatingSystem isUNIXlike ifTrue:[
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    98
"/        CacheDirectoryName := '~/.smalltalk/sourceCache'.
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
    99
"/    ] ifFalse:[
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
   100
"/        CacheDirectoryName := (Filename defaultTempDirectory constructString:'stx_sourceCache').
2d5dd6fc7885 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4008
diff changeset
   101
"/    ].
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   102
    
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
   103
    "
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
   104
     self initCacheDirPath     
792
901f03b078db fixed tempdir setup for win32
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
   105
    "
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   106
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
   107
    "Modified: / 12-07-1999 / 10:01:31 / cg"
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
   108
    "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
   109
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   110
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   111
initialize
4045
a866feeced85 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
   112
    "setup for caching and no workTree"
a866feeced85 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
   113
a866feeced85 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
   114
    CachingSources isNil ifTrue:[CachingSources := true].
1930
74929dd929d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1910
diff changeset
   115
    UseWorkTree    isNil ifTrue:[UseWorkTree := false].
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   116
    SuppressExtensionMethodConfirmation 
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   117
                   isNil ifTrue:[SuppressExtensionMethodConfirmation := false].
3587
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   118
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   119
    CachingSources ifTrue:[
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   120
        self validateCacheDirPath.
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   121
    ].
3587
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   122
    Smalltalk addDependent:self
2788
99dd9025c611 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2786
diff changeset
   123
99dd9025c611 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2786
diff changeset
   124
    "Modified: / 02-03-2012 / 17:00:11 / cg"
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   125
    "Modified: / 18-05-2018 / 12:40:59 / Stefan Vogel"
3587
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   126
!
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   127
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   128
update:something with:aParameter from:changedObject
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   129
    "flush resources on language changes"
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   130
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   131
    something == #returnFromSnapshot ifTrue:[
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   132
        self validateCacheDirPath
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   133
    ]
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   134
!
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   135
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   136
validateCacheDirPath
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   137
    (CacheDirectoryName isNil 
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   138
    or:[CacheDirectoryName asFilename exists not]) ifTrue:[
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   139
        self initCacheDirPath   
bb752772cf70 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   140
    ].
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   141
! !
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   142
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   143
!AbstractSourceCodeManager class methodsFor:'* uncategorized *'!
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   144
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   145
repositoryTopDirectoryFromSCMRoot
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   146
    "return the top of the repository."
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   147
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   148
    ^ self subclassResponsibility
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   149
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   150
    "Created: / 18-05-2018 / 12:30:23 / Stefan Vogel"
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   151
! !
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   152
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   153
!AbstractSourceCodeManager class methodsFor:'accessing'!
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   154
1729
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   155
availableManagers
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   156
    ^ AbstractSourceCodeManager 
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   157
        allSubclasses 
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   158
            reject:[:cls | (cls isAbstract) or:[cls isExperimental]].
1729
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   159
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   160
    "
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   161
     self availableManagers   
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   162
    "
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   163
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   164
    "Modified (format): / 18-05-2018 / 12:19:48 / Stefan Vogel"
1729
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   165
!
18ea45b4a1be support multiple managers
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
   166
4291
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   167
branchStartTagFor:branchName
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   168
    "this tag is used to tag the original starting point of a branch;
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   169
     i.e. the head version from which the branch was created.
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   170
     Here, we use <branchTagPrefix><branchName>_0"
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   171
     
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   172
    ^ (self branchTagFor:branchName),'_0'
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   173
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   174
    "Created: / 07-12-2017 / 10:23:13 / cg"
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   175
!
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   176
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   177
branchTagFor:branchName
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   178
    "this tag is used to tag the current branch-head of a branch (or the branch as such);
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   179
     i.e. the last version checked onto the branch.
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   180
     Here, we use <branchTagPrefix><branchName>"
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   181
     
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   182
    ^ (self branchTagPrefix),branchName
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   183
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   184
    "Created: / 07-12-2017 / 10:24:03 / cg"
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   185
!
3abd839e1b7c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4288
diff changeset
   186
4275
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   187
branchTagPrefix
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   188
    ^ 'branch_'
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   189
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   190
    "Created: / 05-12-2017 / 19:19:39 / cg"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   191
!
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   192
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   193
cacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   194
    "return the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   195
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   196
     This cache is shared among all ST/X users on a system."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   197
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   198
    self cachingSources ifTrue:[
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   199
        (CacheDirectoryName isNil) ifTrue:[
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   200
            self initCacheDirPath   
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   201
        ].
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   202
    ].
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   203
    ^ CacheDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   204
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   205
    "Modified: 12.9.1996 / 02:20:45 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   206
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   207
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   208
cacheDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   209
    "set the name of the cache directory, where checked out class
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   210
     sources are kept for faster access. The default is '/tmp/stx_sourceCache'.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   211
     This cache is shared among all ST/X users on a system.
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   212
     The directory is typically set via the launcher's setting menu, 
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   213
     or from a startup rc-file."
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   214
2451
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   215
    CacheDirectoryName := aStringOrFilename.
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   216
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   217
    "HACK, HACK, since ManagerPerModule is lazy-initialize before
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   218
     preferences are read, sigh. We need a better system..."
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   219
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   220
    ManagerPerModule := nil.
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   221
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   222
    "Created: / 16-12-1995 / 15:18:43 / cg"
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   223
    "Modified: / 12-09-1996 / 02:21:35 / cg"
3177b6135b27 changed: #cacheDirectoryName:
vrany
parents: 2446
diff changeset
   224
    "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
   225
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   226
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   227
cachingSources
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   228
    "return true, if source caching is enabled.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   229
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   230
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   231
    ^ CachingSources ? false
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   232
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   233
    "Created: 16.12.1995 / 15:17:50 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   234
    "Modified: 12.9.1996 / 02:22:19 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   235
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   236
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   237
cachingSources:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   238
    "enable/disable the caching of source files.
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   239
     (see cacheDirectoryName for what that means)"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   240
4046
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   241
    CachingSources := aBoolean.
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   242
    aBoolean ifTrue:[
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   243
        CacheDirectoryName isNil ifTrue:[
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   244
            self validateCacheDirPath
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   245
        ].    
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   246
    ].    
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   247
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   248
    "
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   249
     AbstractSourceCodeManager cachingSources:true
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   250
    "
1d63073ace00 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4045
diff changeset
   251
    
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   252
    "Created: 16.12.1995 / 15:18:13 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   253
    "Modified: 12.9.1996 / 02:22:42 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   254
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   255
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   256
defaultManager
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   257
    "return the default sourceCodeManager class"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   258
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   259
    ^ DefaultManager
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   260
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   261
    "Created: 7.12.1995 / 17:14:22 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   262
    "Modified: 12.9.1996 / 02:22:56 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   263
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   264
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   265
enabledManagers
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   266
    "Return list of source code managers that are enabled"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   267
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   268
    "If source code management is disabled, return #(). Following code
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   269
     is hack since  there is no global boolean flag, sigh"
3976
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   270
    (Smalltalk at:#SourceCodeManager) isNil ifTrue:[
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   271
        ^ #()
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   272
    ].
fc697438b403 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 3972
diff changeset
   273
    ^ self availableManagers select:[:manager | manager enabled].  
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   274
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   275
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   276
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   277
    "
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   278
     self enabledManagers   
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   279
    "
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   280
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   281
    "Created: / 23-01-2012 / 19:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   282
!
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   283
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   284
managerForMatchingModule:aPackageIDMatchString put:aSourceCodeManagerClass
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   285
    "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
   286
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   287
    ManagerPerModule isNil ifTrue:[
2446
vrany
parents: 2445
diff changeset
   288
        ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   289
    ].
2445
vrany
parents: 2443
diff changeset
   290
    ManagerPerModule do:[:each |
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   291
        |packageMatch|
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   292
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
   293
        packageMatch := each package.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   294
        (packageMatch = aPackageIDMatchString) ifTrue:[
2445
vrany
parents: 2443
diff changeset
   295
            each manager:aSourceCodeManagerClass.
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   296
            ^ self
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   297
        ].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   298
    ].
2445
vrany
parents: 2443
diff changeset
   299
    ManagerPerModule add:
vrany
parents: 2443
diff changeset
   300
        (PackageAndManager 
vrany
parents: 2443
diff changeset
   301
            package: aPackageIDMatchString 
vrany
parents: 2443
diff changeset
   302
            manager: aSourceCodeManagerClass)
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   303
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   304
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   305
     self managerForModule:'stx:libbasic2' put:SVNSourceCodeManager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   306
     self managerForModule:'stx:libbasic2' put:CVSSourceCodeManager
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   307
     self managerForModule:'stx:libbasic2'
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   308
     self managerForModule:'exept:expecco' 
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   309
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   310
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   311
    "Created: / 18-04-2011 / 19:48:19 / cg"
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
   312
    "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
   313
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   314
2557
vrany
parents: 2552
diff changeset
   315
managerForPackage:aPackageID
vrany
parents: 2552
diff changeset
   316
    "return the sourceCodeManager for a aPackageID, nil if unspecified in the manager per package list"
vrany
parents: 2552
diff changeset
   317
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   318
    "JV@2012-01-23: If source code management is disabled, return nil. Following code
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   319
     is hack since  there is no global boolean flag, sigh"
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   320
    (Smalltalk at:#SourceCodeManager) isNil ifTrue:[ ^nil ].
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   321
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   322
    "JV@2012-01-23: HACK: Q: Shouldn't it filter configured manager through
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   323
     'enabled' managers?"         
2446
vrany
parents: 2445
diff changeset
   324
    self managerPerMatchingModuleDefinitions do:[:each |
vrany
parents: 2445
diff changeset
   325
        (each match:aPackageID) ifTrue:[^ each manager].
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   326
    ].
2603
522db5b81315 changed:
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   327
    ^ DefaultManager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   328
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   329
    "
3230
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
   330
     self managerForPackage:'stx:libbasic' 
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
   331
     self managerForPackage:'stx:libbasic2'
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
   332
     self managerForPackage:'exept:expecco'  
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   333
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   334
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   335
    "Created: / 18-04-2011 / 19:39:19 / cg"
2557
vrany
parents: 2552
diff changeset
   336
    "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
   337
    "Modified: / 19-10-2011 / 16:45:38 / cg"
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
   338
    "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
   339
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   340
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   341
managerPerMatchingModuleDefinitions
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   342
    "return the sourceCodeManager definitions"
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   343
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   344
    ManagerPerModule isNil ifTrue:[
2445
vrany
parents: 2443
diff changeset
   345
        ManagerPerModule := UserPreferences current managerPerMatchingModuleDefinitions
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   346
    ].
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   347
    ^ ManagerPerModule
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   348
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   349
    "Created: / 18-04-2011 / 20:09:16 / cg"
2445
vrany
parents: 2443
diff changeset
   350
    "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
   351
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   352
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   353
managerPerMatchingModuleDefinitions:aCollection
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   354
    "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
   355
     associations 
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   356
     (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
   357
2445
vrany
parents: 2443
diff changeset
   358
    ManagerPerModule := aCollection.
vrany
parents: 2443
diff changeset
   359
    UserPreferences current managerPerMatchingModuleDefinitions:aCollection
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   360
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   361
    "Created: / 18-04-2011 / 20:09:21 / cg"
2445
vrany
parents: 2443
diff changeset
   362
    "Modified: / 09-07-2011 / 13:36:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
   363
!
vrany
parents: 2443
diff changeset
   364
vrany
parents: 2443
diff changeset
   365
named: managerTypeName
vrany
parents: 2443
diff changeset
   366
vrany
parents: 2443
diff changeset
   367
    ^self availableManagers 
vrany
parents: 2443
diff changeset
   368
        detect:[:each|each managerTypeName = managerTypeName]
vrany
parents: 2443
diff changeset
   369
        ifNone:[nil]
vrany
parents: 2443
diff changeset
   370
vrany
parents: 2443
diff changeset
   371
    "
vrany
parents: 2443
diff changeset
   372
        AbstractSourceCodeManager named: 'CVS'
vrany
parents: 2443
diff changeset
   373
        AbstractSourceCodeManager named: 'Perforce'        
vrany
parents: 2443
diff changeset
   374
    "
vrany
parents: 2443
diff changeset
   375
vrany
parents: 2443
diff changeset
   376
    "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
   377
!
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
   378
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   379
repositoryInfoPerModule
2145
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   380
    "return the dictionary, which associates CVSRoots to module names.
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   381
     If no entry is contained in this dictionary for some module,
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   382
     the default cvsRoot (CVSRoot) will be used."
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   383
a271ebaa4ff2 changed: #repositoryInfoPerModule
fm
parents: 2140
diff changeset
   384
    ^ #()
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   385
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   386
    "Created: / 09-11-2006 / 15:25:17 / cg"
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   387
!
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
   388
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   389
repositoryInfoPerModule:info
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   390
    "/ ignore here
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   391
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
   392
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   393
repositoryName
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   394
    "return the name of the repository.
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   395
     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
   396
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   397
    ^ nil
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   398
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   399
    "Modified: 12.9.1996 / 02:20:45 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   400
    "Created: 14.9.1996 / 13:21:37 / cg"
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   401
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   402
2592
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   403
repositoryNameForPackage:packageId 
4275
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   404
    "Return the repository URL for the given package. 
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
   405
     Used for testing/debugging source code management configuration"
2592
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   406
    
7f81994e54d3 added: #repositoryNameForPackage:
vrany
parents: 2565
diff changeset
   407
    ^ self subclassResponsibility
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   408
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   409
    "Created: / 10-10-2011 / 19:44:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4275
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
   410
    "Modified (comment): / 05-12-2017 / 17:41:57 / cg"
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   411
!
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
   412
2700
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   413
shownInBrowserMenus
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   414
    "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
   415
2728
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   416
    ^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') ifAbsent:false.
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   417
2700
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   418
    "Created: / 08-01-2012 / 19:56:22 / cg"
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   419
!
1a1e22dc93eb added: #shownInBrowserMenus
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
   420
2728
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   421
shownInBrowserMenus:aBoolean
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   422
    "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
   423
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   424
    ^ UserPreferences current at:(self nameWithoutPrefix,'.enabled') put:aBoolean.
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   425
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   426
    "Created: / 15-01-2012 / 14:09:21 / cg"
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   427
!
362068fc2707 added: #shownInBrowserMenus:
Claus Gittinger <cg@exept.de>
parents: 2725
diff changeset
   428
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   429
useWorkTree
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   430
    "return the setting of useWorkTree, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   431
     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
   432
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   433
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   434
    ^ UseWorkTree
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   435
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   436
    "Created: 16.12.1995 / 15:36:48 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   437
    "Modified: 12.9.1996 / 02:24:01 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   438
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   439
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   440
useWorkTree:aBoolean
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   441
    "enable/disable the useWorkTree feature, which (eventually)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   442
     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
   443
     kept in sync. This is not yet implemented."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   444
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   445
    UseWorkTree := aBoolean
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   446
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   447
    "Created: 16.12.1995 / 15:37:29 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   448
    "Modified: 12.9.1996 / 02:24:38 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   449
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   450
2557
vrany
parents: 2552
diff changeset
   451
utilities
2936
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   452
    "Returns a 'utilities' object that can be used by tools. 
2557
vrany
parents: 2552
diff changeset
   453
vrany
parents: 2552
diff changeset
   454
     By default, it returns an instance of
vrany
parents: 2552
diff changeset
   455
     SourceCodeManagerUtilities with receiver as its
vrany
parents: 2552
diff changeset
   456
     manager, but individual managers may override this
vrany
parents: 2552
diff changeset
   457
     method and supply its own, customized utilities."
vrany
parents: 2552
diff changeset
   458
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   459
    ^ (self isContainerBased
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   460
            ifTrue: [ SourceCodeManagerUtilitiesForContainerBasedManagers ]
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   461
            ifFalse: [ SourceCodeManagerUtilitiesForWorkspaceBasedManagers ]
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
   462
      ) forManager: self
2557
vrany
parents: 2552
diff changeset
   463
2936
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   464
    "
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   465
     SourceCodeManager defaultManager
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   466
     SourceCodeManager defaultManager utilities
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   467
    "
f45a9345a85f comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
   468
2557
vrany
parents: 2552
diff changeset
   469
    "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
   470
    "Modified (format): / 25-07-2012 / 17:08:05 / cg"
2557
vrany
parents: 2552
diff changeset
   471
!
vrany
parents: 2552
diff changeset
   472
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   473
workTreeDirectoryName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   474
    "return the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   475
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   476
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   477
    ^ WorkTreeDirectoryName
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   478
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   479
    "Created: 16.12.1995 / 15:35:21 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   480
    "Modified: 12.9.1996 / 02:25:13 / cg"
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   481
!
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   482
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   483
workTreeDirectoryName:aStringOrFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   484
    "set the name of the workTree, which is kept in sync
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   485
     with the current class versions. This is not yet implemented"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   486
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   487
    WorkTreeDirectoryName := aStringOrFilename
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   488
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
   489
    "Created: 16.12.1995 / 15:35:34 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
   490
    "Modified: 12.9.1996 / 02:25:19 / cg"
112
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   491
! !
e035bf8c3e00 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 110
diff changeset
   492
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   493
!AbstractSourceCodeManager class methodsFor:'basic access'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   494
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   495
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
   496
    "checkin of a class into the source repository.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   497
     Return true if ok, false if not."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   498
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   499
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   500
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   501
    "Created: 14.2.1997 / 21:17:33 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   502
    "Modified: 14.2.1997 / 21:18:48 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   503
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   504
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   505
checkoutModule:aModule directory:aPackage andDo:aBlock
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   506
    "check out everything from a package into a temporary directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   507
     Then evaluate aBlock, passing the name of that temp-directory.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   508
     Afterwards, the tempDir is removed.
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   509
     Return true, if OK, false if any error occurred."
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   510
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   511
    ^ self subclassResponsibility
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   512
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   513
    "Created: / 23-08-2006 / 14:07:08 / cg"
759
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   514
!
2d7e72bae18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 752
diff changeset
   515
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   516
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
   517
    "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
   518
     A revision of nil selects the current (in image) revision.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   519
     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
   520
     which itself is extracted from the classes packageString."
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   521
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   522
    ^ self subclassResponsibility
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
    "Modified: 14.2.1997 / 21:18:35 / cg"
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   525
!
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   526
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   527
streamForExtensionFile:fileName package:package directory:dir module:mod cache:doCache
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   528
    |defClass extensionsRevisionString extensionsRevisionInfo rev|
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   529
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   530
    defClass := ProjectDefinition definitionClassForPackage:package.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   531
    extensionsRevisionString := defClass perform:(self nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   532
    extensionsRevisionString isNil ifTrue:[
3385
b4a3a5381e7c class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3371
diff changeset
   533
        Transcript showCR:'SourceCodeManager [warning]: no valid version info for extensions of "',package,'"'.
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   534
        ^ self streamForClass:nil fileName:fileName revision:nil directory:dir module:mod cache:false.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   535
    ].
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   536
2399
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   537
    extensionsRevisionInfo := self revisionInfoFromString:extensionsRevisionString inClass:nil.
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   538
    extensionsRevisionInfo isNil ifTrue:[
3961
c9665348384b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
   539
        self halt:('oops - possibly corrupted extensions version string: "%1" in class %2' bindWith:extensionsRevisionString with:defClass name).
2399
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   540
        "/ 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
   541
        ^ 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
   542
    ].
2202
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   543
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   544
    self assert:(fileName = 'extensions.st').
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   545
    self assert:(fileName = extensionsRevisionInfo fileName).
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   546
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   547
    rev := extensionsRevisionInfo revision.
Claus Gittinger <cg@exept.de>
parents: 2199
diff changeset
   548
    ^ 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
   549
2b84464f1d41 changed: #streamForExtensionFile:package:directory:module:cache:
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   550
    "Modified: / 01-07-2011 / 13:52:38 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   551
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   552
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   553
!AbstractSourceCodeManager class methodsFor:'basic administration'!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   554
4219
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   555
checkForExistingContainer:fileName inModule:moduleName directory:packageDirName
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   556
    "check for a container to be present. Return a boolean result."
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   557
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   558
    ^ self subclassResponsibility.
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   559
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   560
    "Created: / 13-09-2006 / 18:22:24 / cg"
4219
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   561
    "Modified (format): / 24-02-2017 / 11:32:46 / cg"
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   562
!
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   563
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   564
checkForExistingContainer:fileName inModule:moduleName directory:packageDirName warn:doWarn
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   565
    "check for a container to be present. Return a boolean result."
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   566
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   567
    |ok|
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   568
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   569
    ok := self checkForExistingContainer:fileName inModule:moduleName directory:packageDirName.
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   570
    ok ifFalse:[
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   571
        self warn:(
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   572
'Could not find/access the container for %1:%2/%3 in the %4 repository.
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   573
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   574
This could be due to:
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   575
    - invalid/wrong configuration/settings
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   576
    - missing access rights (no access / not logged in)
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   577
    - changed the SCM after compilation (i.e. wrong SCM-path in version method)    
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   578
'           
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   579
            bindWith:(moduleName ? '?')
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   580
            with:(packageDirName ? '?')
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   581
            with:(fileName ? '?')
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   582
            with:(self managerTypeName)).
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   583
                ^ false
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   584
    ].    
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   585
    ^ ok
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   586
8f320e22b809 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4210
diff changeset
   587
    "Created: / 24-02-2017 / 11:38:00 / cg"
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   588
!
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   589
1785
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   590
checkForExistingContainer:fileName inPackage:aPackage
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   591
    "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
   592
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   593
    |packageDir moduleDir|
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   594
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   595
    packageDir := aPackage asPackageId directory.
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   596
    moduleDir := aPackage asPackageId module. 
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   597
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   598
    ^ self 
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   599
        checkForExistingContainer:fileName
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   600
        inModule:moduleDir 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   601
        directory:packageDir
1785
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   602
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   603
    "Created: / 13-09-2006 / 18:10:30 / cg"
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   604
!
cb115713a075 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   605
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   606
checkForExistingContainerForClass:aClass
1013
c455100cbaa8 comments added
Claus Gittinger <cg@exept.de>
parents: 1011
diff changeset
   607
    "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
   608
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   609
    |sourceInfo packageDir moduleDir classFileName|
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   610
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   611
    sourceInfo := self sourceInfoOfClass:aClass.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   612
    sourceInfo isNil ifTrue:[
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   613
        ('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
   614
        ^ false
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   615
    ].
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   616
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   617
    packageDir := self directoryFromSourceInfo:sourceInfo.
674
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   618
    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
   619
    classFileName := self containerFromSourceInfo:sourceInfo.
5d660e2bae10 added query for existing container (by class)
Claus Gittinger <cg@exept.de>
parents: 636
diff changeset
   620
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   621
    ^ self 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   622
        checkForExistingContainer:classFileName 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   623
        inModule:moduleDir 
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   624
        directory:packageDir
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   625
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   626
    "Created: / 13-05-1998 / 22:35:50 / cg"
1786
cca3f201ab0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
   627
    "Modified: / 13-09-2006 / 18:23:20 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   628
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   629
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   630
checkForExistingModule:moduleName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   631
    "check for a module directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   632
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   633
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   634
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   635
    "Created: 9.12.1995 / 19:02:23 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   636
    "Modified: 14.2.1997 / 21:19:01 / cg"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   637
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   638
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   639
checkForExistingModule:moduleDir directory:packageDir
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   640
    "check for a package directory to be present"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   641
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   642
    ^ self subclassResponsibility.
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   643
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   644
    "Created: / 23-08-2006 / 14:03:06 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   645
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   646
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   647
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   648
    "create a new container & check into it an initial version of aClass"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   649
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   650
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   651
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   652
    "Created: 9.12.1995 / 19:02:47 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   653
    "Modified: 14.2.1997 / 21:19:11 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   654
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   655
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   656
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
   657
    "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
   658
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   659
    ^ 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
   660
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   661
    "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
   662
!
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
   663
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   664
createModule:moduleName
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   665
    "create a new module directory"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   666
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   667
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   668
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   669
    "Created: 9.12.1995 / 19:02:23 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   670
    "Modified: 14.2.1997 / 21:19:16 / cg"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   671
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   672
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   673
createModule:module directory:directory
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   674
    "create a new package directory"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   675
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   676
    ^ self subclassResponsibility.
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   677
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   678
    "Created: / 23-08-2006 / 14:04:41 / cg"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   679
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   680
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   681
initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   682
    "return a string usable as initial revision string"
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   683
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   684
    ^ self subclassResponsibility
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   685
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   686
    "Created: / 23-08-2006 / 14:05:42 / cg"
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   687
!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   688
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   689
revisionLogOf:clsOrNil 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   690
    fromRevision:firstRev toRevision:lastRef 
4427
e90a39860df5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   691
    fileName:classFileName directory:packageDirOrNil module:moduleDir 
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   692
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   693
    ^ self 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   694
        revisionLogOf:clsOrNil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   695
        fromRevision:firstRev
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   696
        toRevision:lastRef
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   697
        numberOfRevisions:nil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   698
        fileName:classFileName
4427
e90a39860df5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   699
        directory:packageDirOrNil
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   700
        module:moduleDir
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   701
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
   702
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   703
revisionLogOf:clsOrNil 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   704
    fromRevision:rev1OrNil toRevision:rev2OrNil numberOfRevisions:limitOrNil 
4453
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
   705
    fileName:classFileName directory:packageDirOrNil module:moduleDirOrNil 
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   706
3484
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   707
    "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
   708
     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
   709
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   710
     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
   711
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   712
     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
   713
     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
   714
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   715
     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
   716
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
   717
            #container          -> the container file name (for container-based SCMs)
3484
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   718
            #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
   719
            #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
   720
            #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
   721
            #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
   722
            #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
   723
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   724
            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
   725
             -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
   726
              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
   727
             -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
   728
              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
   729
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   730
             -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
   731
             -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
   732
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   733
            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
   734
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   735
              #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
   736
              #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
   737
              #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
   738
              #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
   739
              #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
   740
              #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
   741
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   742
            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
   743
            (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
   744
            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
   745
        "
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   746
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   747
    self subclassResponsibility
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
   748
3484
6452f6a97b27 Comment in AbstractSourceCodeManager>>#revisionLogOf:fromRevision:toRevision:numberOfRevisions:fileName:directory:module:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3453
diff changeset
   749
    "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
   750
    "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
   751
    "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
   752
! !
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   753
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   754
!AbstractSourceCodeManager class methodsFor:'cache administration'!
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   755
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   756
condenseSourceCache
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   757
    "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
   758
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   759
    |extractBaseAndVersion versionIsGreater vsnNumberString baseName|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   760
4104
25ce5781e7b9 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4076
diff changeset
   761
    (CacheDirectoryName isNil or:[CacheDirectoryName asFilename isDirectory not]) ifTrue:[
3709
2bbbe39feab4 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3684
diff changeset
   762
        ^ self
2bbbe39feab4 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3684
diff changeset
   763
    ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   764
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   765
    extractBaseAndVersion := 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   766
        [:filenameString |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   767
            |i|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   768
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   769
            i := filenameString size.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   770
            [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
   771
            vsnNumberString := filenameString copyFrom:i + 1.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   772
            (filenameString at:i) == $_ ifTrue:[i := i - 1].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   773
            baseName := filenameString copyTo:i.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   774
        ].        
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   775
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   776
    versionIsGreater :=
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   777
        [:vA :vB |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   778
            |seqA seqB sequenceIsGreater|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   779
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   780
            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
   781
            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
   782
            sequenceIsGreater :=
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   783
                [:seqA :seqB :index |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   784
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   785
                    |elA elB|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   786
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   787
                    elA := seqA at:index.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   788
                    elB := seqB at:index.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   789
                    elA > elB ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   790
                        true
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   791
                    ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   792
                        elA < elB ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   793
                            false
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   794
                        ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   795
                            sequenceIsGreater value:seqA value:seqB value:index+1.
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   796
                        ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   797
                    ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   798
                ].
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   799
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   800
            sequenceIsGreater value:seqA value:seqB value:1.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   801
        ].    
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   802
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   803
    CacheDirectoryName asFilename withAllDirectoriesDo:[:d |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   804
        |allFiles newestVersions|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   805
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   806
        newestVersions := Dictionary new.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   807
        allFiles := d files.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   808
        allFiles do:[:eachFilename |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   809
            |prevVsnString|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   810
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   811
            extractBaseAndVersion value:eachFilename baseName.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   812
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   813
            vsnNumberString notEmpty ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   814
                prevVsnString := newestVersions at:baseName ifAbsent:nil.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   815
                prevVsnString isNil ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   816
                    newestVersions at:baseName put:vsnNumberString.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   817
                ] ifFalse:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   818
                    (versionIsGreater value:vsnNumberString value:prevVsnString) ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   819
                        newestVersions at:baseName put:vsnNumberString
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   820
                    ]
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   821
                ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   822
            ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   823
        ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   824
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   825
        allFiles do:[:eachFilename |
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   826
            extractBaseAndVersion value:eachFilename baseName.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   827
            (vsnNumberString isEmpty 
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   828
            or:[(vsnNumberString ~= (newestVersions at:baseName))]) ifTrue:[
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   829
                eachFilename remove
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   830
            ]
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   831
        ].
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   832
    ]
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   833
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   834
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   835
     self condenseSourceCache
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   836
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   837
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   838
    "Modified: / 29-08-2006 / 11:25:25 / cg"
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   839
!
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   840
966
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   841
flushSourceCache
c77378be6456 comments
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
   842
    "remove all cached versions"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   843
961
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   844
    |d|
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   845
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   846
    CacheDirectoryName notNil ifTrue:[
1a99e0289a95 added flush & condense sourceCache
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   847
        d := CacheDirectoryName asFilename.
1860
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   848
        d isDirectory ifTrue:[
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   849
            d directoryContentsAsFilenames do:[:eachFile |
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   850
                eachFile recursiveRemove
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   851
            ]
c092daa2828f #flushSourceCache tolerates non-existing source cache directory
Stefan Vogel <sv@exept.de>
parents: 1857
diff changeset
   852
        ].
2550
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   853
    ].
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   854
    Method flushSourceStreamCache.
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   855
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   856
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   857
     self flushSourceCache
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   858
    "
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
   859
2550
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
   860
    "Modified: / 30-09-2011 / 13:33:33 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   861
! !
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
   862
2866
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   863
!AbstractSourceCodeManager class methodsFor:'debugging'!
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   864
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   865
verboseSourceCodeAccess
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   866
    ^ Verbose ? false
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   867
!
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   868
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   869
verboseSourceCodeAccess:aBoolean
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   870
    Verbose := aBoolean
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   871
! !
eed4bd7d5db4 class definition
Claus Gittinger <cg@exept.de>
parents: 2851
diff changeset
   872
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   873
!AbstractSourceCodeManager class methodsFor:'obsolete backward compatibility'!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   874
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   875
checkForExistingModule:moduleDir package:packageDir
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   876
    "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
   877
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   878
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   879
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   880
    ^ self checkForExistingModule:moduleDir directory:packageDir.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   881
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   882
    "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
   883
    "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
   884
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   885
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   886
checkoutModule:aModule package:aPackage andDo:aBlock
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   887
    "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
   888
     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
   889
     Afterwards, the tempDir is removed.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   890
     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
   891
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   892
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   893
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   894
    ^ self checkoutModule:aModule directory:aPackage andDo:aBlock
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   895
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   896
    "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
   897
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   898
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   899
createModule:module package:package
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   900
    "create a new package directory"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   901
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   902
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   903
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   904
    ^ self createModule:module directory:package.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   905
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   906
    "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
   907
    "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
   908
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   909
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   910
getExistingContainersInModule:aModule package:aPackage
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   911
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   912
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   913
    "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
   914
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   915
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   916
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   917
    ^ self getExistingContainersInModule:aModule directory:aPackage
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   918
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   919
    "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
   920
    "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
   921
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   922
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   923
getExistingPackagesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   924
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   925
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   926
    "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
   927
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   928
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   929
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   930
    ^ self getExistingDirectoriesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   931
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   932
    "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
   933
    "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
   934
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   935
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   936
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
   937
    "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
   938
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
   939
    <resource: #obsolete>
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
   940
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   941
    self obsoleteMethodWarning.
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   942
    ^ 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
   943
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   944
    "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
   945
    "Modified: / 23-08-2006 / 14:06:18 / cg"
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
   946
    "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
   947
! !
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
   948
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
   949
!AbstractSourceCodeManager class methodsFor:'private'!
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
   950
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   951
checkMethodPackagesOf:aClass
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   952
    "check if aClass contains methods from another package;
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   953
     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
   954
     Raises abortSignal if checkIn is to be suppressed.
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   955
     returns:
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
   956
        #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
   957
        #all    - check in all
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   958
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   959
     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
   960
     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
   961
     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
   962
     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
   963
    "
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   964
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   965
    |clsPackage otherPackages methodsFromOtherPackages
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
   966
     methodCategoriesInOtherPackages msg answer labels actions hasUnassignedExtensions
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   967
     unassignedMethods methodCategoriesWithUnassignedMethods methodCategoryWithUnassignedMethods 
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
   968
     args anyPackageChange|
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   969
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
   970
    clsPackage := aClass package.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   971
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   972
    otherPackages := Set new.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   973
    methodsFromOtherPackages := OrderedCollection new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   974
    hasUnassignedExtensions := false.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   975
    unassignedMethods := OrderedCollection new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   976
    methodCategoriesWithUnassignedMethods := Set new.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   977
    methodCategoriesInOtherPackages := Set new.
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
   978
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   979
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   980
        |mthdPackage|
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   981
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   982
        (mthdPackage := mthd package) ~= clsPackage ifTrue:[
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
   983
            mthdPackage = PackageId noProjectID ifTrue:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   984
                hasUnassignedExtensions := true.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   985
                unassignedMethods add:mthd.        
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   986
                methodCategoriesWithUnassignedMethods add:(mthd category).
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   987
            ] ifFalse:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   988
                methodsFromOtherPackages add:mthd.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   989
                otherPackages add:mthdPackage.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   990
                methodCategoriesInOtherPackages add:(mthd category).
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   991
            ].
815
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   992
        ]
272eb8358169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 814
diff changeset
   993
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   994
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
   995
    hasUnassignedExtensions ifFalse:[
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   996
        aClass allPrivateClassesDo:[:eachPrivateClass |
1028
e839e2bcf1d7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
   997
            aClass setPackage:clsPackage.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
   998
            eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
   999
                mthd setPackage:clsPackage
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1000
            ]
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1001
        ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1002
        ^ #base
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1003
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1004
1029
2bb7575ddf46 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
  1005
    otherPackages := otherPackages asOrderedCollection sort.
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1006
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1007
    methodCategoriesWithUnassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1008
        methodCategoryWithUnassignedMethods := methodCategoriesWithUnassignedMethods anElement.
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1009
    ].
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
  1010
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1011
    (SourceCodeManagerUtilities yesToAllNotification notNil 
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1012
    and:[SourceCodeManagerUtilities yesToAllNotification isHandled]) ifTrue:[
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1013
        answer := true.
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1014
    ] ifFalse:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1015
        methodCategoriesWithUnassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1016
            unassignedMethods size == 1 ifTrue:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
  1017
                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
  1018
            ] ifFalse:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
  1019
                msg := 'The class ''%1'' contains %3 unassigned (loose) method(s)'.
2468
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
  1020
            ].
e915dd0899af duplicate code elimination
Claus Gittinger <cg@exept.de>
parents: 2451
diff changeset
  1021
            msg := msg , '\(In the ''%4'' category).'.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1022
        ] ifFalse:[
1520
e5caaecf7681 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1518
diff changeset
  1023
            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
  1024
        ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1025
        unassignedMethods size == 1 ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1026
            msg := msg , '\\Move this method to the ''%2'' package ?'.
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
  1027
            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
  1028
        ] ifFalse:[
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1029
            msg := msg , '\\Move those to the ''%2'' package ?'.
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
  1030
            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
  1031
        ].
1550
7cb65943ecab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1534
diff changeset
  1032
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1033
        args := Array
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1034
                    with:aClass name allBold
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1035
                    with:clsPackage allBold
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1036
                    with:unassignedMethods size
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1037
                    with:methodCategoryWithUnassignedMethods
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1038
                    with:methodCategoriesWithUnassignedMethods size
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1039
                    with:unassignedMethods first selector allBold.
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1040
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  1041
        SourceCodeManagerUtilities yesToAllNotification isHandled       
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  1042
        ifTrue:[
3684
7f6dc6208ae7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3673
diff changeset
  1043
            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
  1044
            actions := #(#cancel false #browse #yesToAll true).
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  1045
        ] ifFalse:[
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1046
            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
  1047
            actions := #(#cancel false #browse true).
1036
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  1048
        ].
2f49ddc6c98e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1032
diff changeset
  1049
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1050
        (SuppressExtensionMethodConfirmation 
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1051
         or:[ self isPackageWithoutExtensionMethodConfirmation:aClass package])
4119
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1052
        ifTrue:[
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1053
            answer := true
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1054
        ] ifFalse:[    
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1055
            Dialog
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1056
                withOptoutOption:[ self rememberPackageWithoutExtensionMethodConfirmation:aClass package ]
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1057
                labelled:(SystemBrowser classResources string:'Do not show this dialog again (for this package)')
4133
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1058
                andOptoutOption:[ SuppressExtensionMethodConfirmation := true ]
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1059
                labelled:(SystemBrowser classResources string:'Do not show this dialog again (for any package)')
4119
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1060
                do:[
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1061
                    answer := OptionBox 
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1062
                                  request:(SystemBrowser classResources
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1063
                                            stringWithCRs:msg
4345
6b6b7085590f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4331
diff changeset
  1064
                                            withArguments:args) 
4119
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1065
                                  label:'Change packageID ?'
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1066
                                  image:(InfoBox iconBitmap)
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1067
                                  buttonLabels:(Dialog resources array:labels)
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1068
                                  values:actions
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1069
                                  default:true.
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1070
                ].
1ebe4f5117a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4104
diff changeset
  1071
        ].            
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1072
        answer == #browse ifTrue:[
4254
59caf7ffb322 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4235
diff changeset
  1073
            SystemBrowser default
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1074
                browseMethods:unassignedMethods
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1075
                title:('Unassigned (loose) Methods in %1' bindWith:aClass name)
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1076
                sort:true.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1077
            answer := #cancel.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1078
        ].
2240
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1079
"/        answer == #browseExtensions ifTrue:[
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1080
"/            UserPreferences current systemBrowserClass
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1081
"/                browseMethods:methodsFromOtherPackages
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1082
"/                title:('Extensions for %1' bindWith:aClass name)
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1083
"/                sort:true.
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1084
"/            answer := #cancel.
a9c2f87fbd98 changed: #checkMethodPackagesOf:
Claus Gittinger <cg@exept.de>
parents: 2238
diff changeset
  1085
"/        ].
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1086
    ].
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1087
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1088
    answer == #cancel ifTrue:[
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1089
        AbortSignal raise
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1090
    ].
1016
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1091
    answer == #yesToAll ifTrue:[
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1092
        SourceCodeManagerUtilities yesToAllNotification raiseWith:true.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1093
        answer := true.
ab35c6af1614 yes-to-all option
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1094
    ].
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
  1095
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1096
    "/ ok, move them over
851
fcf26a083242 better confirm, when asking for other package methods
Claus Gittinger <cg@exept.de>
parents: 844
diff changeset
  1097
    answer == true ifTrue:[
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1098
        "/ change all method's packageID to the classes packageId
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1099
        anyPackageChange := false.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1100
        aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2208
a66ff7ef9153 Project noProjectID -> PackageId noProjectID
Claus Gittinger <cg@exept.de>
parents: 2202
diff changeset
  1101
            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
  1102
                mthd makeLocalStringSource.
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1103
                mthd setPackage:clsPackage.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1104
                anyPackageChange := true.
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1105
            ]
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 816
diff changeset
  1106
        ].
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1107
        aClass allPrivateClassesDo:[:eachPrivateClass |
1028
e839e2bcf1d7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1027
diff changeset
  1108
            aClass setPackage:clsPackage.
1077
6b1bcfd27521 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 1075
diff changeset
  1109
            eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1110
                mthd package ~= clsPackage ifTrue:[
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1111
                    mthd makeLocalStringSource.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1112
                    mthd setPackage:clsPackage.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1113
                    anyPackageChange := true.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1114
                ]
1027
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1115
            ]
6c93b510b86d update private class packages
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
  1116
        ].
2975
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1117
        anyPackageChange ifTrue:[
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1118
            aClass changed:#projectOrganization.
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1119
            Smalltalk changed:#projectOrganization with:(Array with:aClass). 
90f3c278d6d8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2937
diff changeset
  1120
        ].
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1121
    ].
1518
c6b1f8da85f2 no longer move other extensions into my project when
Claus Gittinger <cg@exept.de>
parents: 1499
diff changeset
  1122
    ^ #base
1112
c395948357d3 care for userPref-browser-setting (in browse-action)
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1123
4254
59caf7ffb322 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4235
diff changeset
  1124
    "Modified: / 01-09-2017 / 14:19:53 / cg"
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1125
    "Modified: / 18-05-2018 / 12:46:11 / Stefan Vogel"
4345
6b6b7085590f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4331
diff changeset
  1126
    "Modified: / 09-08-2018 / 14:57:08 / Claus Gittinger"
813
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1127
!
a7daf8306001 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 796
diff changeset
  1128
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1129
checkTabSpaceConventionIn: aStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1130
    "This method checks whether data in given stream follows 
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1131
     tab-space discipline.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1132
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1133
     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
  1134
     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
  1135
     character.
3510
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1136
     This is done for two reasons:
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1137
      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
  1138
        otherwise, make fails badly.
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1139
b3f273c8ce01 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  1140
      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
  1141
        edititing with different editors with different tab conventions.
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1142
     "
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1143
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1144
    | checkStream |
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1145
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1146
    aStream isFileStream ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1147
        aStream flush.
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1148
        checkStream := aStream pathName asFilename readStream.
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1149
    ] ifFalse:[
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1150
        aStream isExternalStream ifFalse:[
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1151
            checkStream := aStream contents asString readStream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1152
        ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1153
    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1154
    [
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1155
        [ checkStream atEnd ] whileFalse:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1156
            | line done nspaces |
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1157
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1158
            nspaces := 0.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1159
            line := checkStream nextLine readStream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1160
            done := line atEnd.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1161
            [ done ] whileFalse:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1162
                | c |
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1163
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1164
                c := line next.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1165
                c == Character space ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1166
                    nspaces := nspaces + 1.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1167
                    nspaces == 8 ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1168
"/                        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
  1169
"/ 
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1170
                        "/ 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
  1171
                        "/ (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
  1172
                        "/ Otherwise, we merging will forever be pain in the...
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1173
                        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
  1174
                    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1175
                ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1176
                c == Character tab  ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1177
                    nspaces ~~ 0 ifTrue:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1178
"/                        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
  1179
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1180
                        "/ 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
  1181
                        "/ (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
  1182
                        "/ Otherwise, we merging will forever be pain in the...
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1183
                        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
  1184
                    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1185
                ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1186
                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
  1187
            ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1188
        ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1189
    ] ensure:[
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1190
        checkStream close.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1191
    ].
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1192
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1193
    "
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1194
    Good:
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1195
      AbstractSourceCodeManager checkTabSpaceConventionIn: #[9 32 32 32 32 97 ] readStream
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1196
      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
  1197
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1198
    Bad:
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1199
      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
  1200
      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
  1201
      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
  1202
      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
  1203
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1204
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1205
    "
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1206
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1207
    "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
  1208
    "Modified (format): / 29-11-2013 / 14:02:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1209
    "Modified: / 18-05-2018 / 12:23:12 / Stefan Vogel"
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1210
!
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  1211
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1212
compileVersionMethod:methodName of:aClass for:newRevisionString
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1213
4347
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1214
    |cls language mthd code|
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1215
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1216
    cls := aClass theMetaclass.
4347
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1217
    language := cls programmingLanguage.
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1218
    "/ self assert: language isSmalltalk.
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1219
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1220
    code := language methodSourceForVersionMethodCVS:newRevisionString.
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1221
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1222
    mthd := language compilerClass 
2227
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1223
                compile:code  
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1224
                forClass:cls
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1225
                inCategory:#documentation
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1226
                notifying:nil
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1227
                install:true
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1228
                skipIfSame:false
355f0bf86adc changed: #compileVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2226
diff changeset
  1229
                silent:true.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1230
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1231
    mthd notNil ifTrue:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1232
        mthd setPackage:aClass package
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1233
    ]
4347
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1234
175456d3ba24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4345
diff changeset
  1235
    "Modified: / 28-08-2018 / 11:56:45 / Claus Gittinger"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1236
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1237
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1238
containerFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1239
    "given a sourceInfo, return the classes container"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1240
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1241
    (info includesKey:#fileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1242
        ^ info at:#fileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1243
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1244
    (info includesKey:#expectedFileName) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1245
        ^ info at:#expectedFileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1246
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1247
    ^ (info at:#classFileNameBase) , '.st'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1248
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1249
    "Modified: 12.9.1996 / 02:31:52 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1250
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1251
3268
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1252
createTempDirectory:packageDir forModule:moduleDir in:aParentDir
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1253
    "create a temp directory for checking out"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1254
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1255
    |tempdir dir|
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1256
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1257
    "/ if CVSTempDir isNil, use current.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1258
    OsError handle:[:ex |
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1259
        self reportError:('cannot create temporary directory').
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1260
        ^ nil.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1261
    ] do:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1262
        tempdir := Filename newTemporaryDirectoryIn:aParentDir.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1263
    ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1264
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1265
    moduleDir notNil ifTrue:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1266
        dir := tempdir construct:moduleDir.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1267
        dir makeDirectory.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1268
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1269
        packageDir notNil ifTrue:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1270
            dir := dir construct:packageDir.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1271
            dir recursiveMakeDirectory.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1272
        ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1273
        dir exists ifFalse:[
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1274
            (tempdir construct:moduleDir) recursiveRemove.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1275
            tempdir recursiveRemove.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1276
            self reportError:('cannot create temporary directory').
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1277
            ^ nil.
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1278
        ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1279
    ].
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1280
    ^ tempdir
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1281
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1282
    "self createTempDirectory:'fooPackage' forModule:'fooModule'"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1283
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1284
    "Created: / 09-12-1995 / 19:14:35 / cg"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1285
    "Modified: / 19-12-1995 / 16:13:02 / stefan"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1286
    "Modified: / 29-08-2006 / 13:16:23 / cg"
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1287
!
3faec81ce8ac refactored common code
Claus Gittinger <cg@exept.de>
parents: 3249
diff changeset
  1288
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1289
directoryFromContainerPath:containerPath forClass:aClass
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1290
    "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
  1291
     extract the directory (i.e. package)."
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1292
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1293
    ^ self directoryFromContainerPath:containerPath forPackage:(aClass package)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1294
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1295
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1296
     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
  1297
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1298
!
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1299
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1300
directoryFromContainerPath:containerPath forPackage:packageID
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1301
    "given a full path as in an RCS header, 
4076
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1302
     extract the directory (i.e. package) within the module.
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1303
     Notice: 
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1304
        for top-level folder-only modules (like exept, smalltalk), 
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1305
        an empty string is returned."
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1306
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1307
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1308
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1309
    path := self pathInRepositoryFrom:containerPath forPackage:packageID.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1310
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1311
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1312
    "/ these are always UNIX filenames ...
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1313
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1314
    idx ~~ 0 ifTrue:[
4076
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1315
        "/ be careful: for top-level module descriptions (folders),
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1316
        "/ the directory is empty
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1317
        (path indexOf:$/ startingAt:idx+1) == 0 ifTrue:[
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1318
            "/ there is no directory
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1319
            ^ ''
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1320
        ].
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1321
        path := path copyFrom:(idx + 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1322
    ].
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1323
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1324
    "/ the code below used to be:
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1325
    "/     ^ path asFilename directoryName
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1326
    "/ however, that only works under UNIX, since
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1327
    "/ we MUST return a unix pathname here.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1328
    "/ therefore, do what unix would do here ...
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1329
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1330
    idx := path lastIndexOf:$/.
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1331
    idx == 0 ifTrue:[
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1332
        "/ huh ?
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1333
        ^ path
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1334
    ].
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1335
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1336
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1337
    "
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1338
     CVSSourceCodeManager directoryFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1339
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1340
721
5a2a1f8dc18e always extract directoryPart as a UNIX fileName
Claus Gittinger <cg@exept.de>
parents: 705
diff changeset
  1341
    "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
  1342
    "Modified: / 25.9.1998 / 15:38:59 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1343
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1344
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1345
directoryFromSourceInfo:info
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1346
    "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
  1347
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  1348
    ^ info at:#directory ifAbsent:nil.
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1349
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1350
    "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
  1351
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1352
4133
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1353
isPackageWithoutExtensionMethodConfirmation:aPackageID
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1354
    "usually, the checkin dialog asks if unpackaged methods should be moved
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1355
     to the package. 
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1356
     This can be suppressed on a per-package base with a checkbox ('do not...again')
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1357
     in the dialog.
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1358
     This method returns true, if this was done for a particular package"
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1359
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1360
    ^ PackagesWithoutExtensionMethodConfirmation notNil
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1361
    and:[ PackagesWithoutExtensionMethodConfirmation includes:aPackageID]
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1362
!
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1363
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1364
moduleFromContainerPath:containerPath forClass:aClass
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1365
    "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
  1366
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1367
    ^ self moduleFromContainerPath:containerPath forPackage:aClass package
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1368
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1369
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1370
     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
  1371
    "
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1372
!
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1373
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1374
moduleFromContainerPath:containerPath forPackage:packageID
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1375
    "given a full path as in an RCS header, extract the module."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1376
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1377
    |path idx|
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1378
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1379
    path := self pathInRepositoryFrom:containerPath forPackage:packageID.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1380
    path isNil ifTrue:[^ nil].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1381
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1382
    "/ these are always UNIX filenames
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1383
    idx := path indexOf:$/.
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1384
    idx == 0 ifTrue:[^ path].
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1385
    ^ path copyTo:(idx - 1)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1386
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1387
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1388
     SourceCodeManager moduleFromContainerPath:'/files/CVS/stx/libbasic/Array.st'
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1389
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1390
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1391
    "Created: / 25.11.1995 / 18:42:20 / cg"
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1392
    "Modified: / 11.8.1998 / 23:01:24 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1393
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1394
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1395
moduleFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1396
    "given a sourceInfo, return the classes module directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1397
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1398
    ^ info at:#module.  "/ use the modules name as CVS module
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1399
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1400
    "Created: 6.2.1996 / 17:26:38 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1401
    "Modified: 12.9.1996 / 02:32:23 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1402
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1403
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1404
packageFromSourceInfo:info
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1405
    "given a sourceInfo, return the classes package directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1406
1881
7b19d743e02d Mark obsolete messages
Stefan Vogel <sv@exept.de>
parents: 1863
diff changeset
  1407
    <resource: #obsolete>
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1408
    self obsoleteMethodWarning.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1409
    ^ info at:#directory.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1410
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  1411
    "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
  1412
    "Modified: / 23-08-2006 / 14:11:18 / cg"
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1413
!
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1414
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1415
pathInRepositoryFrom:containerPath forPackage:packageID
2915
f0e6c9528a5e added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents: 2866
diff changeset
  1416
    "this tries to extract the path within a repository, 
f0e6c9528a5e added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents: 2866
diff changeset
  1417
     given some path as present in an RCS Header string.
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1418
     Typically, this ought to be that string directly; 
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1419
     however, if the repository directory is accessed via a symbolic link during
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1420
     ci/co, some systems extract different strings with co.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1421
     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
  1422
     and extracted sources had /phys/ibm/CVS in their header.
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1423
     Do not depend on the code below to work correctly all the time."
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1424
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1425
    |top lastTop idx|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1426
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1427
    containerPath isNil ifTrue:[^ nil].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1428
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1429
    packageID notNil ifTrue:[
4076
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1430
        idx := containerPath indexOfSubCollection:((packageID copyReplaceAll:$: with:$/),'/').
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1431
        idx ~~ 0 ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1432
            ^ containerPath copyFrom:idx.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1433
        ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1434
    ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1435
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1436
    "/
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1437
    "/ 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
  1438
    "/ (should not be required)
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1439
    "/
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1440
    top := self repositoryTopDirectoryFromSCMRoot.
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1441
    top notNil ifTrue:[
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1442
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1443
        (containerPath startsWith:(top , '/')) ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1444
            ^ containerPath copyFrom:(top size + 2).
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1445
        ].
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1446
        (containerPath startsWith:(top)) ifTrue:[
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1447
            ^ containerPath copyFrom:(top size + 1).
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1448
        ].
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1449
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1450
        "/ hardcase - the repository-filename in the versionInfo
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1451
        "/ does not match my repository top.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1452
        "/ 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
  1453
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1454
        lastTop := '/' , top asFilename baseName, '/'.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1455
        idx := containerPath indexOfSubCollection:lastTop.
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1456
        idx ~~ 0 ifTrue:[
3512
a69619b661ea class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3511
diff changeset
  1457
            ('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
  1458
            '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
  1459
            ^ containerPath copyFrom:(idx + lastTop size).
148
dd40327e00b7 commentary
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1460
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1461
    ].
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1462
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1463
    ^ nil
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1464
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1465
    "
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1466
     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
  1467
     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
  1468
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1469
     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
  1470
     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
  1471
    "
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1472
1498
67b278e62f29 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1473
    "Created: / 25-11-1995 / 18:42:20 / cg"
67b278e62f29 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
  1474
    "Modified: / 21-06-2006 / 12:06:14 / cg"
2915
f0e6c9528a5e added: #isRevision:sameOfAfter:
Claus Gittinger <cg@exept.de>
parents: 2866
diff changeset
  1475
    "Modified (comment): / 24-09-2012 / 11:10:50 / cg"
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1476
    "Modified: / 18-05-2018 / 12:30:23 / Stefan Vogel"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1477
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1478
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1479
postCheckInClass:aClass
871
93f994512ade checkin from browser
ps
parents: 870
diff changeset
  1480
    "invoked after a checkIn"
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1481
928
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1482
    |p|
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1483
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1484
    (p := Project current) notNil ifTrue:[
3fd94a72c76d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 926
diff changeset
  1485
        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
  1486
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1487
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1488
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1489
    "/ 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
  1490
    "/ 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
  1491
    "/ 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
  1492
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1493
    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
3396
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1494
        mthd package = aClass package ifTrue:[
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1495
            mthd makeLocalStringSource.
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1496
        ]
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1497
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1498
    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
  1499
        eachPrivateClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
3396
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1500
            mthd package = aClass package ifTrue:[
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1501
                mthd makeLocalStringSource.
b7066ff1c30f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
  1502
            ].
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1503
        ]
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1504
    ].
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1505
!
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1506
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1507
postCheckInExtensionsForPackage:aPackageId
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1508
    "invoked after a checkIn"
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1509
2241
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1510
    |p extensionMethods|
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1511
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1512
    (p := Project current) notNil ifTrue:[
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1513
        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
  1514
    ].
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1515
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1516
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1517
    "/ 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
  1518
    "/ 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
  1519
    "/ 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
  1520
    "/
891d18a71bbf After check-in, set the source code for every method of the checked in class or extensions
fm
parents: 2240
diff changeset
  1521
    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
  1522
    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
  1523
        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
  1524
    ].
870
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1525
!
057c11f9cfe1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 868
diff changeset
  1526
4133
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1527
rememberPackageWithoutExtensionMethodConfirmation:aPackageID
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1528
    "usually, the checkin dialog asks if unpackaged methods should be moved
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1529
     to the package. 
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1530
     This can be suppressed on a per-package base with a checkbox ('do not...again')
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1531
     in the dialog.
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1532
     This method adds a package to the set of non-asking packages"
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1533
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1534
    PackagesWithoutExtensionMethodConfirmation isNil ifTrue:[
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1535
        PackagesWithoutExtensionMethodConfirmation := Set new
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1536
    ].    
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1537
    PackagesWithoutExtensionMethodConfirmation add:aPackageID
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1538
!
69be4de4f022 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4119
diff changeset
  1539
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1540
reportError:msg
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1541
    |fullMsg|
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1542
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  1543
    fullMsg := self className,' [error]: ',msg.
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1544
    fullMsg errorPrintCR.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1545
    SourceCodeManagerError raiseErrorString:fullMsg.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1546
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1547
    "Created: / 29-08-2006 / 12:44:19 / cg"
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  1548
    "Modified: / 28-06-2019 / 08:38:29 / Claus Gittinger"
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1549
!
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  1550
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1551
repositoryTopDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1552
    "return the name of the repository"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1553
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1554
    ^ nil
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1555
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1556
    "Created: 25.11.1995 / 18:38:59 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1557
    "Modified: 12.9.1996 / 02:32:40 / cg"
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1558
!
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1559
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1560
sourceCacheDirectory
4415
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1561
    "return the sourceCache directories name.
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1562
     Ensure that it exists."
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  1563
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1564
    |dir nm|
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1565
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1566
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1567
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1568
    (dir := nm asFilename) exists ifFalse:[
3234
eb81b9f6e323 exception access
Claus Gittinger <cg@exept.de>
parents: 3230
diff changeset
  1569
        OsError catch:[
2232
ee754b28809e changed: #sourceCacheDirectory
Claus Gittinger <cg@exept.de>
parents: 2231
diff changeset
  1570
            dir recursiveMakeDirectory.
4415
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1571
            dir exists ifFalse:[
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1572
                ('SourceCodeManager [warning]: could not create cache dir "', CacheDirectoryName,'"') errorPrintCR.
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1573
                ^ nil
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1574
            ].
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1575
            "/
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1576
            "/ make it read/writable for everyone
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1577
            "/
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1578
            dir makeReadableForAll.
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1579
            dir makeWritableForAll.
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  1580
            dir makeExecutableForAll.
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1581
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1582
    ].
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1583
    ^ dir
173
d73d61190510 make sourceCache rwx-able for all
Claus Gittinger <cg@exept.de>
parents: 160
diff changeset
  1584
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1585
    "Modified: 10.1.1997 / 15:13:20 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  1586
!
69
874833ad880c revision log stub method
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1587
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1588
sourceInfoOfClass:aClass
751
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1589
    "helper: return a classes sourceCodeInfo by extracting its
c39b6f348d06 comment
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1590
     versionString components."
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1591
4076
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1592
    |cls clsPackage packageInfo revInfo actualSourceFileName classFileNameBase
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  1593
     newInfo container expectedFileName
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1594
     directoryFromVersion moduleFromVersion fileNameFromVersion 
3280
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1595
     directoryFromPackage moduleFromPackage repairedPath|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1596
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1077
diff changeset
  1597
    cls := aClass theNonMetaclass.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1598
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1599
    newInfo := IdentityDictionary new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1600
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1601
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1602
    "/ the info given by the classes source ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1603
    "/ (i.e. its revisionString)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1604
    "/
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1605
    revInfo := cls revisionInfoOfManager: self.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1606
    revInfo notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1607
        revInfo keysAndValuesDo:[:key :value |
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1608
            newInfo at:key put:value
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1609
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1610
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1611
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1612
    "/
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1613
    "/ the info given by the classes binary ...
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1614
    "/ (i.e. its package-ID)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1615
    "/ if present, we better trust that one.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1616
    "/ however, it only contains partial information (module:directory:libName).
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1617
    "/ (but is available even without a source)
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1618
    "/
4076
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1619
    clsPackage := cls package.
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1620
    "/ hack: fix on-the-fly if corrupted top-module's package (FolderInfo)
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1621
    (clsPackage endsWith:':') ifTrue:[
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1622
        ('SourceCodeManager [warning]: fixing corrupted package identifier: ',clsPackage) infoPrintCR.
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1623
        clsPackage := clsPackage copyButLast asSymbol.
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1624
        cls setPackage:clsPackage.
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1625
    ].
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1626
    cls name = clsPackage ifTrue:[
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1627
        "/ very special - the top-module's FolderInfo
e076b65d9dfe #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4068
diff changeset
  1628
        newInfo at:#module put:clsPackage.
4056
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1629
        newInfo at:#directory put:''.
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1630
    ] ifFalse:[        
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1631
        packageInfo := cls packageSourceCodeInfo.
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1632
        packageInfo notNil ifTrue:[
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1633
            packageInfo keysAndValuesDo:[:key :value |
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1634
                newInfo at:key put:value
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1635
            ]
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1636
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1637
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1638
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1639
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1640
    "/ no information
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1641
    "/
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1642
    (packageInfo isNil and:[revInfo isNil]) ifTrue:[
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1643
        ('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
  1644
        ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1645
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1646
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1647
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1648
    "/ validate for conflicts
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1649
    "/ trust binary if in doubt
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1650
    "/ (in case some cheater edited the version string)
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1651
    "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1652
    revInfo notNil ifTrue:[
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1653
        container := revInfo at:#repositoryPathName ifAbsent:nil.
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1654
        (container notNil) ifTrue:[
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1655
            moduleFromVersion := self moduleFromContainerPath:container forClass:aClass.
1125
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1656
            moduleFromVersion notNil ifTrue:[
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1657
                newInfo at:#module put:moduleFromVersion.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1658
            ].
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1330
diff changeset
  1659
            directoryFromVersion := self directoryFromContainerPath:container forClass:aClass.
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1660
            directoryFromVersion notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1661
                newInfo at:#directory put:directoryFromVersion.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1662
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1663
            fileNameFromVersion := container asFilename baseName.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1664
            (fileNameFromVersion endsWith:',v') ifTrue:[
3230
65624c6c84b9 Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 3131
diff changeset
  1665
                fileNameFromVersion := fileNameFromVersion copyButLast:2.
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1666
            ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1667
            newInfo at:#fileName put:fileNameFromVersion.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1668
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1669
            packageInfo notNil ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1670
                (packageInfo includesKey:#directory) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1671
                    directoryFromPackage := packageInfo at:#directory.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1672
                    moduleFromPackage := packageInfo at:#module.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1673
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1674
                    (directoryFromPackage ~= directoryFromVersion 
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1675
                    or:[moduleFromPackage ~= moduleFromVersion]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1676
                        (directoryFromVersion isNil or:[moduleFromVersion isNil]) ifTrue:[
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1677
                            directoryFromPackage ~= 'no package' ifTrue:[
1125
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1678
                                moduleFromVersion notNil ifTrue:[
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1679
                                    ('SourceCodeManager [warning]: conflicting source infos (binary: ' 
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1680
                                        , (moduleFromPackage ? 'nil')  , '/' , (directoryFromPackage  ? 'nil')
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1681
                                        , ' vs. source:'
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1682
                                        , (moduleFromVersion ? 'nil') , '/' , (directoryFromVersion ? 'nil')
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1683
                                        , ')') infoPrintCR.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1684
                                    ('SourceCodeManager [info]: using binary info: ' 
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1685
                                        , moduleFromPackage , '/' , directoryFromPackage
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1686
                                    ) infoPrintCR.
ace27d6ece7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1687
                                ].
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1688
                                newInfo at:#directory put:directoryFromPackage.
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1689
                                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
  1690
                            ]
187
fdda79120bbb in sourceInfoOfClass: be prepared for binInfo present, but no sourceInfo
Claus Gittinger <cg@exept.de>
parents: 185
diff changeset
  1691
                        ] ifFalse:[
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1692
                            directoryFromPackage ~= 'no package' ifTrue:[
3888
202109d7ba22 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3815
diff changeset
  1693
                                ('SourceCodeManager [warning]: class: ', aClass name, ' - conflicting source infos (binary: ' 
752
5698ea124129 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 751
diff changeset
  1694
                                    , moduleFromPackage  , '/' , directoryFromPackage
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1695
                                    , ' vs. source:'
3888
202109d7ba22 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3815
diff changeset
  1696
                                    , moduleFromVersion  , '/' , directoryFromVersion, ')') infoPrintCR.
581
2f96268045cb avoid stupid warning message when autoloading
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  1697
                            ]
583
aeb05843bd69 suppress annoying warning message about binary vs. source info,
Claus Gittinger <cg@exept.de>
parents: 582
diff changeset
  1698
                        ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1699
                    ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1700
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1701
            ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1702
        ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1703
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1704
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1705
    "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1706
    "/ the filename I'd expect from its name ...
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1707
    "/
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  1708
    classFileNameBase := cls classBaseFilename.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1709
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1710
    (newInfo includesKey:#fileName) ifFalse:[
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1711
        newInfo at:#fileName put:classFileNameBase
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1712
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1713
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1714
    "/ guess on the container
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1715
    ((newInfo includesKey:#directory) and:[newInfo includesKey:#module]) ifTrue:[
4056
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1716
        |moduleDirectory pathInRepository|
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1717
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1718
        (newInfo at:#directory) isEmpty ifTrue:[
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1719
            moduleDirectory := (newInfo at:#module).
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1720
        ] ifFalse:[
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1721
            moduleDirectory := (newInfo at:#module) , '/' , (newInfo at:#directory).
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1722
        ].        
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1723
        container isNil ifTrue:[
4056
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1724
            container := moduleDirectory , '/' , classFileNameBase , ',v'.
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1725
        ].
4056
8b51ad64f9d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4046
diff changeset
  1726
        pathInRepository := moduleDirectory , '/' , classFileNameBase.
1461
15d4f10867df *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1454
diff changeset
  1727
        newInfo at:#pathInRepository put:pathInRepository.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1728
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1729
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1730
    container notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1731
        newInfo at:#repositoryPathName put:container.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1732
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1733
3280
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1734
    (newInfo includesKey:#pathInRepository) ifFalse:[
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1735
        (fileNameFromVersion := newInfo at:#fileName ifAbsent:nil) notNil ifTrue:[
3972
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  1736
            cls projectDirectory notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  1737
                (repairedPath := cls projectDirectory asFilename construct:fileNameFromVersion) exists ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  1738
                    Transcript showCR:('Oldstyle, broken or invalid version-info in class: ',cls name allBold,'. Please check').
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  1739
                    newInfo at:#pathInRepository put:repairedPath pathName.
Claus Gittinger <cg@exept.de>
parents: 3961
diff changeset
  1740
                ].
3280
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1741
            ].
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1742
        ].
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1743
    ].
5b12c2facb52 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3268
diff changeset
  1744
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1745
    "/ check ..
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1746
    revInfo notNil ifTrue:[
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1747
        actualSourceFileName := revInfo at:#fileName ifAbsent:nil.
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1748
        actualSourceFileName notNil ifTrue:[
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1749
            expectedFileName := classFileNameBase.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  1750
            actualSourceFileName ~= expectedFileName ifTrue:[
1223
8ff1171ac4cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
  1751
                ('SourceCodeManager [warning]: source of class ' , cls name , ' in ' , actualSourceFileName , ';') infoPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1752
                ('SourceCodeManager [info]: (expected: ' , expectedFileName , '); renamed or missing abbreviation ?') infoPrintCR.
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 534
diff changeset
  1753
                ('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
  1754
                newInfo at:#expectedFileName put:expectedFileName.
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1755
                newInfo at:#renamed put:true.
1856
1b69eec9b150 care for filename in classFilename,
Claus Gittinger <cg@exept.de>
parents: 1838
diff changeset
  1756
                classFileNameBase := actualSourceFileName
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1757
            ]
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1758
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1759
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1760
1888
61dad1bbee19 use nameWithoutSuffix
Claus Gittinger <cg@exept.de>
parents: 1881
diff changeset
  1761
    newInfo at:#classFileNameBase put:(classFileNameBase asFilename nameWithoutSuffix).
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1762
    ^ newInfo
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  1763
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1764
    "
3815
36cba9b2a19f class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3746
diff changeset
  1765
     SourceCodeManager sourceInfoOfClass:Array
704
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1766
    "
9644a88308bf MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 677
diff changeset
  1767
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  1768
    "Modified: / 22-10-2008 / 20:49:15 / cg"
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1769
    "Modified: / 19-07-2012 / 13:38:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1770
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1771
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1772
updateVersionMethod:selector of:aClass for:newRevisionString
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1773
    "{ Pragma: +optSpace }"
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1774
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1775
    "helper for the checkin procedure.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1776
     Update my #version_XXX method, to now return newRevisionString."
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1777
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1778
    Class methodRedefinitionNotification answer:#keep do:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1779
        Class withoutUpdatingChangesDo:[
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1780
"/            "/ must preserve the binary version, as methods still have the offsets into the old source file inside
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1781
"/            aClass setBinaryRevision:aClass revision.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1782
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1783
            self compileVersionMethod:selector of:aClass for:newRevisionString.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1784
        ]
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1785
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  1786
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  1787
    "Modified: / 29-09-2011 / 21:59:41 / cg"
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1788
    "Created: / 02-12-2011 / 14:18:14 / cg"
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  1789
    "Modified (format): / 18-05-2018 / 12:26:00 / Stefan Vogel"
2638
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1790
!
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1791
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1792
updateVersionMethodOf:aClass for:newRevisionString
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1793
    "{ Pragma: +optSpace }"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1794
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1795
    "helper for the checkin procedure.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1796
     Update my #version_XXX method, to now return newRevisionString."
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1797
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1798
    self updateVersionMethod:(self nameOfVersionMethodInClasses) of:aClass for:newRevisionString.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1799
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1800
    "Updates the old method #version (if present)"
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1801
    true "(aClass theMetaclass includesSelector: Class nameOfOldVersionMethod)" ifTrue: [
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1802
        self updateVersionMethod:(Class nameOfOldVersionMethod) of:aClass for:newRevisionString.
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1803
    ].
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1804
b987066502c4 added: #updateVersionMethod:of:for:
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
  1805
    "Modified: / 02-12-2011 / 14:19:37 / cg"
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1806
! !
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  1807
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1808
!AbstractSourceCodeManager class methodsFor:'queries'!
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1809
2730
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1810
enabled
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1811
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1812
    "JV@2012-01-19: Quick hack, see senders. Is that what you mean?"
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1813
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1814
    ^self askFor:#shownInBrowserMenus
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1815
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1816
    "Created: / 19-01-2012 / 10:39:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1817
!
f4685e7b9ee5 hacked: #enabled
vrany
parents: 2728
diff changeset
  1818
3663
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  1819
initialRevisionString
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  1820
    "redefinable in subclasses"
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  1821
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  1822
    ^ '1.0'
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  1823
!
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  1824
4210
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1825
isAbstract
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1826
    "Return if this class is an abstract class.
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1827
     True is returned here for myself only; false for subclasses.
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1828
     Abstract subclasses must redefine this again."
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1829
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1830
    ^ self == AbstractSourceCodeManager.
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1831
!
f6e6bb346865 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
  1832
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1833
isContainerBased
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1834
    "true, if the SCM uses some kind of source container (,v files).
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1835
     False, if it is like a database or filesystem."
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1836
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1837
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1838
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1839
    "Created: / 21-12-2011 / 18:53:49 / cg"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1840
!
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  1841
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1842
isExperimental
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1843
    ^ false
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1844
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1845
    "Created: / 16-08-2006 / 11:22:47 / cg"
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1846
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1847
2763
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1848
isExtensionsVersionMethodSelector: selector 
3647
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  1849
    "true if the given selector is for ANY of the manager's extensions version methods.
2763
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1850
     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
  1851
     For backward compatibility (times, when there was only one CVS sourcecode manager,
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1852
     the selector named 'extensionsVersion' alone also counts as a version method
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1853
     (which might be a somewhat bad idea in the long term...)."
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1854
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1855
    selector isNil ifTrue: [^ false].
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1856
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1857
    ^ selector == self nameOfVersionMethodForExtensions 
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1858
    or:[selector startsWith: self prefixOfVersionMethodForExtensionsSelector]
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1859
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1860
    "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
  1861
    "Created: / 26-01-2012 / 14:30:45 / cg"
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1862
!
38380a8ec471 added: #isExtensionsVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2762
diff changeset
  1863
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1864
isResponsibleForModule:module
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1865
    ^ self repositoryInfoPerModule keys includes:module
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1866
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  1867
    "Created: / 09-11-2006 / 15:24:57 / cg"
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1868
!
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1869
2445
vrany
parents: 2443
diff changeset
  1870
isResponsibleForPackage:aStringOrSymbol
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1871
    "Returns true if the manager can handle source code for given package.
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1872
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1873
     Answering true does not imply that receiver is configured default
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1874
     manager for that package, it only means that it has a repository
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1875
     configured for given package."
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1876
2445
vrany
parents: 2443
diff changeset
  1877
    self subclassResponsibility
vrany
parents: 2443
diff changeset
  1878
2565
44b3b0d6352f Lost methods
vrany
parents: 2557
diff changeset
  1879
    "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
  1880
    "Modified (format): / 01-12-2011 / 20:56:32 / cg"
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1881
!
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  1882
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1883
isRevision:revision1 after:revision2
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1884
    "true, if the dotted revision string revision1 is > than revision2"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1885
3417
848ad94c1e8f class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3399
diff changeset
  1886
    ^ (revision1 compareAsVersionNumberWith:revision2) > 0
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1887
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1888
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1889
     SourceCodeManager isRevision:'1' after:'2'      
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1890
     SourceCodeManager isRevision:'2' after:'1'      
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1891
     SourceCodeManager isRevision:'1.1' after:'2.1.2' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1892
     SourceCodeManager isRevision:'2.1' after:'1.2.3' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1893
     SourceCodeManager isRevision:'1' after:'1.1'    
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1894
     SourceCodeManager isRevision:'1.1' after:'1'    
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1895
     SourceCodeManager isRevision:'1.1' after:'1.2' 
3417
848ad94c1e8f class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3399
diff changeset
  1896
     SourceCodeManager isRevision:'1.10' after:'1.2' 
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1897
     SourceCodeManager isRevision:'1.2' after:'1.1' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1898
     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
  1899
     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
  1900
     SourceCodeManager isRevision:'1.2.3.4' after:'1.2.3'   
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1901
     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
  1902
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1903
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1904
    "Created: / 21-12-2011 / 19:15:35 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1905
!
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  1906
2916
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1907
isRevision:revision1 sameOrAfter:revision2
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1908
    "true, if the dotted revision string revision1 is >= than revision2"
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1909
3417
848ad94c1e8f class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3399
diff changeset
  1910
    ^ (revision1 compareAsVersionNumberWith:revision2) >= 0
2916
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1911
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1912
    "Created: / 26-09-2012 / 18:15:58 / cg"
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1913
!
259d582b2131 added: #isRevision:sameOrAfter:
Claus Gittinger <cg@exept.de>
parents: 2915
diff changeset
  1914
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1915
isVersionMethodForExtensionsSelector: selector
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1916
    <resource: #obsolete>
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1917
 
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1918
    "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
  1919
     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
  1920
     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
  1921
     the selector named 'extensionsVersion' alone also counts as a version method
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1922
     (which might be a somewhat bad idea in the long term...)."
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1923
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1924
    self obsoleteMethodWarning:'use isExtensionsVersionMethodSelector'.
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  1925
    ^self isExtensionsVersionMethodSelector: selector
2764
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1926
!
c3849e8e0f31 added: #isVersionMethodForExtensionsSelector:
Claus Gittinger <cg@exept.de>
parents: 2763
diff changeset
  1927
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1928
isVersionMethodSelector: selector 
2342
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1929
    "true if the given selector is for one of the manager's version methods.
2445
vrany
parents: 2443
diff changeset
  1930
     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
  1931
     For backward compatibility (times, when there was only one CVS sourcecode manager,
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1932
     the selector named 'version' alone also counts as a version method
9b43866e85b5 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2329
diff changeset
  1933
     (which might be a somewhat bad idea in the long term...)."
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1934
2195
2062d4138045 changed: #isVersionMethodSelector:
fm
parents: 2192
diff changeset
  1935
    selector isNil ifTrue: [^ false].
2062d4138045 changed: #isVersionMethodSelector:
fm
parents: 2192
diff changeset
  1936
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1937
    ^ selector == self nameOfVersionMethodInClasses 
2530
331e4ee893f7 comment/format in: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2529
diff changeset
  1938
    or:[selector startsWith: self prefixOfVersionMethodSelector]
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1939
2445
vrany
parents: 2443
diff changeset
  1940
    "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
  1941
    "Modified (format): / 29-09-2011 / 14:56:15 / cg"
2183
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1942
!
e6f12d8f9934 added: #isVersionMethodSelector:
fm
parents: 2173
diff changeset
  1943
2552
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1944
managerTypeName
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1945
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1946
    "Answers version manager name suitable for UI,
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1947
     i,e., CVS, SubVersion, Perforce"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1948
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1949
    ^ self subclassResponsibility
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1950
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1951
    "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
  1952
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1953
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1954
managerTypeNameShort
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1955
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1956
    "Answers short version manager name suitable for UI,
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1957
     i,e., CVS, SVN, P4. Used in cases where sorter strings
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1958
     are preferred. Defaults to #managerTypeName"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1959
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1960
    ^self managerTypeName
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1961
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1962
    "Created: / 03-10-2011 / 13:28:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1963
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  1964
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1965
nameOfVersionMethodForExtensions
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1966
    "that is the old name; now, we use extensionsVersion_<SCM>"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1967
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1968
    ^ #'extensionsVersion'
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1969
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1970
    "Modified (comment): / 29-09-2011 / 13:27:04 / cg"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1971
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  1972
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1973
nameOfVersionMethodInClasses
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1974
    "that is the old name; now, we use version_<SCM>"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1975
2140
48a3fb6d338d added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 2100
diff changeset
  1976
    ^ #'version'
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1977
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1978
    "Modified (comment): / 29-09-2011 / 13:27:09 / cg"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1979
!
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  1980
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1981
performsCompilabilityChecks
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1982
    "Should return true, if the manager itself performs
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1983
     compilability checks, false otherwise.
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1984
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1985
     Basically a hack, see my senders..."
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1986
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1987
    ^false"/by default
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1988
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1989
    "Created: / 11-04-2012 / 16:54:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1990
!
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  1991
2762
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1992
prefixOfVersionMethodForExtensionsSelector
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1993
    "all scm-extensionsVersion methods start with this prefix"
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1994
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1995
    ^ 'extensionsVersion_'
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1996
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1997
    "Created: / 26-01-2012 / 14:29:32 / cg"
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1998
!
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  1999
2528
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  2000
prefixOfVersionMethodSelector
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  2001
    "all scm-version methods start with this prefix"
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  2002
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  2003
    ^ 'version_'
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  2004
fb5b84f165d4 added: #prefixOfVersionMethodSelector
Claus Gittinger <cg@exept.de>
parents: 2527
diff changeset
  2005
    "Created: / 29-09-2011 / 13:26:29 / cg"
2199
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
2665
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2008
revisionAfter:aRevisionString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2009
    "generate the next revision number after the given number"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2010
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2011
    |idx|
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2012
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2013
    idx := aRevisionString lastIndexOf:$..
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2014
    idx == 0 ifTrue:[
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2015
        ^ ((Integer readFrom:aRevisionString) + 1) printString
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2016
    ].
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2017
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2018
    ^ (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
  2019
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2020
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2021
     SourceCodeManager revisionAfter:'1.2.3.4' 
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2022
     SourceCodeManager revisionAfter:'123'  
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2023
     SourceCodeManager revisionAfter:'1.24'  
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2024
    "
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2025
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2026
    "Created: 20.11.1995 / 12:54:05 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2027
    "Modified: 12.9.1996 / 02:33:03 / cg"
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2028
!
279ad76d9372 comment/format in: #utilities
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
  2029
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  2030
settingsApplicationClass
2350
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  2031
    "link to my settings application (needed for the settings dialog"
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  2032
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  2033
    self subclassResponsibility
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  2034
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  2035
    "Created: / 19-04-2011 / 12:43:54 / cg"
2350
161df39dbbbb added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents: 2347
diff changeset
  2036
    "Modified: / 19-04-2011 / 13:52:45 / cg"
2347
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  2037
!
e84869683cfc added: #managerClass
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  2038
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2039
sourceCodeManagerForPackage:aPackageID
3647
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2040
    |defaultManager module mgr|
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2041
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  2042
    "JV@2012-01-23: If source code management is disabled, return #()."
3647
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2043
    defaultManager := Smalltalk at:#SourceCodeManager.
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2044
    defaultManager isNil ifTrue:[ "eg. disabled" ^ nil ].
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  2045
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2046
    aPackageID notNil ifTrue:[
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  2047
        "/ see if there is a package-specific manager
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  2048
        (mgr := self managerForPackage:aPackageID) notNil ifTrue:[^ mgr].
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2049
3647
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2050
        "/ more or less obsolete now - I know which manager is to be used per package
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2051
        "/        self availableManagers do:[:mgr |
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2052
        "/            (mgr isResponsibleForPackage:aPackageID) ifTrue:[^ mgr ].
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2053
        "/        ].
2259
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  2054
dfb8e835c7d3 added: #isResponsibleForPackage:
Claus Gittinger <cg@exept.de>
parents: 2241
diff changeset
  2055
        "/ 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
  2056
        module := aPackageID upTo:$:.
2225
fm
parents: 2224
diff changeset
  2057
        self availableManagers do:[:mgr |
fm
parents: 2224
diff changeset
  2058
            (mgr isResponsibleForModule:module) ifTrue:[^ mgr ].
fm
parents: 2224
diff changeset
  2059
        ]
fm
parents: 2224
diff changeset
  2060
    ].
3647
41283198781e class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
  2061
    ^ defaultManager
2329
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2062
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2063
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2064
     self sourceCodeManagerForPackage:'stx:libbasic'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2065
     self sourceCodeManagerForPackage:'stx:libboss'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2066
     self managerForMatchingModule:'stx:libba*' put:SVNSourceCodeManager.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2067
     self sourceCodeManagerForPackage:'stx:libbasic'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2068
     self sourceCodeManagerForPackage:'stx:libboss'.
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2069
    "
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2070
2fc2fbd7a63c per package-id-match repository managers
Claus Gittinger <cg@exept.de>
parents: 2324
diff changeset
  2071
    "Modified: / 18-04-2011 / 19:53:03 / cg"
2743
0539670d18e4 changed:
vrany
parents: 2742
diff changeset
  2072
    "Modified: / 23-01-2012 / 19:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2225
fm
parents: 2224
diff changeset
  2073
!
fm
parents: 2224
diff changeset
  2074
2649
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2075
supportsCheckinLogMessages
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2076
    "true, if log-messages are supported"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2077
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2078
    ^ true
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2079
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2080
    "Created: / 21-12-2011 / 18:02:34 / cg"
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2081
!
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
  2082
3661
ce825c324ef7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3652
diff changeset
  2083
versionInfoClass
ce825c324ef7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3652
diff changeset
  2084
ce825c324ef7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3652
diff changeset
  2085
    ^VersionInfo
ce825c324ef7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3652
diff changeset
  2086
!
ce825c324ef7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3652
diff changeset
  2087
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2088
versionMethodKeyword
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2089
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2090
    "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
  2091
     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
  2092
     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
  2093
     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
  2094
     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
  2095
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2096
    "/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
  2097
    "/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
  2098
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2099
    ^'Header'
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2100
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2101
    "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
  2102
!
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2103
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2104
versionMethodTemplateForJavaScript
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2105
    ^ self versionMethodTemplateForJavaScriptFor:(self nameOfVersionMethodInClasses)
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2106
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2107
    "
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2108
     CVSSourceCodeManager versionMethodTemplateForJavaScript
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2109
    "
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2110
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2111
    "Created: / 19-08-2011 / 01:20:28 / cg"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2112
!
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2113
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2114
versionMethodTemplateForJavaScriptFor:aSelector
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2115
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2116
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2117
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2118
    ^
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2119
"'function ',"aSelector,'() {
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2120
    return "$' , self versionMethodKeyword , '$";
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2121
}'
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2122
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2123
    "Created: / 19-08-2011 / 01:20:56 / cg"
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2124
    "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
  2125
!
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2126
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2127
versionMethodTemplateForRuby
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2128
    ^ self versionMethodTemplateForRubyFor:(self nameOfVersionMethodInClasses)
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2129
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2130
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2131
     CVSSourceCodeManager versionMethodTemplateForRuby
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2132
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2133
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2134
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2135
versionMethodTemplateForRubyFor:aSelector
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2136
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2137
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2138
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2139
    ^
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2140
'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
  2141
    return "$' , self versionMethodKeyword , '$"
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2142
end'
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2143
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2144
    "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
  2145
    "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
  2146
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2147
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2148
versionMethodTemplateForSmalltalk
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2149
    ^ self versionMethodTemplateForSmalltalkFor:(self nameOfVersionMethodInClasses)
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2150
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2151
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2152
     CVSSourceCodeManager versionMethodTemplateForSmalltalk
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2153
    "
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2154
!
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2155
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2156
versionMethodTemplateForSmalltalkFor:aSelector
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2157
    "do not make the thing below a single string - otherwise
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2158
     it would get expanded by the sourcecodemanager, which we do not want here"
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2159
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2160
    ^
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2161
aSelector,'
2527
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  2162
    ^ ''$', self versionMethodKeyword , '$''
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  2163
'
2476
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2164
c7f6edd530b9 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
  2165
    "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
  2166
    "Modified: / 27-09-2011 / 16:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4434
642559b61811 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4427
diff changeset
  2167
!
642559b61811 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4427
diff changeset
  2168
642559b61811 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4427
diff changeset
  2169
versionString:stringA isLessThan:stringB
642559b61811 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4427
diff changeset
  2170
    ^ self utilities versionString:stringA isLessThan:stringB
642559b61811 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4427
diff changeset
  2171
642559b61811 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4427
diff changeset
  2172
    "Created: / 28-05-2019 / 15:53:16 / Claus Gittinger"
1893
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  2173
! !
740930d87917 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1890
diff changeset
  2174
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  2175
!AbstractSourceCodeManager class methodsFor:'source code access'!
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2176
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2177
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
  2178
    "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
  2179
     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
  2180
     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
  2181
3624
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2182
    aClass isPrivate ifTrue:[
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2183
        self reportError:'refuse to check in private classes.'.
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2184
        ^ false.
ad34fdcdc273 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3597
diff changeset
  2185
    ].
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2186
    ^ self 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2187
        withClass:aClass 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2188
        classFileName:classFileName 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2189
        filedOutToTemporaryFileDo:[:tempFile |
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2190
            self 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2191
                checkinClass:aClass
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2192
                fileName:classFileName 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2193
                directory:packageDir 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2194
                module:moduleDir
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2195
                source:(tempFile name)
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2196
                logMessage:logMessage
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2197
                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
  2198
        ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2199
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2200
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2201
     SourceCodeManager checkinClass:Array
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2202
    "
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2203
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2204
    "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
  2205
    "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
  2206
!
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2207
4284
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2208
checkin:containerFilename text:someText directory:packageDir module:moduleName logMessage:logMessage force:force
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2209
    "enter some (source) code (which is someText)
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2210
     into the source repository. If the force argument is true, no merge is done;
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2211
     instead, the code is checked in as given (Dangerous).
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2212
     Return true if ok, false if not."
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2213
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2214
    ^ self checkin:containerFilename text:someText directory:packageDir module:moduleName logMessage:logMessage force:force onBranch:nil
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2215
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2216
    "Modified: / 19-04-2012 / 14:18:24 / sr"
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2217
    "Modified: / 05-12-2017 / 23:30:00 / cg"
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2218
!
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2219
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2220
checkin:containerFilename text:someText directory:packageDir module:moduleName logMessage:logMessage force:force onBranch:branchNameOrNil
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2221
    "enter some (source) code (which is someText)
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2222
     into the source repository. If the force argument is true, no merge is done;
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2223
     instead, the code is checked in as given (Dangerous).
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2224
     Return true if ok, false if not."
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2225
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2226
    self subclassResponsibility
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2227
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2228
    "Created: / 05-12-2017 / 23:30:37 / cg"
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2229
!
74759f312989 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4279
diff changeset
  2230
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2231
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
  2232
    "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
  2233
     Return true if ok, false if not."
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2234
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2235
    ^ self
4279
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2236
        checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage onBranch:nil
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2237
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2238
    "Modified: / 05-12-2017 / 20:28:20 / cg"
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2239
!
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2240
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2241
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
  2242
    "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
  2243
     Return true if ok, false if not."
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2244
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2245
    |theMetaclass className answer allLabel allValue 
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2246
     nameOfVersionMethodInClasses revision question|
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2247
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2248
    className := aClass name.
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2249
    theMetaclass := aClass theMetaclass.
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2250
    nameOfVersionMethodInClasses := self nameOfVersionMethodInClasses.
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2251
3930
aecdc8ea19d8 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3899
diff changeset
  2252
    (revision := aClass revisionOfManager:self) isNil ifTrue:[ 
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2253
        force ifFalse:[
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2254
            ('SourceCodeManager [warning]: class "%1" has no revision string (for %2)' bindWith:className with:self managerTypeName) errorPrintCR.
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2255
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2256
            AbortAllOperationWantedQuery query ifTrue:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2257
                allLabel := #('Cancel All').
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2258
                allValue := #(cancelAll).
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2259
            ] ifFalse:[
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2260
                allLabel := #().
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2261
                allValue := #().
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2262
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2263
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2264
            ((theMetaclass includesSelector:#version)
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2265
               or:[theMetaclass includesSelector: nameOfVersionMethodInClasses]) ifTrue:[
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2266
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2267
                (theMetaclass includesSelector: nameOfVersionMethodInClasses) ifTrue:[
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2268
                    question := 'Class "%1" has a broken revision string (for %2).\\Checkin as newest?' 
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2269
                ] ifFalse:[
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2270
                    question := 'Class "%1" has no revision string (for %2).\\Initial Checkin?' 
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2271
                ].
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2272
                answer := OptionBox 
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2273
                            request:(question bindWith:className allBold with:self managerTypeName) withCRs
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2274
                            label:'Confirm'
3930
aecdc8ea19d8 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3899
diff changeset
  2275
                            buttonLabels:(allLabel , #('Cancel' 'Browse & Cancel' 'CheckIn')) 
aecdc8ea19d8 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3899
diff changeset
  2276
                            values:(allValue , #(false #browse #checkIn))
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2277
                            default:#checkIn.
3930
aecdc8ea19d8 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3899
diff changeset
  2278
                answer == #browse ifTrue:[
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2279
                    UserPreferences browserClass openInClass:theMetaclass.
3930
aecdc8ea19d8 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3899
diff changeset
  2280
                    AbortOperationRequest raise. ^ false
aecdc8ea19d8 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3899
diff changeset
  2281
                ].    
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2282
            ] ifFalse:[
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2283
                force ifTrue:[
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2284
                    revision := self newestRevisionInFile:classFileName directory:packageDir module:moduleDir.
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2285
                    revision isNil ifTrue:[
3663
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  2286
                        revision := self initialRevisionString   "/ initial checkin
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2287
                    ].
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2288
                ] ifFalse:[
3663
4cd9f90aaad3 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
  2289
                    revision := self initialRevisionString   "/ initial checkin
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2290
                ].
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2291
                answer := #create.
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2292
"/                answer := OptionBox 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2293
"/                            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
  2294
"/                            label:'Confirm'
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2295
"/                            buttonLabels:(allLabel , #('Cancel' 'CheckIn' 'Create & CheckIn')) 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2296
"/                            values:(allValue , #(false #checkIn #create))
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2297
"/                            default:#create.
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2298
            ].
2980
7dab3220c55b class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
  2299
            answer == false ifTrue:[ AbortOperationRequest raise. ^ false ].
7dab3220c55b class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 2979
diff changeset
  2300
            answer == #cancelAll ifTrue:[ AbortAllOperationRequest raise. ^ false ].
2654
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2301
            answer == #create ifTrue:[ 
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  2302
                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
  2303
            ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2304
        ]
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2305
    ].
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2306
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2307
    "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
  2308
     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
  2309
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2310
    ^ 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
  2311
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2312
    "
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2313
     SourceCodeManager checkinClass:Array
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2314
    "
6cb5bc656e8c added: #basicCheckinClass:fileName:directory:module:logMessage:force:
Claus Gittinger <cg@exept.de>
parents: 2649
diff changeset
  2315
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2316
    "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
  2317
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
4008
0d40ebdb8760 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  2318
    "Modified: / 30-04-2016 / 12:59:59 / cg"
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2319
!
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2320
4279
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2321
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir logMessage:logMessage onBranch:branchNameOrNil
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2322
    "checkin of a class into the source repository.
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2323
     Return true if ok, false if not."
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2324
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2325
    ^ self
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2326
        checkinClass:aClass 
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2327
        fileName:classFileName 
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2328
        directory:packageDir 
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2329
        module:moduleDir 
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2330
        logMessage:logMessage
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2331
        force:false
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2332
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2333
    "Created: / 05-12-2017 / 20:28:07 / cg"
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2334
!
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2335
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2336
checkinClass:aClass logMessage:logMessage
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2337
    "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
  2338
     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
  2339
4279
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2340
    ^ self checkinClass:aClass logMessage:logMessage onBranch:nil
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2341
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2342
    "
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2343
     SourceCodeManager checkinClass:Array logMessage:'foo'
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2344
    "
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2345
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2346
    "Created: / 06-11-1995 / 18:56:00 / cg"
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2347
    "Modified: / 05-12-2017 / 20:27:46 / cg"
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2348
!
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2349
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2350
checkinClass:aClass logMessage:logMessage onBranch:branchNameOrNil
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2351
    "checkin of a class into the source repository.
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2352
     Return true if ok, false if not."
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2353
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2354
    |sourceInfo packageDir moduleDir classFileName|
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2355
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2356
    sourceInfo := self sourceInfoOfClass:aClass.
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2357
    sourceInfo isNil ifTrue:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2358
        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
  2359
        ^ false
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2360
    ].
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2361
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2362
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2363
    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
  2364
    classFileName := self containerFromSourceInfo:sourceInfo.
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2365
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2366
    ^ self 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2367
        checkinClass:aClass 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2368
        fileName:classFileName 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2369
        directory:packageDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2370
        module:moduleDir 
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2371
        logMessage:logMessage
4279
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2372
        onBranch:branchNameOrNil
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2373
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2374
    "
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2375
     SourceCodeManager checkinClass:Array logMessage:'foo'
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2376
    "
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  2377
4279
c1c328421f15 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  2378
    "Created: / 05-12-2017 / 20:27:33 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2379
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2380
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2381
getFile:fileName revision:revision directory:packageDir module:moduleDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2382
    |s contents|
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2383
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2384
    s := self 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2385
            streamForFile:fileName 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2386
            revision:revision 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2387
            directory:packageDir
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2388
            module:moduleDir.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2389
    s isNil ifTrue:[^ nil].
3582
9ea25bf13e00 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3512
diff changeset
  2390
    contents := s contentsAsString.
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2391
    s close.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2392
    ^ contents
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2393
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2394
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2395
     SourceCodeManager 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2396
        getFile:'Make.spec' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2397
        revision:#newest 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2398
        directory:'libbasic2' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2399
        module:'stx'
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2400
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2401
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2402
    "Created: / 29-08-2006 / 15:47:08 / cg"
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2403
!
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2404
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2405
getMostRecentSourceStreamForClassNamed:aClassName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2406
    "given a class, return an open stream to its most recent source
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2407
     (not knowing anything about its version).
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2408
     Used when autoloading classes."
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  2409
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2410
    ^ self
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2411
        getMostRecentSourceStreamForClassNamed:aClassName 
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2412
        inPackage:nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2413
!
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2414
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2415
getMostRecentSourceStreamForClassNamed:aClassName inPackage:forcedPackage
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2416
    "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
  2417
     (not knowing anything about its version).
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2418
     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
  2419
     recent found in the repostitory.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2420
     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
  2421
     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
  2422
     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
  2423
     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
  2424
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  2425
    |cls sourceInfo classFileName packageDir moduleDir s components i|
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2426
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2427
    cls := Smalltalk classNamed:aClassName.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2428
    cls notNil ifTrue:[
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2429
        sourceInfo := self sourceInfoOfClass:cls.
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2430
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2431
    sourceInfo notNil ifTrue:[
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2432
        packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2433
        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
  2434
        classFileName := self containerFromSourceInfo:sourceInfo.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2435
    ] ifFalse:[
1838
91828978bae1 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1837
diff changeset
  2436
        classFileName := (Smalltalk fileNameForClass:aClassName), '.st'.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2437
        packageDir := Smalltalk sourceDirectoryNameOfClass:aClassName.
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2438
        packageDir notNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2439
            (packageDir startsWith:'stx/') ifTrue:[
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2440
                "this is a backward compatibility leftover - will vanish"
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2441
                packageDir := packageDir copyFrom:5.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2442
            ] ifFalse:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2443
                i := packageDir indexOf:$:.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2444
                i ~~ 0 ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2445
                    moduleDir := packageDir copyTo:i-1.
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2446
                    packageDir := packageDir copyFrom:i+1
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2447
                ]
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2448
            ]
744
eaf185681d85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  2449
        ].
769
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2450
        moduleDir isNil ifTrue:[
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2451
            moduleDir := 'stx'
35f1e380bd30 moduleDir extraction
Stefan Vogel <sv@exept.de>
parents: 759
diff changeset
  2452
        ].
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2453
    ].
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2454
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2455
    packageDir isNil ifTrue:[
745
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2456
        forcedPackage isNil ifTrue:[
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2457
            'SourceCodeManager [warning]: could not extract packageDir' errorPrintCR.
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2458
            ^ nil
a17a530bb089 fixed fileIn of autoloaded class via CVS
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  2459
        ].
1777
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2460
        moduleDir := forcedPackage asPackageId module.
9ae57293c00f sourceCache organized as package-hierarchy to prevent
Claus Gittinger <cg@exept.de>
parents: 1729
diff changeset
  2461
        packageDir := forcedPackage asPackageId directory.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2462
    ].
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2463
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2464
    s := self 
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2465
        streamForClass:nil
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2466
        fileName:classFileName 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2467
        revision:#newest 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2468
        directory:packageDir 
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 127
diff changeset
  2469
        module:moduleDir
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2470
        cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2471
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2472
    s isNil ifTrue:[
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2473
        "/ guessed moduleDir ?
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2474
        
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2475
        sourceInfo isNil ifTrue:[
1417
2707849f626a No need to use Filename>>#concreteClass
Stefan Vogel <sv@exept.de>
parents: 1392
diff changeset
  2476
            components := Filename components:packageDir.
557
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2477
            moduleDir := components first.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2478
            packageDir := (Filename fromComponents:(components copyFrom:2)) asString.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2479
            s := self 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2480
                streamForClass:nil
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2481
                fileName:classFileName 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2482
                revision:#newest 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2483
                directory:packageDir 
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2484
                module:moduleDir
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2485
                cache:false.
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2486
        ]
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2487
    ].
8466accf9276 if checkout fails, split packageDirectory into
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  2488
    ^ s.
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2489
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2490
    "Created: / 12-10-1996 / 17:22:54 / cg"
1838
91828978bae1 classFilename handling
Claus Gittinger <cg@exept.de>
parents: 1837
diff changeset
  2491
    "Modified: / 06-10-2006 / 16:17:33 / cg"
71
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2492
!
a8c7364b9bb6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
  2493
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2494
getMostRecentSourceStreamForFile:aFileName inPackage:aPackage
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2495
    "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
  2496
     (not knowing anything about its version).
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2497
     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
  2498
     recent found in the repostitory."
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2499
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2500
    |directory module|
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2501
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2502
    module := aPackage asPackageId module.
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2503
    directory := aPackage asPackageId directory.
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2504
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2505
    ^ self 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2506
        streamForFile:aFileName 
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2507
        revision:#newest 
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2508
        directory:directory 
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2509
        module:module.
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2510
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2511
    "Created: / 12-10-1996 / 17:22:54 / cg"
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2512
    "Modified: / 29-08-2006 / 15:49:02 / cg"
1594
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2513
!
25b2a84fc356 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1550
diff changeset
  2514
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2515
getSourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2516
    "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
  2517
     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
  2518
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2519
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2520
    ^ self getSourceStreamFor:aClass revision:nil
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2521
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2522
    "Created: 12.10.1996 / 17:21:03 / cg"
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2523
    "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
  2524
!
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2525
493
ec81df138d8f had to rename sourceStreamFor: to #getSourceStreamFor:
Claus Gittinger <cg@exept.de>
parents: 482
diff changeset
  2526
getSourceStreamFor:aClass revision:aRevisionStringOrNil
83
250202dc956e added sourceStreamFor:revision: - to access a specific (older) revision
Claus Gittinger <cg@exept.de>
parents: 77
diff changeset
  2527
    "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
  2528
     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
  2529
     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
  2530
     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
  2531
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2532
    ^ self getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:true
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2533
!
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2534
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2535
getSourceStreamFor:aClass revision:aRevisionStringOrNil cache:cache
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2536
    "extract a classes source code and return an open readStream on it.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2537
     A revision of nil selects the current (in image) revision.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2538
     The classes source code is extracted using the revision and the sourceCodeInfo,
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2539
     which itself is extracted from the classes packageString."
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2540
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2541
    |classFileName binaryRevision revision revisionUsed
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2542
     packageDir moduleDir sourceInfo revForMeOrNil|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2543
943
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2544
    aRevisionStringOrNil == #newest ifTrue:[
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2545
        ^ self getMostRecentSourceStreamForClassNamed:(aClass theNonMetaclass name).
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2546
    ].
0c58257cb139 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2547
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2548
    (revisionUsed := aRevisionStringOrNil) isNil ifTrue:[
2510
45b4c466a799 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2505
diff changeset
  2549
        revision := aClass revisionOfManager:self.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2550
        binaryRevision := aClass binaryRevision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2551
        binaryRevision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2552
            revision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2553
                ('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
  2554
                ^ nil.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2555
            ].
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2556
            revisionUsed := revision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2557
        ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2558
            "/ 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
  2559
            revForMeOrNil := self revisionInfoFromString:aClass binaryRevisionString.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2560
            revForMeOrNil isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2561
                revision isNil ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2562
                    ('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
  2563
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2564
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2565
                        with:self name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2566
                ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2567
                    ('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
  2568
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2569
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2570
                        with:self name) infoPrintCR.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2571
                ].
2546
be9e1b778210 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  2572
                ^ nil
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2573
            ] ifFalse:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2574
                revision ~= binaryRevision ifTrue:[
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2575
                    ('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
  2576
                        bindWith:aClass name
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2577
                        with:revision with:binaryRevision
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2578
                        with:self name) infoPrintCR.
2547
ccb236fb305e changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  2579
                    "/ self halt.
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2580
                ].
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2581
                revisionUsed := binaryRevision.
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2582
            ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2583
        ]
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2584
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2585
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  2586
    sourceInfo := self sourceInfoOfClass:aClass.
1066
683643ad5544 better info message (contains ... methods in other packages ..)
Claus Gittinger <cg@exept.de>
parents: 1060
diff changeset
  2587
    sourceInfo isNil ifTrue:[
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2588
"/       ('SourceCodeManager [warning]: no sourceInfo for class "%1"' bindWith:aClass name) infoPrintCR.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2589
"/        ^ nil
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2590
        "/ let's hope...
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2591
        classFileName := aClass classFilename.
2926
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2592
        packageDir := aClass package asPackageId directory.
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2593
        moduleDir := aClass package asPackageId module.
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2594
    ] ifFalse:[
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2595
        packageDir := self directoryFromSourceInfo:sourceInfo.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2596
        packageDir isNil ifTrue:[
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2597
            packageDir := aClass package asPackageId directory.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2598
            moduleDir := aClass package asPackageId module.
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2599
        ] ifFalse:[
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2600
            moduleDir := self moduleFromSourceInfo:sourceInfo.  "/ use the modules name as CVS module
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2601
        ].
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2602
        classFileName := self containerFromSourceInfo:sourceInfo.
2926
d335aecb95c3 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2924
diff changeset
  2603
    ].
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2604
    ^ self 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2605
        streamForClass:aClass
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2606
        fileName:classFileName 
2543
fee92873f0c6 changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2530
diff changeset
  2607
        revision:revisionUsed 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2608
        directory:packageDir 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  2609
        module:moduleDir
3345
ef913a1c10e8 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  2610
        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
  2611
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2612
    "Created: / 12-10-1996 / 17:21:52 / cg"
2547
ccb236fb305e changed: #getSourceStreamFor:revision:
Claus Gittinger <cg@exept.de>
parents: 2546
diff changeset
  2613
    "Modified: / 29-09-2011 / 22:02:55 / cg"
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2614
!
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2615
3511
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2616
loadPackageWithId:aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded
4039
2ba7de79ed19 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4030
diff changeset
  2617
    "Should be redefined by subclasses.
3511
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2618
     Raise an exception, if load failed."
41c63b951cf8 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3510
diff changeset
  2619
4170
682c8527a1e2 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4158
diff changeset
  2620
    PackageLoadError raiseRequestWith:aPackageId errorString:'unimplemented feature, load package'.
2225
fm
parents: 2224
diff changeset
  2621
!
fm
parents: 2224
diff changeset
  2622
1780
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2623
streamForFile:fileName revision:revision directory:packageDir module:moduleDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2624
    ^ self
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2625
        streamForClass:nil
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2626
        fileName:fileName 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2627
        revision:revision 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2628
        directory:packageDir 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2629
        module:moduleDir
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2630
        cache:true
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2631
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2632
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2633
     SourceCodeManager 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2634
        streamForFile:'Make.spec' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2635
        revision:#newest 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2636
        directory:'libbasic2' 
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2637
        module:'stx'
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2638
    "
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2639
60a1781038f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1777
diff changeset
  2640
    "Created: / 29-08-2006 / 15:41:43 / cg"
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2641
!
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2642
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2643
withClass:aClass classFileName:classFileName filedOutToTemporaryFileDo:aBlock
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2644
    "helper. fileout and eval aBlock"
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2645
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  2646
    |tempDir tempFile packageMode filter|
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2647
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2648
    packageMode := self checkMethodPackagesOf:aClass.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2649
    packageMode == #base ifTrue:[
2979
ca2676ba02a1 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2975
diff changeset
  2650
        filter := [:mthd | mthd package == aClass package].
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2651
    ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2652
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2653
    tempDir := Filename newTemporaryDirectory.
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  2654
    ^ [
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2655
        |aStream|
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2656
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2657
        tempFile := tempDir construct:classFileName.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2658
        [
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2659
            aStream := tempFile writeStream.
4540
720d5dedacd9 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4530
diff changeset
  2660
        ] on:OpenError do:[:ex|
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2661
            self reportError:('temporary fileout failed').
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2662
            ^ false
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2663
        ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2664
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2665
        Method flushSourceStreamCache.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2666
        Class fileOutErrorSignal handle:[:ex |
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2667
            aStream close.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2668
            self reportError:('fileout failed (',ex description,')').
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2669
            ^ false
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2670
        ] do:[
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2671
            self 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2672
                fileOutSourceCodeOf:aClass 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2673
                on:aStream 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2674
                withTimeStamp:false 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2675
                withInitialize:true 
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2676
                withDefinition:true
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2677
                methodFilter:filter.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2678
        ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2679
        aStream close.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2680
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2681
        tempFile exists ifFalse:[
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2682
            self reportError:'temporary fileout failed'.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2683
            ^ false.
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2684
        ].
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  2685
        aBlock value:tempFile 
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2686
    ] ensure:[
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2687
        tempDir recursiveRemove
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2688
    ].
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2689
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2690
    "
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2691
     SourceCodeManager checkinClass:Array
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2692
    "
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2693
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2694
    "Modified: / 25-09-1997 / 12:16:00 / stefan"
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2695
    "Modified: / 20-08-2011 / 14:52:01 / cg"
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  2696
    "Created: / 25-07-2012 / 19:38:23 / cg"
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  2697
    "Modified: / 12-02-2019 / 20:03:33 / Stefan Vogel"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2698
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
  2699
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  2700
!AbstractSourceCodeManager class methodsFor:'source code administration'!
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
  2701
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2702
fileOutSourceCodeExtensions: extensions package: package on: stream
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2703
    "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
  2704
     Not programming-language safe  - can handle smalltalk methods."
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2705
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2706
    ^self fileOutSourceCodeExtensions: extensions package: package on: stream version: true.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2707
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2708
    "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
  2709
    "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
  2710
!
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2711
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2712
fileOutSourceCodeExtensions: extensions package: pkg on: stream version: versionIt
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2713
    "File out extension methods for given package on stream. 
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2714
     Not programming-language safe  - can handle smalltalk methods."
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2715
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2716
    | source |
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2717
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2718
    self assert: (extensions allSatisfy:[:m|m programmingLanguage isSmalltalk]).
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2719
    source := self utilities sourceCodeForExtensions:extensions package:pkg forManager:self.
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2720
    source isWideString ifTrue:[
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2721
        | s |
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2722
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2723
        s:= EncodedStream stream: stream encoder: (CharacterEncoder encoderForUTF8).      
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2724
        s nextPutAll: '"{ Encoding: utf8 }"'; cr;cr.
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2725
        s nextPutAll: source.
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2726
    ] ifFalse:[
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  2727
        stream nextPutAll: source.
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2728
    ].
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2729
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2730
    self checkTabSpaceConventionIn: stream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2731
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2732
    "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
  2733
    "Modified: / 29-11-2013 / 13:10:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2734
!
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2735
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2736
fileOutSourceCodeOf:aClass on:aStream
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2737
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2738
    self withSourceRewriteHandlerDo:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2739
        aClass fileOutOn:aStream withTimeStamp:false.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2740
    ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2741
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2742
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2743
fileOutSourceCodeOf:aClass on:aStream 
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  2744
      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
  2745
      methodFilter:methodFilter
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2746
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2747
    "JV@2012-02-02: Do not fileout extensionVersion methods, that one is filed out
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2748
     when extensions are filed out."
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2749
"/    (aClass inheritsFrom: ProjectDefinition) ifTrue:[
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2750
"/        filter := [:m| (methodFilter value: m) 
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2751
"/                        and:[ (self isExtensionsVersionMethodSelector:m selector) not
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2752
"/                         "m selector ~~ self nameOfVersionMethodForExtensions"] 
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2753
"/                  ]
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2754
"/    ] ifFalse:[
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2755
"/        filter := methodFilter.
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2756
"/    ].
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2757
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2758
    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
  2759
        | writer |
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2760
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2761
        writer := aClass programmingLanguage sourceFileWriterClass new.
3710
21fec77b695d Fix bad bug in AbstractSourceCodeManager>>fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3709
diff changeset
  2762
        writer generatingSourceForOriginal:true.
3628
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2763
        writer 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2764
            fileOut:aClass 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2765
            on:aStream 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2766
            withTimeStamp:withTimeStamp 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2767
            withInitialize:withInitialize 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2768
            withDefinition:withDefinition 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2769
            methodFilter:methodFilter 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2770
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2771
"/        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
  2772
"/               withTimeStamp:withTimeStamp 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2773
"/               withInitialize:withInitialize 
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2774
"/               withDefinition:withDefinition
a35c08debde5 Changed fileutOut:on:.... to use source code manager directly, passing
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3624
diff changeset
  2775
"/               methodFilter:filter.
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2776
    ].
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  2777
3453
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2778
    self checkTabSpaceConventionIn: aStream.
d5b7369cc5de merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3417
diff changeset
  2779
3710
21fec77b695d Fix bad bug in AbstractSourceCodeManager>>fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3709
diff changeset
  2780
    "Modified: / 22-01-2015 / 09:39:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4323
17876f7b5860 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4316
diff changeset
  2781
    "Modified: / 18-05-2018 / 12:47:06 / Stefan Vogel"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2782
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  2783
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2784
getExistingContainersInModule:aModule directory:aPackage
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2785
    "{ Pragma: +optSpace }"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2786
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2787
    "return a collection containing the names of existing containers"
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2788
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2789
    ^ self subclassResponsibility
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2790
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2791
    "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
  2792
!
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2793
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2794
getExistingDirectoriesInModule:aModule
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2795
    "{ Pragma: +optSpace }"
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2796
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2797
    "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
  2798
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2799
    ^ self subclassResponsibility
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2800
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2801
    "Created: / 23-08-2006 / 14:13:52 / cg"
677
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2802
!
17133f6eddcb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 676
diff changeset
  2803
676
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2804
getExistingModules
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2805
    "{ Pragma: +optSpace }"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2806
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2807
    "return a collection containing the names of existing modules"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2808
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2809
    ^ self subclassResponsibility
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2810
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2811
    "Modified: / 29.1.1997 / 18:57:29 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2812
    "Created: / 20.5.1998 / 19:38:23 / cg"
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2813
!
024f7185c0c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  2814
4275
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2815
knownBranchTagsAndRevisionsFor:aClass
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2816
    "retrieve a list of branch (symbolic tags -> versionNr) associations known for that class.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2817
     I.e. which tags/symbolic versions exist, and which revision-nr is attached to it"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2818
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2819
    |allTagsAndVersions|
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2820
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2821
    allTagsAndVersions := self knownTagsAndRevisionsFor:aClass.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2822
    ^ self onlyBranchTagsFrom:allTagsAndVersions
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2823
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2824
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2825
     CVSSourceCodeManager knownBranchTagsAndRevisionsFor:Array
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2826
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2827
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2828
    "Created: / 05-12-2017 / 19:27:50 / cg"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2829
!
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2830
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2831
knownBranchTagsAndRevisionsForContainer:classFileName directory:packageDir module:moduleDir
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2832
    "retrieve all branch tages."
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2833
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2834
    |allTagsAndVersions|
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2835
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2836
    allTagsAndVersions := self knownTagsAndRevisionsForContainer:classFileName directory:packageDir module:moduleDir.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2837
    ^ self onlyBranchTagsFrom:allTagsAndVersions
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2838
    
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2839
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2840
     CVSSourceCodeManager knownBranchTagsAndRevisionsFor:cg_test2
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2841
     CVSSourceCodeManager knownBranchTagsAndRevisionsForContainer:'cg_test2.st' directory:'test2' module:'cg'
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2842
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2843
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2844
    "Created: / 05-12-2017 / 19:19:29 / cg"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2845
!
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2846
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2847
knownTagsAndRevisionsFor:aClass
4274
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2848
    "retrieve a list of (symbolic tags -> versionNr) associations known for that class.
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2849
     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
  2850
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2851
    |log|
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2852
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2853
    log := aClass sourceCodeManager revisionLogOf:aClass fromRevision:nil toRevision:nil finishAfter:20.
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2854
    log isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2855
        SourceCodeManagerError 
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2856
            raiseRequestWith:aClass
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2857
            errorString: 'Could not fetch log (cvs connection error?)'.
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2858
        ^ #()
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2859
    ].
2827
f473f55da102 **** new version from Christian
Claus Gittinger <cg@exept.de>
parents: 2821
diff changeset
  2860
    ^ (log at:#symbolicNames ifAbsent:[ #() ]).
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2861
4274
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2862
    "
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2863
     CVSSourceCodeManager knownTagsAndRevisionsFor:Array
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2864
    "
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2865
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2866
    "Created: / 08-02-2011 / 10:18:00 / cg"
4274
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2867
    "Modified (comment): / 05-12-2017 / 12:46:14 / cg"
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2868
!
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2869
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2870
knownTagsAndRevisionsForContainer:fileName directory:packageDir module:moduleDir
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2871
    "retrieve a list of (symbolic tags -> versionNr) associations.
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2872
     I.e. which tags/symbolic versions exist, and which revision-nr is attached to it"
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2873
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2874
    |log|
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2875
4288
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  2876
    log := self revisionLogOf:nil numberOfRevisions:1 fileName:fileName directory:packageDir module:moduleDir.
4274
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2877
    log isNil ifTrue:[
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2878
        SourceCodeManagerError 
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2879
            raiseRequestWith:fileName
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2880
            errorString: 'Could not fetch log (cvs connection error?)'.
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2881
        ^ #()
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2882
    ].
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2883
    ^ (log at:#symbolicNames ifAbsent:[ #() ]).
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2884
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2885
    "
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2886
     CVSSourceCodeManager knownTagsAndRevisionsForContainer:'Make.proto' directory:'libbasic' module:'stx'
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2887
    "
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2888
2b8ac98e311e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4254
diff changeset
  2889
    "Created: / 05-12-2017 / 01:16:09 / cg"
4288
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  2890
    "Modified: / 06-12-2017 / 11:47:02 / cg"
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2891
!
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2892
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2893
knownTagsFor:aClass
4529
c8d82fe47b03 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  2894
    "retrieve a colelction of symbolic tags known for that class.
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2895
     I.e. which tags/symbolic versions exist"
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2896
4523
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2897
    |tagRevisionMapping tagList|
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2898
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2899
    tagRevisionMapping := self knownTagsAndRevisionsFor:aClass.
4530
01ab92876f9f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4529
diff changeset
  2900
    tagRevisionMapping isEmptyOrNil ifTrue:[^ OrderedCollection new ].
4523
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2901
    "/ ^ tagRevisionMapping keys
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2902
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2903
    "/ sort by revision; within same revision, sort by tag name
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2904
    tagList := (((tagRevisionMapping associations 
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2905
                    sort:[:a :b | a key < b key "self versionString:(a value) isLessThan:(b value)"])
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2906
                        stableSort:[:a :b | self versionString:(a value) isLessThan:(b value)])
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2907
                            collect:[:assoc | assoc key]) reverse.
f07b5bcebde5 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4489
diff changeset
  2908
    ^ tagList
2320
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2909
82c54c399a28 added: #knownTagsAndRevisionsFor:
Claus Gittinger <cg@exept.de>
parents: 2319
diff changeset
  2910
    "Modified: / 08-02-2011 / 10:18:34 / cg"
2319
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2911
!
Claus Gittinger <cg@exept.de>
parents: 2259
diff changeset
  2912
4427
e90a39860df5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
  2913
newestRevisionInFile:classFileName directory:packageDirOrNil module:moduleDir
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2914
    "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
  2915
     Return nil on failure."
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2916
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2917
    |log|
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2918
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2919
    log := self
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2920
            revisionLogOf:nil 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2921
            fromRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2922
            toRevision:0 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2923
            fileName:classFileName 
4427
e90a39860df5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
  2924
            directory:packageDirOrNil 
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2925
            module:moduleDir.
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2926
460
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2927
    log isNil ifTrue:[^ nil].
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2928
    ^ 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
  2929
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2930
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2931
     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
  2932
    "
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2933
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  2934
    "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
  2935
!
06d089e12054 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
  2936
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2937
newestRevisionLogEntryOf:aClass
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2938
    "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
  2939
     Return nil on failure."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2940
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2941
    ^ 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
  2942
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2943
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2944
     SourceCodeManager newestRevisionLogEntryOf:Array       
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2945
     SourceCodeManager newestRevisionLogEntryOf:Connection 
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2946
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2947
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2948
    "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
  2949
    "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
  2950
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2951
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2952
newestRevisionOf:aClass
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2953
    "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
  2954
     Return nil on failure."
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2955
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  2956
    |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
  2957
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2958
    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
  2959
    sourceInfo isNil ifTrue:[^ nil].
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2960
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  2961
    packageDir := self directoryFromSourceInfo:sourceInfo.
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  2962
    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
  2963
    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
  2964
    classFileName := self containerFromSourceInfo:sourceInfo.
4173
1c37183b5c7b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  2965
    classFileName isNil ifTrue:[^ nil].
1c37183b5c7b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  2966
    
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2967
    ^ 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
  2968
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2969
"/    |log|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2970
"/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
  2971
"/    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
  2972
"/    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
  2973
"/    ^ log at:#newestRevision ifAbsent:nil
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2974
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2975
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2976
     SourceCodeManager newestRevisionOf:Array       
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2977
     SourceCodeManager newestRevisionOf:Connection 
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2978
    "
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2979
2485
ca0594d9c85c changed:
Claus Gittinger <cg@exept.de>
parents: 2477
diff changeset
  2980
    "Modified: / 20-08-2011 / 14:56:04 / cg"
207
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2981
!
9366df6c32ea added query for newestRevision string
Claus Gittinger <cg@exept.de>
parents: 194
diff changeset
  2982
4190
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2983
oldestRevisionLogEntryOf:aClass
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2984
    "return the oldest revisions log found in the repository.
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2985
     Return nil on failure.
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2986
     Can be used to determine the time of initial checkin or the original author"
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2987
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2988
    |log|
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2989
    
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2990
    log := self revisionLogOf:aClass.
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2991
    ^  (log at:#revisions) last.
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2992
    
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2993
    "
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2994
     SourceCodeManager oldestRevisionLogEntryOf:Array       
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2995
    "
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2996
!
cc690bca6a45 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  2997
4275
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2998
onlyBranchTagsFrom:tagsAndVersions
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  2999
    "retrieve a list of branch (symbolic tags -> versionNr) associations known for that class.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3000
     I.e. which tags/symbolic versions exist, and which revision-nr is attached to it"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3001
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3002
    tagsAndVersions isEmptyOrNil ifTrue:[ ^ #() ].
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3003
    tagsAndVersions keys copy do:[:k |
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3004
        (k startsWith:(self branchTagPrefix)) ifFalse:[
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3005
            tagsAndVersions removeKey:k.    
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3006
        ].
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3007
    ].
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3008
    ^ tagsAndVersions
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3009
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3010
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3011
     CVSSourceCodeManager knownBranchTagsAndRevisionsFor:Array
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3012
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3013
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3014
    "Created: / 05-12-2017 / 19:28:19 / cg"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3015
!
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3016
4195
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3017
printClassRepositorySummaryForClass:aClass on:aStream
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3018
    "returns summary info from the repository:
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3019
        current version,
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3020
        newest in repository,
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3021
        original checkin date (i.e. age),
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3022
        tags on the current version
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3023
        maybe more in the future
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3024
    "
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3025
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3026
    | log revisions youngestRev oldestRev|
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3027
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3028
    aClass isNil ifTrue:[^ ''].
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3029
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3030
    log := self revisionLogOf:aClass.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3031
    log isNil ifTrue:[
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3032
        aStream nextPutLine:('Could not get the repository log from %1' bindWith:(self repositoryName ? '<no repository name>')).
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3033
        ^ self.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3034
    ].   
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3035
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3036
    aStream nextPutAll:('Newest Revision: %1' bindWith:(log at:#newestRevision ifAbsent:'unknown')).
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3037
    revisions := log at:#revisions ifAbsent:nil.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3038
    revisions isNil ifTrue:[
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3039
        aStream cr.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3040
        aStream nextPutAll:('Could not retrieve the revision log').
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3041
        ^ self.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3042
    ].      
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3043
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3044
    youngestRev := revisions first.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3045
    oldestRev := revisions last.
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3046
    aStream nextPutLine:(' by %1 at %2' bindWith:(youngestRev author ? '?') with:(youngestRev timestamp)).
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3047
    aStream nextPutLine:('First Checkin: by %1 at %2' bindWith:(oldestRev author ? '?') with:(oldestRev timestamp)).
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3048
!
42095728a4e9 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4190
diff changeset
  3049
2683
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3050
removeContainer: container inModule: module directory: directory
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3051
    "remove a container"
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3052
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3053
    ^ self subclassResponsibility
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3054
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3055
    "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
  3056
!
fb2a7157540a added subclass reponsibility: #removeContainer:inModule:directory:
vrany
parents: 2668
diff changeset
  3057
4288
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3058
revisionForSymbolicName:tag class:cls fileName:classFileName directory:packageDir module:moduleDir
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3059
    "given a tag, return the corresponding revision"
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3060
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3061
    |partialLog symbolicNames|
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3062
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3063
    partialLog := self
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3064
        revisionLogOf:cls
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3065
        numberOfRevisions:1
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3066
        fileName:classFileName
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3067
        directory:packageDir 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3068
        module:moduleDir.
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3069
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3070
    partialLog notNil ifTrue:[
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3071
        symbolicNames := partialLog at:#symbolicNames ifAbsent:[].
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3072
        symbolicNames notNil ifTrue:[
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3073
            ^ symbolicNames at:tag ifAbsent:nil
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3074
        ].
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3075
    ].
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3076
    ^ nil.
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3077
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3078
    "
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3079
     CVSSourceCodeManager  
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3080
        revisionForSymbolicName:'stable' 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3081
        class:Array fileName:'Array.st' 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3082
        directory:'libbasic' module:'stx' 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3083
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3084
     CVSSourceCodeManager  
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3085
        revisionForSymbolicName:'stable' 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3086
        class:Array fileName:nil 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3087
        directory:'libbasic' module:'stx' 
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3088
    "
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3089
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3090
    "Created: / 06-12-2017 / 11:44:39 / cg"
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3091
!
abe0dbd3fb66 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  3092
2937
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3093
revisionForTag:tagName inClass:aClass
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3094
    "retrieve the revision number associated to a particular tag/symbolic version.
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3095
     Nil if unknown"
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3096
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3097
    |tagsAndVersions|
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3098
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3099
    tagsAndVersions := self knownTagsAndRevisionsFor:aClass.
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3100
    tagsAndVersions isEmptyOrNil ifTrue:[ ^ nil ].
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3101
    ^ tagsAndVersions at:tagName ifAbsent:nil.
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3102
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3103
    "
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3104
     SourceCodeManager revisionForTag:'stable' inClass:Array
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3105
    "
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3106
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3107
    "Created: / 08-02-2011 / 10:18:00 / cg"
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3108
!
227e7043831a added: #revisionForTag:inClass:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  3109
4275
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3110
revisionForTag:tagName inContainer:classFileName directory:packageDir module:moduleDir
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3111
    "retrieve the revision number associated to a particular tag/symbolic version.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3112
     Nil if unknown"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3113
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3114
    |tagsAndVersions|
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3115
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3116
    tagsAndVersions := self knownTagsAndRevisionsForContainer:classFileName directory:packageDir module:moduleDir.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3117
    tagsAndVersions isEmptyOrNil ifTrue:[ ^ nil ].
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3118
    ^ tagsAndVersions at:tagName ifAbsent:nil.
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3119
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3120
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3121
     SourceCodeManager revisionForTag:'stable' inClass:Array
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3122
     SourceCodeManager revisionForTag:'stable' inContainer:'Make.proto' directory:'libbasic' module:'stx'
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3123
    "
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3124
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3125
    "Created: / 05-12-2017 / 01:15:01 / cg"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3126
    "Modified (comment): / 05-12-2017 / 19:15:51 / cg"
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3127
!
12187d056ae6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4274
diff changeset
  3128
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3129
revisionInfoFromRCSString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3130
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3131
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3132
    "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
  3133
     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
  3134
4156
84650c654caf #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4133
diff changeset
  3135
    ^ CVSSourceCodeManager versionInfoClass fromRCSString:aString.
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3136
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3137
    "
968
7fa6a836642b comments
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  3138
     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
  3139
     SourceCodeManager revisionInfoFromString:(SourceCodeManager version)
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3140
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3141
2030
ed856e774120 versionInfo migrates from Dictionary to an object proper
Claus Gittinger <cg@exept.de>
parents: 1980
diff changeset
  3142
    "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
  3143
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3144
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3145
revisionInfoFromStandardVersionString:aString 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3146
    "{ Pragma: +optSpace }"
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3147
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3148
    "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
  3149
     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
  3150
     by standardRevisionStringFor:...."
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3151
3673
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3152
    |info path version user timeStamp|
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3153
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3154
    "/ '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
  3155
3673
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3156
    path := self extractKeyValueFor:'Path' fromRevisionString:aString.
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3157
    version := self extractKeyValueFor:'Version' fromRevisionString:aString.
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3158
    user := self extractKeyValueFor:'User' fromRevisionString:aString.
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3159
    timeStamp := self extractKeyValueFor:'Time' fromRevisionString:aString.
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3160
3661
ce825c324ef7 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3652
diff changeset
  3161
    info := self versionInfoClass new.
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3162
    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
  3163
    info revision:version.
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3164
    user notNil ifTrue:[ info user:user ].
3673
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3165
    timeStamp notNil ifTrue:[ info timeStamp:(Timestamp readFrom:timeStamp) ].
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3166
    ^ info
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3167
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3168
    "
3673
62cfdf4894c6 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
  3169
     self revisionInfoFromStandardVersionString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826' 
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3170
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3171
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3172
    "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
  3173
!
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3174
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3175
revisionInfoFromString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3176
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3177
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3178
    "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
  3179
     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
  3180
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3181
    ^ self subclassResponsibility
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3182
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3183
    "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
  3184
    "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
  3185
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3186
2552
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3187
revisionInfoFromString: vsnString inClass: class
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3188
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3189
    ^self revisionInfoFromString: vsnString
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3190
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3191
    "Modified: / 03-10-2011 / 13:05:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3192
!
a7095d9ae297 - more subclassReponsibilities to AbstractSourceCodeManager
vrany
parents: 2550
diff changeset
  3193
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3194
revisionLogOf:aClass
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3195
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3196
     the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3197
     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
  3198
     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
  3199
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3200
            #container          -> the container file name (for container-based SCMs)
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3201
            #filename           -> the actual source file name
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3202
            #newestRevision     -> the revisionString of the newest revision
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3203
            #numberOfRevisions  -> the number of revisions in the container
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3204
            #revisions          -> collection of per-revision info
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3205
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3206
            per revision info consists of one record per revision:
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3207
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3208
              #revision              -> the revision string
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3209
              #author                -> who checked that revision into the repository
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3210
              #date                  -> when was it checked in
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3211
              #state                 -> the RCS state
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3212
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3213
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3214
            revisions are ordered newest first 
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3215
            (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
  3216
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3217
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3218
    ^ self
1863
fcd1a38eaf7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1860
diff changeset
  3219
        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
  3220
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3221
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3222
     SourceCodeManager revisionLogOf:Array 
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3223
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3224
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3225
    "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
  3226
    "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
  3227
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3228
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3229
revisionLogOf:aClass fromRevision:rev1
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3230
    "return info about the repository container and
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3231
     (part of) the revisionlog as a collection of revision entries.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3232
     Return nil on failure.
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3233
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3234
     The returned information is a structure (IdentityDictionary)
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3235
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3236
            #container          -> the container file name (for container-based SCMs)
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3237
            #filename           -> the actual source file name
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3238
            #newestRevision     -> the revisionString of the newest revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3239
            #numberOfRevisions  -> the number of revisions in the container
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3240
            #revisions          -> collection of per-revision info (see below)
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3241
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3242
         for some classes, additional info is returned:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3243
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3244
            #renamed            -> true if the class has been renamed or copied
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3245
                                   and the sourceInfo is from the previous one
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3246
            #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
  3247
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3248
            rev1 specifies from which revisions a logEntry is wanted:
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3249
              If rev1 is nil, the first revision is the initial revision
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3250
              otherwise, the log starts with that revision.
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3251
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3252
            per revision info consists of one record per revision:
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3253
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3254
              #revision              -> the revision string
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3255
              #author                -> who checked that revision into the repository
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3256
              #date                  -> when was it checked in
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3257
              #state                 -> the RCS state
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3258
              #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
  3259
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3260
            revisions are ordered newest first 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3261
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3262
                  the first for the most recent one)
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3263
        "
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3264
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3265
    ^ self revisionLogOf:aClass fromRevision:rev1 toRevision:nil
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3266
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3267
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3268
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40'
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3269
    "
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3270
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3271
    "Created: 6.11.1995 / 18:56:00 / cg"
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3272
    "Modified: 10.1.1997 / 13:29:50 / cg"
110
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3273
!
05097d7fd93c another revisionLog method
Claus Gittinger <cg@exept.de>
parents: 109
diff changeset
  3274
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3275
revisionLogOf:aClass fromRevision:rev1 toRevision:rev2
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3276
    "return info about the repository container and
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3277
     (part of) the revisionlog as a collection of revision entries.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3278
     Return nil on failure.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3279
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3280
     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
  3281
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3282
            #container          -> the container file name (for container-based SCMs)
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3283
            #filename           -> the actual source file name
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3284
            #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
  3285
            #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
  3286
            #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
  3287
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3288
         for some classes, additional info is returned:
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3289
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3290
            #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
  3291
                                   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
  3292
            #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
  3293
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3294
            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
  3295
              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
  3296
              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
  3297
              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
  3298
              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
  3299
              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
  3300
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3301
            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
  3302
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3303
              #revision              -> the revision string
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3304
              #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
  3305
              #date                  -> when was it checked in
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3306
              #state                 -> the RCS state
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3307
              #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
  3308
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3309
            revisions are ordered newest first 
534
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3310
            (i.e. the last entry is for the initial revision; 
73fc19a1169e commentary; faster #newestRevisionOf
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
  3311
                  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
  3312
        "
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3313
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3314
    ^ self
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3315
        revisionLogOf:aClass fromRevision:rev1 toRevision:rev2 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3316
        finishAfter:nil
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3317
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3318
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3319
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
  3320
    "return info about the repository container and
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3321
     (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
  3322
     Return nil on failure.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3323
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3324
     The returned information is a structure (IdentityDictionary)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3325
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3326
            #container          -> the container file name (for container-based SCMs)
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3327
            #filename           -> the actual source file name
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3328
            #newestRevision     -> the revisionString of the newest revision
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3329
            #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
  3330
            #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
  3331
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3332
         for some classes, additional info is returned:
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3333
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3334
            #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
  3335
                                   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
  3336
            #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
  3337
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3338
            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
  3339
              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
  3340
              otherwise, the log starts with that revision.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3341
              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
  3342
              otherwise, the log ends with that revision.
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3343
              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
  3344
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3345
            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
  3346
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3347
              #revision              -> the revision string
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3348
              #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
  3349
              #date                  -> when was it checked in
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3350
              #state                 -> the RCS state
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3351
              #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
  3352
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3353
            revisions are ordered newest first 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3354
            (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
  3355
                  the first for the most recent one)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3356
        "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3357
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 493
diff changeset
  3358
    |sourceInfo packageDir moduleDir classFileName info|
95
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3359
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3360
    sourceInfo := self sourceInfoOfClass:aClass.
aeda58a2343c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 93
diff changeset
  3361
    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
  3362
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3363
    packageDir := self directoryFromSourceInfo:sourceInfo.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3364
    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
  3365
    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
  3366
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3367
    info := self 
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3368
        revisionLogOf:aClass
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3369
        fromRevision:rev1 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3370
        toRevision:rev2
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  3371
        numberOfRevisions:maxCountOrNil
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3372
        fileName:classFileName
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3373
        directory:packageDir 
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3374
        module:moduleDir.
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3375
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3376
    info notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3377
"/        (sourceInfo includesKey:#renamed) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3378
"/            info at:#renamed put:(sourceInfo at:#renamed)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3379
"/        ].
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3380
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  3381
            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
  3382
        ]
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3383
    ].
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  3384
    ^ info
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3385
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3386
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3387
     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
  3388
     SourceCodeManager revisionLogOf:XtBoxNew 
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3389
    "
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3390
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3391
    "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
  3392
    "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
  3393
!
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  3394
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3395
revisionLogOf:aClass numberOfRevisions:numRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3396
    "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
  3397
     (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
  3398
     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
  3399
     Return nil on failure.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3400
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3401
     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
  3402
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3403
            #container          -> the container file name (for container-based SCMs)
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3404
            #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
  3405
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1066
diff changeset
  3406
            #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
  3407
            #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
  3408
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3409
         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
  3410
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3411
            #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
  3412
                                   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
  3413
            #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
  3414
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3415
            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
  3416
              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
  3417
              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
  3418
              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
  3419
              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
  3420
              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
  3421
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3422
            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
  3423
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3424
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3425
              #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
  3426
              #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
  3427
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3428
              #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
  3429
              #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
  3430
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3431
            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
  3432
            (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
  3433
                  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
  3434
        "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3435
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3436
    |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
  3437
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3438
    sourceInfo := self sourceInfoOfClass:aClass.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3439
    sourceInfo isNil ifTrue:[^ nil].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3440
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3441
    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
  3442
    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
  3443
    classFileName := self containerFromSourceInfo:sourceInfo.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3444
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3445
    info := self 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3446
        revisionLogOf:aClass
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3447
        numberOfRevisions:numRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3448
        fileName:classFileName
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3449
        directory:packageDir 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3450
        module:moduleDir.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3451
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3452
    info notNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3453
"/        (sourceInfo includesKey:#renamed) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3454
"/            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
  3455
"/        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3456
        (sourceInfo includesKey:#expectedFileName) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3457
            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
  3458
        ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3459
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3460
    ^ info
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3461
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3462
    "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3463
     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
  3464
    "
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3465
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3466
    "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
  3467
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 928
diff changeset
  3468
4453
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3469
revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDirOrNil module:moduleDirOrNil
2600
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3470
    ^ self 
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3471
        revisionLogOf:clsOrNil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3472
        fromRevision:nil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3473
        toRevision:nil
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3474
        numberOfRevisions:numRevisions
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3475
        fileName:classFileName
4453
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3476
        directory:packageDirOrNil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3477
        module:moduleDirOrNil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3478
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3479
    "Modified (format): / 07-07-2019 / 23:17:22 / Claus Gittinger"
2600
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3480
!
893edc47b308 copy-pasted method pushed up to AbstractSourceCodeManager
vrany
parents: 2592
diff changeset
  3481
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3482
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
  3483
    "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
  3484
     (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
  3485
     Return nil on failure.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3486
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3487
     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
  3488
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3489
            #container          -> the container file name (for container-based SCMs)
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3490
            #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
  3491
            #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
  3492
            #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
  3493
            #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
  3494
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3495
            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
  3496
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3497
              #revision              -> the revision string
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3498
              #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
  3499
              #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
  3500
              #state                 -> the RCS state
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3501
              #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
  3502
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3503
            revisions are ordered newest first 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3504
            (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
  3505
                  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
  3506
        "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3507
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3508
    ^ self
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3509
        revisionLogOf:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3510
        fromRevision:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3511
        toRevision:nil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3512
        fileName:classFileName 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3513
        directory:packageDir 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3514
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3515
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3516
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3517
     CVSSourceCodeManager
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3518
        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
  3519
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3520
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3521
    "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
  3522
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3523
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3524
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
  3525
    "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
  3526
     (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
  3527
     Return nil on failure.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3528
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3529
     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
  3530
     filled with:
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3531
            #container          -> the container file name (for container-based SCMs)
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3532
            #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
  3533
            #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
  3534
            #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
  3535
            #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
  3536
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3537
         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
  3538
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3539
            #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
  3540
                                   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
  3541
            #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
  3542
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3543
            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
  3544
              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
  3545
              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
  3546
              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
  3547
              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
  3548
              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
  3549
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3550
            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
  3551
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3552
              #revision              -> the revision string
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3553
              #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
  3554
              #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
  3555
              #state                 -> the RCS state
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3556
              #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
  3557
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3558
            revisions are ordered newest first 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3559
            (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
  3560
                  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
  3561
        "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3562
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3563
    |info|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3564
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3565
    info := self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3566
        revisionLogOf:nil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3567
        fromRevision:rev1 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3568
        toRevision:rev2
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3569
        fileName:fileName
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3570
        directory:packageDir 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3571
        module:moduleDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3572
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3573
    ^ info
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3574
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3575
    "
1980
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3576
     SourceCodeManager 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3577
        revisionLogOfContainer:'Array.st' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3578
        module:'stx' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3579
        directory:'libbasic' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3580
        fromRevision:'1.1' 
a6bba4687325 comment
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3581
        toRevision:nil 
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3582
    "
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3583
1663
12a85dc6e7ef renamed *package* to *directory* to avoid confusion.
Claus Gittinger <cg@exept.de>
parents: 1594
diff changeset
  3584
    "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
  3585
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 919
diff changeset
  3586
4453
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3587
revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3588
    "return info about the repository container and
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3589
     (part of) the revisionlog as a collection of revision entries.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3590
     Return nil on failure.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3591
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3592
     The returned information is a structure (IdentityDictionary)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3593
     filled with:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3594
            #container          -> the container file name (for container-based SCMs)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3595
            #filename           -> the actual source file name
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3596
            #newestRevision     -> the revisionString of the newest revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3597
            #numberOfRevisions  -> the number of revisions in the container
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3598
            #revisions          -> collection of per-revision info (see below)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3599
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3600
         for some classes, additional info is returned:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3601
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3602
            #renamed            -> true if the class has been renamed or copied
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3603
                                   and the sourceInfo is from the previous one
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3604
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3605
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3606
            rev1 / rev2 specify from which revisions a logEntry is wanted:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3607
              If rev1 is nil, the first revision is the initial revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3608
              otherwise, the log starts with that revision.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3609
              If rev2 is nil, the last revision is the newest revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3610
              otherwise, the log ends with that revision.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3611
              If both are nil, no logEntries are extracted (i.e. only the header).
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3612
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3613
            per revision info consists of one record per revision:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3614
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3615
              #revision              -> the revision string
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3616
              #author                -> who checked that revision into the repository
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3617
              #date                  -> when was it checked in
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3618
              #state                 -> the RCS state
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3619
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3620
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3621
            revisions are ordered newest first 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3622
            (i.e. the last entry is for the initial revision; 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3623
                  the first for the most recent one)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3624
        "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3625
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3626
    ^ self
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3627
        revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3628
        finishAfter:nil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3629
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3630
    "Created: / 07-07-2019 / 23:27:36 / Claus Gittinger"
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3631
!
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3632
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3633
revisionLogOfFile:aFilename fromRevision:rev1 toRevision:rev2 finishAfter:maxCountOrNil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3634
    "return info about the repository container and
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3635
     (part of) the revisionlog as a collection of revision entries.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3636
     Return nil on failure.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3637
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3638
     The returned information is a structure (IdentityDictionary)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3639
     filled with:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3640
            #container          -> the container file name (for container-based SCMs)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3641
            #filename           -> the actual source file name
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3642
            #newestRevision     -> the revisionString of the newest revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3643
            #numberOfRevisions  -> the number of revisions in the container
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3644
            #revisions          -> collection of per-revision info (see below)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3645
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3646
         for some classes, additional info is returned:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3647
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3648
            #renamed            -> true if the class has been renamed or copied
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3649
                                   and the sourceInfo is from the previous one
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3650
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3651
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3652
            rev1 / rev2 specify from which revisions a logEntry is wanted:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3653
              If rev1 is nil, the first revision is the initial revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3654
              otherwise, the log starts with that revision.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3655
              If rev2 is nil, the last revision is the newest revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3656
              otherwise, the log ends with that revision.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3657
              If both are nil, no logEntries are extracted (i.e. only the header).
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3658
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3659
            per revision info consists of one record per revision:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3660
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3661
              #revision              -> the revision string
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3662
              #author                -> who checked that revision into the repository
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3663
              #date                  -> when was it checked in
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3664
              #state                 -> the RCS state
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3665
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3666
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3667
            revisions are ordered newest first 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3668
            (i.e. the last entry is for the initial revision; 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3669
                  the first for the most recent one)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3670
        "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3671
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3672
    |info|
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3673
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3674
    info := self 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3675
        revisionLogOf:nil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3676
        fromRevision:rev1 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3677
        toRevision:rev2
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3678
        numberOfRevisions:maxCountOrNil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3679
        fileName:aFilename
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3680
        directory:nil 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3681
        module:nil.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3682
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3683
    ^ info
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3684
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3685
    "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3686
     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' fromRevision:'1.40' toRevision:'1.43' 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3687
    "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3688
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3689
    "Created: / 07-07-2019 / 23:28:38 / Claus Gittinger"
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3690
!
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3691
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3692
revisionLogOfFile:aFilename numberOfRevisions:numRevisions
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3693
    "return info about the repository container and
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3694
     (part of) the revisionlog (numRevisions newest revisions) 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3695
     as a collection of revision entries.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3696
     Return nil on failure.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3697
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3698
     The returned information is a structure (IdentityDictionary)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3699
     filled with:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3700
            #container          -> the container file name (for container-based SCMs)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3701
            #filename           -> the actual source file name
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3702
            #newestRevision     -> the revisionString of the newest revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3703
            #numberOfRevisions  -> the number of revisions in the container (nil for all)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3704
            #revisions          -> collection of per-revision info (see below)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3705
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3706
         for some classes, additional info is returned:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3707
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3708
            #renamed            -> true if the class has been renamed or copied
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3709
                                   and the sourceInfo is from the previous one
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3710
            #expectedFileName   -> the filename we would expect (i.e. for the new class)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3711
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3712
            rev1 / rev2 specify from which revisions a logEntry is wanted:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3713
              If rev1 is nil, the first revision is the initial revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3714
              otherwise, the log starts with that revision.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3715
              If rev2 is nil, the last revision is the newest revision
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3716
              otherwise, the log ends with that revision.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3717
              If both are nil, no logEntries are extracted (i.e. only the header).
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3718
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3719
            per revision info consists of one record per revision:
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3720
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3721
              #revision              -> the revision string
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3722
              #author                -> who checked that revision into the repository
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3723
              #date                  -> when was it checked in
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3724
              #state                 -> the RCS state
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3725
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3726
              #logMessage            -> the checkIn log message
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3727
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3728
            revisions are ordered newest first 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3729
            (i.e. the last entry is for the initial revision; 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3730
                  the first for the most recent one)
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3731
        "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3732
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3733
    |info|
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3734
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3735
    info := self 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3736
        revisionLogOf:nil
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3737
        numberOfRevisions:numRevisions
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3738
        fileName:aFilename
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3739
        directory:nil 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3740
        module:nil.
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3741
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3742
    ^ info
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3743
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3744
    "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3745
     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' numberOfRevisions:10 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3746
     SourceCodeManager revisionLogOfFile:'../../libbasic/Array.st' numberOfRevisions:nil 
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3747
    "
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3748
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3749
    "Created: / 07-07-2019 / 23:15:44 / Claus Gittinger"
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3750
!
5e6ad8c5a97e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4449
diff changeset
  3751
3597
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3752
revisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3753
    "utility function: return a string usable as initial revision string.
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3754
     Can be redefined in subclasses"
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3755
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3756
    ^ self standardRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName revision:revisionString
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3757
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3758
    "
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3759
     self 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3760
        revisionStringFor:Array 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3761
        inModule:'stx' 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3762
        directory:'libbasic' 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3763
        container:'Array.st' 
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3764
        revision:'123'          
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3765
    "
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3766
!
f433e8d02208 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3595
diff changeset
  3767
213
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3768
revisionsOf:aClass
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3769
    "return a collection of revisions (as strings) found in the repository.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3770
     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
  3771
     Return nil on failure."
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3772
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3773
    |log revisions|
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3774
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3775
    log := self revisionLogOf:aClass.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3776
    log isNil ifTrue:[^ nil].
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3777
    revisions := log at:#revisions ifAbsent:nil.
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3778
    revisions isNil ifTrue:[^ nil].
4350
f1a7e2ceb439 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  3779
    ^ revisions collectColumn:#revision.
213
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3780
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3781
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3782
     SourceCodeManager revisionsOf:Array       
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3783
     SourceCodeManager newestRevisionOf:Array 
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3784
    "
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3785
4350
f1a7e2ceb439 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  3786
    "Modified: / 10-04-1996 / 23:14:24 / cg"
f1a7e2ceb439 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  3787
    "Created: / 19-04-1996 / 17:24:34 / cg"
f1a7e2ceb439 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
  3788
    "Modified: / 22-09-2018 / 11:20:34 / Claus Gittinger"
213
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3789
!
c6da419116bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 207
diff changeset
  3790
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3791
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
  3792
    "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
  3793
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3794
    ^ '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
  3795
        bindWith:moduleDir
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3796
        with:packageDir
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3797
        with:fileName
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3798
        with:revisionString
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3799
        with:(OperatingSystem getLoginName)
4316
147565855769 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4291
diff changeset
  3800
        with:(Timestamp now printStringIso8601)
2842
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3801
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3802
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3803
     self 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3804
        revisionStringFor:Array 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3805
        inModule:'stx' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3806
        directory:'libbasic' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3807
        container:'Array.st' 
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3808
        revision:'123'          
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3809
    "
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3810
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3811
    "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
  3812
!
e707972b6af6 comment/format in: #createContainerFor:inModule:package:container:
Claus Gittinger <cg@exept.de>
parents: 2838
diff changeset
  3813
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3814
withSourceRewriteHandlerDo:aBlock
2380
d17747baf9e9 comment/format in: #fileOutSourceCodeOf:on:withTimeStamp:withInitialize:withDefinition:methodFilter:
Claus Gittinger <cg@exept.de>
parents: 2350
diff changeset
  3815
    "hook for just-in-time rewriting of a method's sourceCode while filing out
3746
a1c99e6f50b4 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3710
diff changeset
  3816
     used when saving version_XXX methods in a non-XXX sourceCodeManager,
a1c99e6f50b4 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3710
diff changeset
  3817
     or when generating sourcecode for another Smalltalk system (VSE fileout)"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3818
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3819
    AbstractSourceFileWriter methodSourceRewriteQuery handle:[:rewriteQuery |
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3820
        |m newSource selector|
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3821
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3822
        m := rewriteQuery method.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3823
        m isVersionMethod ifFalse:[                                                            
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3824
            rewriteQuery proceedWith:rewriteQuery source.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3825
        ].
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3826
        selector := m selector.
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3827
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3828
        ((self isVersionMethodSelector:selector) "selector = self nameOfVersionMethodInClasses" 
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3829
        or:[(self isExtensionsVersionMethodSelector:selector) "selector = self nameOfVersionMethodForExtensions" 
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3830
        or:[selector = Class nameOfOldVersionMethod]]) ifTrue:[
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3831
            "/ it's my version method - make sure that it has $'s around...
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3832
            newSource := self ensureDollarsInVersionMethod:rewriteQuery source.
3249
ed05b7d7550d class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3234
diff changeset
  3833
            (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
  3834
                "/ #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
  3835
                "/ 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
  3836
                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
  3837
            ]
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3838
        ] ifFalse:[
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3839
            "/ it's another manager's version method - make sure that it has NONONO $'s around...
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3840
            newSource := self ensureNoDollarsInVersionMethod:rewriteQuery source.
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3841
        ].
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3842
        rewriteQuery proceedWith:newSource
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3843
    ] 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
  3844
a466b74c0db4 When rewriting #version method source, a keyword is also rewritten (CVS and SVN uses different keywords)
vrany
parents: 2510
diff changeset
  3845
    "Modified: / 27-09-2011 / 16:48:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2173
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3846
!
2d25644a5462 added:9 methods
fm
parents: 2145
diff changeset
  3847
3595
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3848
writeHistoryLogSince:timeGoal filterSTSources:filterSTSourcesBoolean 
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3849
        filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter 
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3850
        filterProjects:projectFilterArg to:aStream
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3851
    "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
  3852
     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
  3853
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3854
    |projectFilter goalString prevUser prevCvsRoot |
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3855
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3856
    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
  3857
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3858
    goalString := ''.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3859
    projectFilter notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3860
        projectFilter size == 1 ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3861
            goalString := goalString , 'of ',projectFilter first.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3862
        ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3863
            projectFilter size == 2 ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3864
                goalString := goalString , 'of ',projectFilter first,' and ',projectFilter second.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3865
            ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3866
                goalString := goalString , 'of ',projectFilter size printString,' projects'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3867
            ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3868
        ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3869
        goalString := goalString,' '
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3870
    ].
1447
2ac1cf09722b isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  3871
    (timeGoal notEmptyOrNil) ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3872
        goalString := goalString , 'since ' , timeGoal,' '.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3873
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3874
    userFilter notNil ifTrue:[
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3875
        userFilter isString ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3876
            goalString := 'by user ',userFilter
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3877
        ] ifFalse:[
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3878
            userFilter size == 1 ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3879
                goalString := 'by user ',(userFilter first) 
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3880
            ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3881
                goalString := 'by users ',(userFilter first),'...',(userFilter last) 
1220
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3882
            ]
dfe1088826b8 userFilter
Claus Gittinger <cg@exept.de>
parents: 1218
diff changeset
  3883
        ].
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3884
        goalString := goalString,' '.
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3885
    ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3886
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3887
    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
  3888
    aStream cr.
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3889
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3890
    self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3891
        reportHistoryLogSince:timeGoal 
2100
cdbd6a3ada7b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2082
diff changeset
  3892
        filterSTSources:filterSTSourcesBoolean 
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3893
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3894
        filterRepository:repositoryFilter 
1038
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3895
        filterModules:moduleFilter
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3896
        inTo:[:info |
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3897
            |user recordType fileName date time rev pkgDir 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3898
             module directory pkg
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3899
             clsName cvsRoot cls clsRev revInfo|
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3900
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3901
            pkgDir := info at:#directory ifAbsent:'?'.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3902
            module := pkgDir upTo:$/.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3903
            directory := pkgDir copyFrom:(module size+2).
1910
a260d4326328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  3904
            pkg := (PackageId module:module directory:directory) asString.
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3905
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3906
            (projectFilter isEmptyOrNil
3595
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3907
                or:[ projectFilter contains:[:pat | pat match:pkg caseSensitive:false] ]
507b779720f9 class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 3587
diff changeset
  3908
            ) ifTrue:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3909
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3910
                user := info at:#user ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3911
                recordType := info at:#cvsRecordType ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3912
                fileName := info at:#fileName ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3913
                date := info at:#date ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3914
                time := info at:#time ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3915
                rev := info at:#revision ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3916
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3917
                clsName := info at:#className ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3918
                cvsRoot := info at:#cvsRoot ifAbsent:'?'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3919
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3920
                cvsRoot ~= prevCvsRoot ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3921
                    aStream cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3922
                    aStream nextPutLine:'>>>> repository: ' , cvsRoot , ' <<<<'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3923
                    aStream cr; cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3924
                    aStream nextPutLine:'     Date    Time        User    Rev    File                           Package'.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3925
                    prevUser := nil.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3926
                    prevCvsRoot := cvsRoot.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3927
                ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3928
                prevUser ~= user ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3929
                    aStream cr.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3930
                    prevUser := user.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3931
                ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3932
                aStream 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3933
                    nextPutAll:recordType; space; 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3934
                    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
  3935
                    nextPutAll:(user leftPaddedTo:10); space;             
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3936
                    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
  3937
                    nextPutAll:(fileName paddedTo:30); space;                 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3938
                    nextPutAll:pkg.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3939
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3940
                "/
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3941
                "/ for your convenience:
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3942
                "/  check what the actual version is in the image
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3943
                "/
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3944
                clsName notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3945
                    revInfo := nil.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3946
                    cls := Smalltalk classNamed:clsName.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3947
                    (cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3948
                        rev ~= clsRev ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3949
                            revInfo := (' current: ' , clsRev)
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3950
                        ]
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3951
                    ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3952
                        cls isNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3953
                            revInfo := (' current: ** none **')
1480
c42afcba343a Fix "cvs history"
Stefan Vogel <sv@exept.de>
parents: 1467
diff changeset
  3954
                        ] ifFalse:[
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3955
                            cls isLoaded ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3956
                                revInfo := (' current: ** no revision info **')
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3957
                            ] ifFalse:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3958
                                revInfo := (' current: ** not loaded **')
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3959
                            ]    
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3960
                        ]
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3961
                    ].
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3962
                    revInfo notNil ifTrue:[
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3963
                        aStream nextPutAll:revInfo
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3964
                    ].
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3965
                ].
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3966
                aStream cr                              
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3967
            ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3968
        ].
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  3969
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3970
    "Created: / 12-09-2006 / 15:18:35 / cg"
1910
a260d4326328 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1893
diff changeset
  3971
    "Modified: / 18-11-2006 / 17:09:55 / cg"
1784
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3972
!
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3973
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3974
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
  3975
    "send a full historyLog to some stream.
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3976
     This walks over all possible repository roots."
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3977
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3978
    self
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3979
        writeHistoryLogSince:timeGoal 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3980
        filterSTSources:filter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3981
        filterUser:userFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3982
        filterRepository:repositoryFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3983
        filterModules:moduleFilter 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3984
        filterProjects:nil 
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3985
        to:aStream
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3986
7afd92336ac1 better repository history
Claus Gittinger <cg@exept.de>
parents: 1780
diff changeset
  3987
    "Modified: / 12-09-2006 / 15:19:11 / cg"
1038
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3988
!
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3989
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3990
writeHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter to:aStream
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3991
    "send a full historyLog to some stream.
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3992
     This walks over all possible repository roots."
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3993
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3994
    ^self
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3995
        writeHistoryLogSince:timeGoal 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3996
        filterSTSources:filter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3997
        filterUser:userFilter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3998
        filterRepository:repositoryFilter 
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  3999
        filterModules:nil to:aStream
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  4000
dc804a50da9b module filter in history
Claus Gittinger <cg@exept.de>
parents: 1036
diff changeset
  4001
    "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
  4002
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4003
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4004
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
  4005
    "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
  4006
     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
  4007
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4008
    ^ self
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4009
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4010
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4011
        filterUser:userFilter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4012
        filterRepository:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4013
        to:aStream
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4014
!
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4015
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4016
writeHistoryLogSince:timeGoal filterSTSources:filter to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  4017
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  4018
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4019
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4020
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4021
        filterSTSources:filter 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4022
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4023
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4024
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4025
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  4026
    "Modified: 12.9.1996 / 02:36:32 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4027
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4028
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4029
writeHistoryLogSince:timeGoal to:aStream
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  4030
    "send a repositories historyLog to some stream"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  4031
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4032
    ^ self 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4033
        writeHistoryLogSince:timeGoal 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4034
        filterSTSources:true 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4035
        filterUser:nil 
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4036
        filterRepository:nil
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4037
        to:aStream
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4038
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4039
    "Created: 13.12.1995 / 10:28:27 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 460
diff changeset
  4040
    "Modified: 12.9.1996 / 02:36:38 / cg"
147
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4041
!
f6cfa2afc00a history list added
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
  4042
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4043
writeRevisionLogMessagesFrom:log to:aStream
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4044
    "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
  4045
855
ba84e3e5572d made history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 853
diff changeset
  4046
    ^ 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
  4047
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4048
    "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
  4049
!
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4050
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4051
writeRevisionLogMessagesFrom:log withHeader:header to:aStream
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4052
    "helper; send the revisionlog to aStream"
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4053
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4054
    |tags|
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4055
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4056
    header ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  4057
"/        (log at:#renamed ifAbsent:false) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  4058
"/            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
  4059
"/            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
  4060
"/            aStream cr; cr.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  4061
"/        ].
138
386f2d831989 optional include header info in revision list
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4062
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  4063
        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
  4064
        aStream nextPutAll:'  Newest revision: '; nextPutLine:(log at:#newestRevision) printString.
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4065
        tags := log at:#symbolicNames ifAbsent:nil.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4066
        tags notNil ifTrue:[
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4067
            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
  4068
            aStream nextPutAll:'  Symbolic names: '; cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4069
            "sort tags by tag name"
4331
beb25a07aa96 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4323
diff changeset
  4070
            tags := tags associations sort:[:a :b| (a value compareAsVersionNumberWith:b value) > 0].
1451
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4071
            tags do:[:eachAssociation|
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4072
                aStream tab; nextPutAll:eachAssociation key; 
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4073
                             nextPutAll:': '; 
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4074
                             nextPutAll:eachAssociation value; cr.
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4075
            ]
561003a458bb Show tags in revisionLog
Stefan Vogel <sv@exept.de>
parents: 1447
diff changeset
  4076
        ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4077
    ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  4078
2821
687ec021401e changed: #writeRevisionLogMessagesFrom:withHeader:to:
Stefan Vogel <sv@exept.de>
parents: 2788
diff changeset
  4079
    (log at:#revisions ifAbsent:#()) do:[:entry |
4235
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4080
        |logMsg color firstLine|
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4081
127
7686a4413407 more protocol to create containers for new classes
Claus Gittinger <cg@exept.de>
parents: 123
diff changeset
  4082
        aStream cr.
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4083
        aStream nextPutAll:'  revision '; 
3899
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4084
            show:(entry at:#revision) allBold; tab.
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4085
        aStream nextPutAll:' date: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4086
            show:((entry at:#date ifAbsent:nil) ? '?'); space;
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4087
            show:((entry at:#time ifAbsent:nil) ? '?'); tab.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4088
        aStream nextPutAll:' author: '; 
3899
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4089
            show:((entry at:#author ifAbsent:nil) ? '?') allBold; tab.
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4090
        aStream nextPutAll:' lines: '; 
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4091
            show:(entry at:#numberOfChangedLines ifAbsent:nil) ? '?'; cr.
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4092
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4093
        logMsg := entry at:#logMessage ifAbsent:''.
3899
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4094
        color := Color orange.
1467
26f9edcb3542 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
  4095
        (logMsg isBlank or:[logMsg withoutSeparators = '.']) ifTrue:[
3899
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4096
            logMsg := '*** empty log message ***'.
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4097
            color := Color red.
4235
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4098
        ] ifFalse:[
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4099
            firstLine := (logMsg upTo:Character cr).
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4100
            ((firstLine startsWith:'#') not or:[ (firstLine startsWith:'#BUGFIX') ]) ifTrue:[
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4101
                color := Color red.
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4102
            ] ifFalse:[    
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4103
                (firstLine startsWith:'#DOCUMENTATION') ifTrue:[
4489
51c0365fa82b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4453
diff changeset
  4104
                    color := Color gray.
4235
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4105
                ].    
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4106
            ].    
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4107
        ].    
3899
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4108
        logMsg asCollectionOfLines do:[:eachLine |
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4109
            aStream tab.
4030
e0acccdb6a49 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4010
diff changeset
  4110
            aStream nextPutAllText:(eachLine withColor:color); cr.
3899
f9be7efffffc #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3888
diff changeset
  4111
        ].
93
83042eccb8d1 revisionLogOf... extracts the log manager dependent; writeRevisionLog is now here
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  4112
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4113
2668
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4114
    "Created: / 16-11-1995 / 13:25:30 / cg"
283d9824b191 refactoring
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  4115
    "Modified: / 27-11-1996 / 18:26:30 / stefan"
4235
f2c03ca931ff #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4219
diff changeset
  4116
    "Modified (format): / 16-05-2017 / 12:21:32 / cg"
4331
beb25a07aa96 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 4323
diff changeset
  4117
    "Modified: / 20-06-2018 / 11:08:34 / Stefan Vogel"
4424
bedbef64f6da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4420
diff changeset
  4118
    "Modified (comment): / 12-05-2019 / 13:01:29 / Claus Gittinger"
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4119
!
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4120
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4121
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 finishAfter:maxCount to:aStream
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4122
    "extract a classes log and append it to aStream."
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4123
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4124
    |log |
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4125
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4126
    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
  4127
    log isNil ifTrue:[
1024
7344e4e24b1c missing repository-log message beautified
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
  4128
        aStream cr; nextPutAll:'  ** No revision log available **'.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  4129
        ^ false
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  4130
    ].
96
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4131
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4132
    self writeRevisionLogMessagesFrom:log to:aStream.
326cccce2fe7 now also look at revisionInfo
Claus Gittinger <cg@exept.de>
parents: 95
diff changeset
  4133
    ^ true
73
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4134
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4135
    "
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  4136
     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
  4137
    "
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4138
90ab44bd6bff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 72
diff changeset
  4139
    "Created: 6.11.1995 / 18:56:00 / cg"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 537
diff changeset
  4140
    "Modified: 14.2.1997 / 21:11:57 / cg"
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  4141
!
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  4142
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4143
writeRevisionLogOf:aClass fromRevision:rev1 toRevision:rev2 to:aStream
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4144
    "extract a classes log and append it to aStream."
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4145
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4146
    ^ self
2052
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4147
        writeRevisionLogOf:aClass 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4148
        fromRevision:rev1 toRevision:rev2 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4149
        finishAfter:nil to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4150
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4151
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4152
     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
  4153
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4154
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4155
    "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
  4156
    "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
  4157
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4158
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4159
writeRevisionLogOf:aClass short:shortOrNot to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4160
    "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
  4161
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4162
    ^ self
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4163
        writeRevisionLogOf:aClass 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4164
        fromRevision:nil 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4165
        toRevision:nil 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4166
        finishAfter:(shortOrNot ifTrue:20 ifFalse:nil)
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4167
        to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4168
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4169
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4170
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4171
    "
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4172
!
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4173
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4174
writeRevisionLogOf:aClass to:aStream
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4175
    "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
  4176
61be9856344e +option to show a short revision log
Claus Gittinger <cg@exept.de>
parents: 2043
diff changeset
  4177
    ^ self writeRevisionLogOf:aClass short:false to:aStream
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  4178
87
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4179
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4180
     SourceCodeManager writeRevisionLogOf:Array to:Transcript 
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4181
    "
e0f5b58481a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 83
diff changeset
  4182
! !
77
4cc959f6b639 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 75
diff changeset
  4183
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4184
!AbstractSourceCodeManager class methodsFor:'source code utilities'!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4185
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4186
diffListFor:clsOrNil fileName:classFileName directory:packageDir module:moduleDir revision1:rev1 revision2:rev2
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4187
    "return diff info. This is supposed to return a standard diff-like
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4188
     list of lines, representing the diffs between two revisions.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4189
     experimental (for ownershipGraph)"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4190
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4191
    ^  self
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4192
        diffListFor:clsOrNil fileName:classFileName directory:packageDir module:moduleDir revision1:rev1 revision2:rev2 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4193
        cache:true
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4194
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4195
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4196
diffListFor:clsOrNil fileName:classFileNameArg directory:packageDirArg module:moduleDirArg revision1:rev1 revision2:rev2 cache:cacheIt
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4197
    "return diff info. This is supposed to return a standard diff-like
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4198
     list of lines, representing the diffs between two revisions.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4199
     experimental (for ownershipGraph).
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4200
     This fallback retrieves the two versions and calls a diff"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4201
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4202
    |fullName modulePath inStream list msg cacheDir cachedFile classFileName diffDir
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4203
     sourceStream1 sourceStream2 source1 source2 tmpSource1 tmpSource2
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4204
     moduleDir packageDir|
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4205
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4206
    moduleDir := moduleDirArg.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4207
    packageDir := packageDirArg.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4208
    
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4209
    clsOrNil notNil ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4210
        modulePath :=  clsOrNil package copyReplaceAll:$: with:$/.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4211
        moduleDir := clsOrNil package asPackageId module.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4212
        packageDir := clsOrNil package asPackageId directory.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4213
        fullName :=  modulePath , '/' , (classFileName := clsOrNil classFilename).
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4214
    ] ifFalse:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4215
        modulePath :=  moduleDir , '/' , packageDir. 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4216
        fullName :=  modulePath , '/' , (classFileName := classFileNameArg).
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4217
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4218
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4219
   (cacheIt) ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4220
        (cacheDir := self sourceCacheDirectory) isNil ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4221
            ('SourceCodeManager [warning]: no source cache directory') infoPrintCR.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4222
        ] ifFalse:[
4415
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  4223
            diffDir := cacheDir / modulePath / '.diffs'.
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4224
            diffDir exists ifFalse:[
4415
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  4225
                diffDir 
af25faef1fc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4399
diff changeset
  4226
                    recursiveMakeDirectoryForEachCreatedDo:[:dirName| dirName accessRights:cacheDir accessRights].
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4227
            ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4228
            cachedFile := diffDir / (classFileName,'_',rev1,'_',rev2).
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4229
            cachedFile exists ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4230
                ^ cachedFile contents
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4231
            ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4232
        ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4233
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4234
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4235
    msg := 'SourceCodeManager: Fetching diff list of '.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4236
    clsOrNil isNil ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4237
        msg := msg , fullName.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4238
    ] ifFalse:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4239
        msg := msg , clsOrNil name.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4240
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4241
    msg := msg , ' ' , rev1 , ' vs. ' , rev2.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4242
    self activityNotification:msg.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4243
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4244
    sourceStream1 := self 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4245
                        streamForClass:clsOrNil
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4246
                        fileName:classFileName 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4247
                        revision:rev1 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4248
                        directory:packageDir 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4249
                        module:moduleDir
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4250
                        cache:cacheIt.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4251
    source1 := sourceStream1 contents.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4252
    sourceStream1 close.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4253
    tmpSource1 := Filename newTemporary.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4254
    tmpSource1 contents:source1.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4255
    
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4256
    sourceStream2 := self 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4257
                        streamForClass:clsOrNil
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4258
                        fileName:classFileName 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4259
                        revision:rev2 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4260
                        directory:packageDir 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4261
                        module:moduleDir
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4262
                        cache:cacheIt.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4263
    source2 := sourceStream2 contents.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4264
    sourceStream2 close.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4265
    tmpSource2 := Filename newTemporary.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4266
    tmpSource2 contents:source2.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4267
    
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4268
    list := [
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4269
        inStream := PipeStream readingFrom:('diff %1 %2' bindWith:tmpSource1 pathName with:tmpSource1 pathName ). 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4270
        inStream isNil ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4271
            ('SourceCodeManager [error]: cannot open pipe to diff ', fullName) errorPrintCR.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4272
            ^ nil
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4273
        ].
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4274
        inStream contents.
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4275
    ] ensure:[
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4276
        inStream notNil ifTrue:[
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4277
            inStream close.
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4278
        ].
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4279
        tmpSource1 remove.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4280
        tmpSource2 remove.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4281
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4282
    list := list reject:[:line | line startsWith:'\ '].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4283
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4284
    cachedFile notNil ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4285
        cachedFile contents:list.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4286
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4287
    ^ list
4399
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4288
253988bc5ff2 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4398
diff changeset
  4289
    "Modified: / 12-02-2019 / 20:01:35 / Stefan Vogel"
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4290
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4291
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4292
ensureDollarsInVersionMethod:aString
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4293
    "given the source code of my version method, ensure that it contains dollars for
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4294
     proper keyword expansion"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4295
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4296
    |versionString|
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4297
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4298
    versionString := aString copyWithout: $§.
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4299
    ^ self ensureKeywordExpansionWith: $$ inVersionMethod:versionString.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4300
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4301
    "
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4302
     self ensureDollarsInVersionMethod:'foo ^ ''hello'' ' 
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4303
     self ensureDollarsInVersionMethod:'foo ^ ''§hello§'' ' 
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4304
     self ensureDollarsInVersionMethod:'foo ^ ''   hello   '' '    
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4305
     self ensureDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '      
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4306
     self ensureDollarsInVersionMethod:'foo ^ ''$Head'' '    
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4307
    -- errors:
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4308
     self ensureDollarsInVersionMethod:'foo ^ ''Header$'' '    
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4309
    "
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4310
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4311
    "Modified (comment): / 12-02-2019 / 00:03:45 / Claus Gittinger"
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4312
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4313
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4314
ensureKeyword: keyword inVersionMethod: source
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4315
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4316
    | startQuote endQuote doubleColon |
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4317
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4318
    "/nil keyword means that given source code management system
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4319
    "/does not expand keywords (StORE or Monticello, for example)
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4320
    keyword isNil ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4321
        ^source.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4322
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4323
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4324
    startQuote := source indexOf: $'.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4325
    startQuote == 0 ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4326
        self error:'Does not seem to be a valid version method source. Invalid source?'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4327
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4328
    (source at: startQuote + 1) == $$ ifFalse:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4329
        self error:'Does not seem to be a valid version method source. Invalid source?'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4330
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4331
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4332
    endQuote := source lastIndexOf: $'.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4333
    startQuote == endQuote ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4334
        self error:'Does not seem to be a valid version method source. Invalid source?'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4335
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4336
    (source at: endQuote - 1) == $$ ifFalse:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4337
        self error:'Does not seem to be a valid version method source. Invalid source?'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4338
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4339
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4340
    doubleColon := source indexOf: $: startingAt: startQuote + 2.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4341
    "/ There may be no double colon at all, if the version method
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4342
    "/ is fresh, like 'dollar-Header-dollar' (no real dollar here, as cvs expands the string)
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4343
    (doubleColon == 0 or:[doubleColon > endQuote]) ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4344
        doubleColon := endQuote - 1.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4345
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4346
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4347
    (source copyFrom: startQuote + 2 to: doubleColon - 1) = keyword ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4348
        "/ Good, desired keyword is already there
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4349
        ^source
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4350
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4351
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4352
    ^(source copyTo: startQuote + 1) , keyword , (source copyFrom: doubleColon)
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4353
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4354
    "Created: / 27-09-2011 / 15:00:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4355
    "Modified (comment): / 26-01-2012 / 14:52:19 / cg"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4356
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4357
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4358
ensureKeywordExpansionWith: aCharacter inVersionMethod:aString
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4359
    "given the source code of my version method, ensure that it contains aCharacter for
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4360
     proper keyword expansion"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4361
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4362
    |indexOfFirstQuote indexOfSecondQuote
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4363
     indexOfNextAfterFirstQuote indexOfSecondDollar indexOfNextAfterSecondDollar indexOfLastQuote|
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4364
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4365
    indexOfFirstQuote := aString indexOf:$'.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4366
    indexOfFirstQuote == 0 ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4367
        "/ no ' found - mhmh is this a valid version method's source ?
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4368
        ^ aString
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4369
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4370
    indexOfNextAfterFirstQuote := aString indexOfNonSeparatorStartingAt:indexOfFirstQuote+1.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4371
    (aString at:indexOfNextAfterFirstQuote) = aCharacter ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4372
        indexOfSecondDollar := aString indexOf:aCharacter startingAt:indexOfNextAfterFirstQuote+1.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4373
        ((indexOfSecondDollar == 0) 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4374
        or:[ indexOfNextAfterSecondDollar := aString indexOfNonSeparatorStartingAt:indexOfSecondDollar+1.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4375
             (aString at:indexOfNextAfterSecondDollar) ~= $' 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4376
        ]) ifTrue:[ 
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4377
            indexOfSecondQuote := aString indexOf:$' startingAt:indexOfFirstQuote+1.
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4378
            indexOfSecondQuote ~~ 0 ifTrue:[
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4379
                ^ (aString copyTo:indexOfSecondQuote-1),aCharacter asString,(aString copyFrom:indexOfSecondQuote)   
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4380
            ].
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4381
            self error:'invalid source (no valid version method string)' 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4382
        ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4383
        "/ fine
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4384
        ^ aString
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4385
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4386
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4387
    indexOfLastQuote := aString lastIndexOf:$'.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4388
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4389
    ^ (aString copyTo:indexOfFirstQuote)
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4390
        , aCharacter asString
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4391
        ,(aString copyFrom:indexOfFirstQuote+1 to:indexOfLastQuote-1)
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4392
        ,aCharacter asString ,(aString copyFrom:indexOfLastQuote)
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4393
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4394
    "
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4395
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''hello'' '  
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4396
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''   hello   '' '
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4397
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.218 2009/10/07 12:12:30 fm Exp §'' '    
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4398
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4399
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''hello'' '  
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4400
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''   hello   '' '
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4401
     self ensureKeywordExpansionWith: $$ inVersionMethod: 'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '    
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4402
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4403
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''§Head'' '  
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4404
     self ensureKeywordExpansionWith: $§ inVersionMethod: 'foo ^ ''Header§'' '   
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4405
    "
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4406
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4407
    "Modified: / 12-02-2019 / 00:12:06 / Claus Gittinger"
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4408
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4409
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4410
ensureKeywordInVersionMethod: source
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4411
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4412
    ^self ensureKeyword:(self versionMethodKeyword) inVersionMethod: source
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4413
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4414
    "Created: / 27-09-2011 / 14:50:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4398
7b8a930e2477 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4350
diff changeset
  4415
    "Modified (format): / 12-02-2019 / 00:04:07 / Claus Gittinger"
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4416
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4417
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4418
ensureNoDollarsInVersionMethod:aString
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4419
    "given the source code of another manager's version method, ensure that it does NOT
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4420
     contain dollars and add $§ instead, to avoid that CVS expands keywords in it"
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4421
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4422
    |versionString|
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4423
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4424
    versionString := aString copyWithout: $$.
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4425
    ^ self ensureKeywordExpansionWith: $§ inVersionMethod:versionString.
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4426
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4427
    "
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4428
        self ensureNoDollarsInVersionMethod:'foo ^ ''$','Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.228 2009/10/20 09:55:58 fm Exp $'' '           
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4429
        self ensureNoDollarsInVersionMethod:'foo ^ ''$','Head'' '                
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4430
        self ensureNoDollarsInVersionMethod:'foo ^ ''Header$'' '             
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4431
        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header§'' '    
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4432
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4433
      -- errors:
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4434
4449
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4435
        self ensureNoDollarsInVersionMethod:'foo ^ ''§Header'' '   
7e89557be9c5 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4434
diff changeset
  4436
        self ensureNoDollarsInVersionMethod:'foo ^ ''Header§'' '             
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4437
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4438
    "
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4439
!
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4440
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4441
extractKeyValueFor:key fromRevisionString:aString 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4442
    "{ Pragma: +optSpace }"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4443
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4444
    "extract a particular value from a string which has the format:
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4445
        key1: value1, key2: value2, .... keyN: valueN"
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4446
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4447
    |value idx1 idx2|
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4448
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4449
    "/ 'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4450
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4451
    idx1 := aString indexOfSubCollection:(key,': ').
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4452
    idx1 ~~ 0 ifTrue:[
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4453
        idx1 := idx1 + (key,': ') size.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4454
        idx2 := aString indexOfSubCollection:', ' startingAt:idx1.
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4455
        idx2 == 0 ifTrue:[ idx2 := aString size + 1 ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4456
        value := aString copyFrom:idx1 to:idx2-1.     
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4457
    ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4458
    ^ value
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4459
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4460
    "
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4461
     self 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4462
        extractKeyValueFor:'Path' 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4463
        fromRevisionString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4464
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4465
     self 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4466
        extractKeyValueFor:'Time' 
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4467
        fromRevisionString:'Path: stx/libbasic/Array.st, Version: 123, User: cg, Time: 2011-12-21T21:03:08.826'
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4468
    "
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4469
! !
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4470
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4471
!AbstractSourceCodeManager class methodsFor:'subclass responsibility'!
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4472
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4473
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter 
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4474
        filterRepository:repositoryFilter filterModules:moduleFilter inTo:aBlock
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4475
4420
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4476
    "process a full historyLog, evaluate aBlock for each entry, passing 
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4477
     each logs' info in a dictionary.
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4478
     This walks over all possible repositories.
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4479
     filterRep may be a collection of repository names (eg. 'stx', 'exept', 'phx' etc.) to only report changes made to one
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4480
     of those repositories.
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4481
     userFilter, if a non-nil string or stringCollection, 
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4482
     will filter only changes made by that user(s) (eg. 'sv' or #('sv' 'cg')).
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4483
     filterModules, if non-empty, will only present changes in that module (eg. 'stx:libbasic')"
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4484
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4485
    ^ self subclassResponsibility
4420
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4486
737b9f0a0022 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4415
diff changeset
  4487
    "Modified (comment): / 08-05-2019 / 10:22:30 / Claus Gittinger"
1205
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4488
! !
41ebb97c4ee6 Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1202
diff changeset
  4489
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4490
!AbstractSourceCodeManager class methodsFor:'testing'!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4491
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4492
isCVS
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4493
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4494
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4495
    "Created: / 16-08-2006 / 10:58:27 / cg"
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4496
!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4497
2786
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  4498
isGit
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  4499
    ^ false
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  4500
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  4501
    "Created: / 02-03-2012 / 16:44:02 / cg"
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  4502
!
31a32b5055f8 added: #isGit
Claus Gittinger <cg@exept.de>
parents: 2764
diff changeset
  4503
2725
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  4504
isMercurial
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  4505
    ^ false
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  4506
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  4507
    "Created: / 14-01-2012 / 21:54:19 / cg"
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  4508
!
b2d9b2aef9f8 added: #isMercurial
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  4509
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  4510
isSVN
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4511
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4512
2199
de36b3873c5b added:7 methods
Claus Gittinger <cg@exept.de>
parents: 2195
diff changeset
  4513
    "Created: / 16-08-2006 / 10:58:27 / cg"
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4514
!
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4515
1890
9a64ba9dcf37 changed #methodChange:
Claus Gittinger <cg@exept.de>
parents: 1889
diff changeset
  4516
isSmallTeam
1889
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  4517
    ^ false
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  4518
1890
9a64ba9dcf37 changed #methodChange:
Claus Gittinger <cg@exept.de>
parents: 1889
diff changeset
  4519
    "Created: / 09-11-2006 / 14:30:22 / cg"
1889
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  4520
!
d5c6cc3e51db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1888
diff changeset
  4521
1527
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4522
isStore
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4523
    ^ false
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4524
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4525
    "Created: / 16-08-2006 / 10:59:26 / cg"
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4526
! !
8e5b083fefca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  4527
2445
vrany
parents: 2443
diff changeset
  4528
!AbstractSourceCodeManager::PackageAndManager class methodsFor:'instance creation'!
vrany
parents: 2443
diff changeset
  4529
vrany
parents: 2443
diff changeset
  4530
package: package manager: manager
vrany
parents: 2443
diff changeset
  4531
vrany
parents: 2443
diff changeset
  4532
    ^self new
vrany
parents: 2443
diff changeset
  4533
        package: package;
vrany
parents: 2443
diff changeset
  4534
        manager: manager.
vrany
parents: 2443
diff changeset
  4535
vrany
parents: 2443
diff changeset
  4536
    "Created: / 09-07-2011 / 13:58:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  4537
! !
vrany
parents: 2443
diff changeset
  4538
vrany
parents: 2443
diff changeset
  4539
!AbstractSourceCodeManager::PackageAndManager methodsFor:'accessing'!
vrany
parents: 2443
diff changeset
  4540
vrany
parents: 2443
diff changeset
  4541
manager
vrany
parents: 2443
diff changeset
  4542
vrany
parents: 2443
diff changeset
  4543
    ^AbstractSourceCodeManager named: managerTypeName
vrany
parents: 2443
diff changeset
  4544
vrany
parents: 2443
diff changeset
  4545
    "Created: / 09-07-2011 / 13:52:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  4546
!
vrany
parents: 2443
diff changeset
  4547
vrany
parents: 2443
diff changeset
  4548
manager: aSourceCodeManager
vrany
parents: 2443
diff changeset
  4549
vrany
parents: 2443
diff changeset
  4550
    managerTypeName := aSourceCodeManager managerTypeName
vrany
parents: 2443
diff changeset
  4551
vrany
parents: 2443
diff changeset
  4552
    "Created: / 09-07-2011 / 13:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  4553
!
vrany
parents: 2443
diff changeset
  4554
vrany
parents: 2443
diff changeset
  4555
managerTypeName
vrany
parents: 2443
diff changeset
  4556
    ^ managerTypeName
vrany
parents: 2443
diff changeset
  4557
!
vrany
parents: 2443
diff changeset
  4558
vrany
parents: 2443
diff changeset
  4559
managerTypeName:something
vrany
parents: 2443
diff changeset
  4560
    managerTypeName := something.
vrany
parents: 2443
diff changeset
  4561
!
vrany
parents: 2443
diff changeset
  4562
vrany
parents: 2443
diff changeset
  4563
package
vrany
parents: 2443
diff changeset
  4564
    ^ package
vrany
parents: 2443
diff changeset
  4565
!
vrany
parents: 2443
diff changeset
  4566
vrany
parents: 2443
diff changeset
  4567
package:something
vrany
parents: 2443
diff changeset
  4568
    package := something.
vrany
parents: 2443
diff changeset
  4569
! !
vrany
parents: 2443
diff changeset
  4570
2477
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4571
!AbstractSourceCodeManager::PackageAndManager methodsFor:'comparing'!
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4572
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4573
= aPackageAndManagerOrNil
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4574
    aPackageAndManagerOrNil isNil ifTrue:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4575
    aPackageAndManagerOrNil package = package ifFalse:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4576
    aPackageAndManagerOrNil managerTypeName = managerTypeName ifFalse:[^ false].
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4577
    ^ true
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4578
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4579
    "Created: / 19-08-2011 / 01:47:34 / cg"
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4580
!
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4581
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4582
hash
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4583
    ^ package hash bitXor: managerTypeName hash
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4584
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4585
    "Created: / 19-08-2011 / 01:47:56 / cg"
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4586
! !
e9f6915b000e fix for hasChanged
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  4587
2445
vrany
parents: 2443
diff changeset
  4588
!AbstractSourceCodeManager::PackageAndManager methodsFor:'displaying'!
vrany
parents: 2443
diff changeset
  4589
vrany
parents: 2443
diff changeset
  4590
displayStringForManagerTypeName
vrany
parents: 2443
diff changeset
  4591
    ^ self manager isNil 
vrany
parents: 2443
diff changeset
  4592
        ifFalse:[ managerTypeName ]
vrany
parents: 2443
diff changeset
  4593
        ifTrue:
4489
51c0365fa82b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4453
diff changeset
  4594
            [ (managerTypeName , ' (unavailable)') allGray ].
2445
vrany
parents: 2443
diff changeset
  4595
vrany
parents: 2443
diff changeset
  4596
    "Created: / 09-07-2011 / 14:05:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2443
diff changeset
  4597
!
vrany
parents: 2443
diff changeset
  4598
vrany
parents: 2443
diff changeset
  4599
displayStringForPackage
vrany
parents: 2443
diff changeset
  4600
    ^ self manager isNil 
4489
51c0365fa82b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4453
diff changeset
  4601
        ifTrue:[ package allGray ]
2445
vrany
parents: 2443
diff changeset
  4602
        ifFalse:[ package ]
vrany
parents: 2443
diff changeset
  4603
vrany
parents: 2443
diff changeset
  4604
    "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
  4605
    "Modified: / 03-12-2011 / 11:31:49 / cg"
2445
vrany
parents: 2443
diff changeset
  4606
! !
vrany
parents: 2443
diff changeset
  4607
2623
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4608
!AbstractSourceCodeManager::PackageAndManager methodsFor:'printing & storing'!
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4609
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4610
printOn:aStream
4068
1d49703e6826 #OTHER by mawalch
mawalch
parents: 4056
diff changeset
  4611
    "append a printed representation of the receiver to the argument, aStream"
2623
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4612
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4613
    super printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4614
    aStream nextPut: $(.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4615
    package printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4616
    aStream nextPutAll:' -> '.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4617
    managerTypeName printOn:aStream.
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4618
    aStream nextPut: $).
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4619
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4620
    "Modified: / 25-11-2011 / 18:35:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4621
! !
4ba16827aa35 added AbstractSourceCodeManager::PackageAndManager>>printOn:
vrany
parents: 2606
diff changeset
  4622
2445
vrany
parents: 2443
diff changeset
  4623
!AbstractSourceCodeManager::PackageAndManager methodsFor:'queries'!
vrany
parents: 2443
diff changeset
  4624
vrany
parents: 2443
diff changeset
  4625
match: packageId
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4626
    | manager packageMatches|
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  4627
2445
vrany
parents: 2443
diff changeset
  4628
    manager := self manager.
2606
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  4629
    manager isNil ifTrue:[^false].
b29db794c880 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2603
diff changeset
  4630
4158
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4631
    packageMatches := package includesMatchCharacters
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4632
                        ifTrue:[ package match: packageId ]
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4633
                        ifFalse:[ packageId startsWith:(package,':') ].
9a50fdda2092 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4634
    ^ packageMatches and: [manager isResponsibleForPackage: packageId]
2445
vrany
parents: 2443
diff changeset
  4635
vrany
parents: 2443
diff changeset
  4636
    "
vrany
parents: 2443
diff changeset
  4637
     self managerForModule:'stx:libbasic' 
vrany
parents: 2443
diff changeset
  4638
     self managerForModule:'stx:libbasic2'
vrany
parents: 2443
diff changeset
  4639
     self managerForModule:'exept:expecco'  
vrany
parents: 2443
diff changeset
  4640
    "
vrany
parents: 2443
diff changeset
  4641
vrany
parents: 2443
diff changeset
  4642
    "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
  4643
    "Modified (format): / 18-11-2011 / 14:07:53 / cg"
2445
vrany
parents: 2443
diff changeset
  4644
! !
vrany
parents: 2443
diff changeset
  4645
513
10707a1c366f use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 507
diff changeset
  4646
!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
  4647
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4648
version
3888
202109d7ba22 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3815
diff changeset
  4649
    ^ '$Header$'
2851
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  4650
!
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  4651
3c62bf0dcacb added: #withClass:classFileName:filedOutToTemporaryFileDo:
Claus Gittinger <cg@exept.de>
parents: 2842
diff changeset
  4652
version_CVS
3888
202109d7ba22 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3815
diff changeset
  4653
    ^ '$Header$'
2529
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4654
!
302c2c58caa7 changed: #isVersionMethodSelector:
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4655
2838
31706d7a4429 some fixes
vrany
parents: 2827
diff changeset
  4656
version_SVN
3888
202109d7ba22 class: AbstractSourceCodeManager
Stefan Vogel <sv@exept.de>
parents: 3815
diff changeset
  4657
    ^ '$Id$'
123
9a1dff152656 dummy entries to check-for & create modules & directories
Claus Gittinger <cg@exept.de>
parents: 122
diff changeset
  4658
! !
1202
86cb235976ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1161
diff changeset
  4659
3131
d203000b91af class: AbstractSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
  4660
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
  4661
AbstractSourceCodeManager initialize!