author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 11 Jun 2013 00:55:03 +0100 | |
changeset 296 | f7824c40a07e |
parent 270 | fefcd7551c36 |
child 297 | 0f36d2c091e9 |
permissions | -rw-r--r-- |
210 | 1 |
" |
2 |
COPYRIGHT (c) 2012-2013 by Jan Vrany |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
12 |
"{ Package: 'stx:libscm/mercurial' }" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
13 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
14 |
SCMAbstractPackageModelRegistry subclass:#HGPackageModelRegistry |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
15 |
instanceVariableNames:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
16 |
classVariableNames:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
17 |
poolDictionaries:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
18 |
category:'SCM-Mercurial-StX' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
19 |
! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
20 |
|
210 | 21 |
!HGPackageModelRegistry class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2012-2013 by Jan Vrany |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! ! |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
36 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
37 |
!HGPackageModelRegistry methodsFor:'accessing'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
38 |
|
270
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
39 |
packageNamed0:package |
123
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
40 |
"Returns a HGPackageModel for given package or nil |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
41 |
if given package is not backed by Mercurial repository." |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
42 |
|
296
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
43 |
| dir components names namei directories root rootI rootD pkg| |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
44 |
|
123
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
45 |
packages at: package ifPresent: [ :p | ^ p ]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
46 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
47 |
components := OrderedCollection new. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
48 |
names := OrderedCollection new. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
49 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
50 |
(package includes: $:) ifFalse:[ |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
51 |
components := package. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
52 |
names := package. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
53 |
] ifTrue:[ |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
54 |
| i1 i2 | |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
55 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
56 |
i1 := 1. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
57 |
i2 := package indexOf: $:. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
58 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
59 |
components add: (package copyFrom: i1 to: i2 - 1). |
124
7802d185b2c3
HGPackageModelRegistry fixed (compiles now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
123
diff
changeset
|
60 |
names add: (package copyFrom: 1 to: i2 - 1). |
123
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
61 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
62 |
i1 := i2 + 1. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
63 |
[ (i2 := package indexOf: $/ startingAt: i1) ~~ 0 ] whileTrue:[ |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
64 |
components add: (package copyFrom: i1 to: i2 - 1). |
124
7802d185b2c3
HGPackageModelRegistry fixed (compiles now)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
123
diff
changeset
|
65 |
names add: (package copyFrom: 1 to: i2 - 1). |
123
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
66 |
i1 := i2 + 1. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
67 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
68 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
69 |
components add: (package copyFrom: i1 ). |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
70 |
names add: package |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
71 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
72 |
]. |
296
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
73 |
|
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
74 |
"Package might be sub-package which may not exists. Search for some |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
75 |
existing packagedir along package hierarchy" |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
76 |
namei := names size. |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
77 |
[ dir isNil and: [ namei > 0 ] ] whileTrue:[ |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
78 |
dir := Smalltalk getPackageDirectoryForPackage: (names at: namei). |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
79 |
dir notNil ifTrue:[ |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
80 |
namei + 1 to: names size do:[:i| |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
81 |
dir := dir / (components at: i). |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
82 |
]. |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
83 |
]. |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
84 |
namei := namei - 1. |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
85 |
]. |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
86 |
dir isNil ifTrue:[ ^ nil ]. |
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
87 |
|
123
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
88 |
directories := Array new: components size. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
89 |
directories at: components size put: dir. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
90 |
directories size - 1 downTo: 1 do:[:i| |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
91 |
directories at: i put: (directories at: i + 1) directory. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
92 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
93 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
94 |
"/ search cached packages... |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
95 |
1 to: names size do:[:i| |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
96 |
packages at: (names at:i) ifPresent:[:p|root := p. rootI := i]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
97 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
98 |
root isNil ifTrue:[ |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
99 |
directories withIndexDo:[:each :eachI| |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
100 |
( each / '.hg' ) exists ifTrue:[ |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
101 |
rootD := each. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
102 |
rootI := eachI. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
103 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
104 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
105 |
rootD isNil ifTrue:[ ^ nil ]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
106 |
root := HGPackageModel new |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
107 |
setName: (names at: rootI) |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
108 |
repository: (HGRepository on: rootD). |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
109 |
packages at: root name put: root. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
110 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
111 |
pkg := root. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
112 |
rootI + 1 to: components size do:[:each| |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
113 |
pkg := pkg construct: (components at:each). |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
114 |
packages at: pkg name put: pkg. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
115 |
]. |
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
116 |
|
ee1cc926f489
Added parent/child relationship to SCMAbstractPackageModel (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
117 |
^pkg |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
118 |
|
270
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
119 |
"Created: / 18-03-2013 / 22:26:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
296
f7824c40a07e
Bugfix for creating new subpackage inside existing package (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
270
diff
changeset
|
120 |
"Modified: / 11-06-2013 / 00:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
270
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
121 |
! |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
122 |
|
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
123 |
packageNamed:package |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
124 |
"Returns a HGPackageModel for given package or nil |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
125 |
if given package is not backed by Mercurial repository." |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
126 |
|
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
127 |
| pkg idx | |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
128 |
|
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
129 |
pkg := self packageNamed0: package. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
130 |
pkg notNil ifTrue:[ ^ pkg ]. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
131 |
idx := package lastIndexOf: $/. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
132 |
idx == 0 ifTrue:[ |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
133 |
idx := package lastIndexOf: $:. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
134 |
]. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
135 |
idx ~~ 0 ifTrue:[ |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
136 |
pkg := self packageNamed0: (package copyTo: idx - 1). |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
137 |
pkg notNil ifTrue:[ |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
138 |
pkg := pkg construct: (package copyFrom: idx + 1). |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
139 |
packages at: pkg name put: pkg. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
140 |
^pkg. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
141 |
] |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
142 |
]. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
143 |
^nil. |
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
144 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
145 |
"Created: / 14-11-2012 / 00:15:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
270
fefcd7551c36
Correctly set path within repository for subpackages even if the subpackage does not yet exists.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
218
diff
changeset
|
146 |
"Modified: / 18-03-2013 / 22:41:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
147 |
! ! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
148 |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
149 |
!HGPackageModelRegistry methodsFor:'initialization'! |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
150 |
|
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
151 |
flush: pattern |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
152 |
"Flushes all cached data packages matching given name." |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
153 |
| toFlush | |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
154 |
toFlush := OrderedCollection new. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
155 |
packages valuesDo:[:package| |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
156 |
(package name matches: pattern) ifTrue:[toFlush add: package]]. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
157 |
toFlush do:[:package| |
96
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
158 |
| wcdir | |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
159 |
repositories removeKey: package repository path ifAbsent:[nil]. |
218
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
160 |
wcdir := package temporaryWorkingCopyPath. |
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
161 |
wcdir exists ifTrue:[ |
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
162 |
[ wcdir recursiveRemove ] on: Error do:[ |
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
163 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
164 |
Delay waitForSeconds: 1. |
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
165 |
wcdir recursiveRemove. |
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
166 |
]. |
96
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
167 |
]. |
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
168 |
]. |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
169 |
packages removeKey: package name |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
170 |
]. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
171 |
|
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
172 |
"Created: / 16-11-2012 / 19:40:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
96
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
173 |
"Modified: / 22-11-2012 / 16:03:07 / jv" |
218
8d975bd9fe4f
Bugfix in HGPackageModelRegistry class>>flush: and pull command output parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
174 |
"Modified: / 05-02-2013 / 09:28:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
175 |
! ! |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
176 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
177 |
!HGPackageModelRegistry class methodsFor:'documentation'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
178 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
179 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
180 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
181 |
^ '$Changeset: <not expanded> $' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
182 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
183 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
184 |
version_SVN |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
185 |
^ '§Id:: §' |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
186 |
! ! |
210 | 187 |