equal
deleted
inserted
replaced
34 " |
34 " |
35 ! ! |
35 ! ! |
36 |
36 |
37 !HGPackageModelRegistry methodsFor:'accessing'! |
37 !HGPackageModelRegistry methodsFor:'accessing'! |
38 |
38 |
39 packageNamed:package |
39 packageNamed0:package |
40 "Returns a HGPackageModel for given package or nil |
40 "Returns a HGPackageModel for given package or nil |
41 if given package is not backed by Mercurial repository." |
41 if given package is not backed by Mercurial repository." |
42 |
42 |
43 | dir components names directories root rootI rootD pkg| |
43 | dir components names directories root rootI rootD pkg| |
44 |
44 |
102 packages at: pkg name put: pkg. |
102 packages at: pkg name put: pkg. |
103 ]. |
103 ]. |
104 |
104 |
105 ^pkg |
105 ^pkg |
106 |
106 |
|
107 "Created: / 18-03-2013 / 22:26:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
108 ! |
|
109 |
|
110 packageNamed:package |
|
111 "Returns a HGPackageModel for given package or nil |
|
112 if given package is not backed by Mercurial repository." |
|
113 |
|
114 | pkg idx | |
|
115 |
|
116 pkg := self packageNamed0: package. |
|
117 pkg notNil ifTrue:[ ^ pkg ]. |
|
118 idx := package lastIndexOf: $/. |
|
119 idx == 0 ifTrue:[ |
|
120 idx := package lastIndexOf: $:. |
|
121 ]. |
|
122 idx ~~ 0 ifTrue:[ |
|
123 pkg := self packageNamed0: (package copyTo: idx - 1). |
|
124 pkg notNil ifTrue:[ |
|
125 pkg := pkg construct: (package copyFrom: idx + 1). |
|
126 packages at: pkg name put: pkg. |
|
127 ^pkg. |
|
128 ] |
|
129 ]. |
|
130 ^nil. |
|
131 |
107 "Created: / 14-11-2012 / 00:15:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
132 "Created: / 14-11-2012 / 00:15:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
108 "Modified: / 03-12-2012 / 14:27:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
133 "Modified: / 18-03-2013 / 22:41:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
109 ! ! |
134 ! ! |
110 |
135 |
111 !HGPackageModelRegistry methodsFor:'initialization'! |
136 !HGPackageModelRegistry methodsFor:'initialization'! |
112 |
137 |
113 flush: pattern |
138 flush: pattern |