author | Claus Gittinger <cg@exept.de> |
Wed, 01 Aug 2018 13:24:07 +0200 | |
branch | cvs_MAIN |
changeset 853 | 4e41a616ceca |
parent 642 | 807b812dfe43 |
permissions | -rw-r--r-- |
210 | 1 |
" |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
2 |
stx:libscm - a new source code management library for Smalltalk/X |
509
f92210d4585b
Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
442
diff
changeset
|
3 |
Copyright (C) 2012-2015 Jan Vrany |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
4 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
8 |
version 2.1 of the License. |
210 | 9 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
13 |
Lesser General Public License for more details. |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
14 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
210 | 18 |
" |
145 | 19 |
"{ Package: 'stx:libscm/mercurial' }" |
20 |
||
642 | 21 |
"{ NameSpace: Smalltalk }" |
22 |
||
145 | 23 |
HGRepositoryObject subclass:#HGConfig |
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
24 |
instanceVariableNames:'root timestamp' |
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
25 |
classVariableNames:'UserConfig' |
145 | 26 |
poolDictionaries:'' |
27 |
category:'SCM-Mercurial-Core' |
|
28 |
! |
|
29 |
||
30 |
Object subclass:#Entry |
|
31 |
instanceVariableNames:'name value' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
privateIn:HGConfig |
|
35 |
! |
|
36 |
||
37 |
Dictionary subclass:#Section |
|
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
38 |
instanceVariableNames:'name' |
145 | 39 |
classVariableNames:'' |
40 |
poolDictionaries:'' |
|
41 |
privateIn:HGConfig |
|
42 |
! |
|
43 |
||
210 | 44 |
!HGConfig class methodsFor:'documentation'! |
45 |
||
46 |
copyright |
|
47 |
" |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
48 |
stx:libscm - a new source code management library for Smalltalk/X |
509
f92210d4585b
Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
442
diff
changeset
|
49 |
Copyright (C) 2012-2015 Jan Vrany |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
50 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
51 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
52 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
53 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
54 |
version 2.1 of the License. |
210 | 55 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
56 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
57 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
58 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
59 |
Lesser General Public License for more details. |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
60 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
61 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
62 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
63 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
210 | 64 |
" |
65 |
! ! |
|
145 | 66 |
|
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
67 |
!HGConfig class methodsFor:'accessing'! |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
68 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
69 |
userConfig |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
70 |
UserConfig isNil ifTrue:[ |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
71 |
UserConfig := self new. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
72 |
]. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
73 |
^ UserConfig |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
74 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
75 |
" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
76 |
(HGConfig userConfig get:'ui') get:'username' |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
77 |
" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
78 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
79 |
"Created: / 18-02-2014 / 11:14:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
80 |
! ! |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
81 |
|
442
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
82 |
!HGConfig class methodsFor:'accessing-file templates'! |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
83 |
|
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
84 |
userConfigFileTemplate |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
85 |
^ |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
86 |
'[ui] |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
87 |
# At least, a username is required to commit. |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
88 |
username = FirstName LastName <Email> |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
89 |
' |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
90 |
! ! |
55aa4858b532
Fix: added lost HGConfig>>userConfigFileTemplate
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
375
diff
changeset
|
91 |
|
145 | 92 |
!HGConfig class methodsFor:'accessing-files'! |
93 |
||
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
94 |
userConfigFile |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
95 |
"Return user config file" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
96 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
97 |
| files | |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
98 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
99 |
files := self userConfigFiles. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
100 |
^ files detect:[:e | e asFilename exists ] ifNone:[ files first ]. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
101 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
102 |
"Created: / 18-02-2014 / 10:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
103 |
! |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
104 |
|
145 | 105 |
userConfigFiles |
106 |
"Return a list of per-user config files" |
|
107 |
||
108 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
109 |
^{ |
|
110 |
Filename homeDirectory / '.hgrc' . |
|
111 |
Filename homeDirectory / 'Mercurial.ini' |
|
112 |
} |
|
113 |
]. |
|
114 |
||
115 |
OperatingSystem isUNIXlike ifTrue:[ |
|
116 |
^{ |
|
117 |
Filename homeDirectory / '.hgrc' . |
|
118 |
} |
|
119 |
]. |
|
120 |
||
121 |
self error:'Unsupported operating system' |
|
122 |
||
123 |
"Created: / 06-12-2012 / 20:30:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
124 |
"Modified (format): / 06-12-2012 / 21:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
125 |
! ! |
|
126 |
||
127 |
!HGConfig methodsFor:'accessing'! |
|
128 |
||
129 |
at: key |
|
130 |
^self root at:key |
|
131 |
||
132 |
"Created: / 06-12-2012 / 20:22:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
133 |
! |
|
134 |
||
135 |
at: key ifAbsent: block |
|
136 |
^self root at:key ifAbsent: block |
|
137 |
||
138 |
"Created: / 06-12-2012 / 20:23:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
139 |
! |
|
140 |
||
141 |
at: key ifAbsentPut: block |
|
142 |
^self root at:key ifAbsentPut: block |
|
143 |
||
144 |
"Created: / 06-12-2012 / 20:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
145 |
! |
|
146 |
||
147 |
at: key put: val |
|
148 |
^self root at:key put: val |
|
149 |
||
150 |
"Created: / 06-12-2012 / 20:23:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
151 |
! |
|
152 |
||
153 |
get: key |
|
154 |
^self root get:key |
|
155 |
||
156 |
"Created: / 06-12-2012 / 20:22:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
157 |
! |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
158 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
159 |
get: key default: default |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
160 |
^self root get:key default: default |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
161 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
162 |
"Created: / 07-12-2012 / 15:46:07 / jv" |
145 | 163 |
! ! |
164 |
||
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
165 |
!HGConfig methodsFor:'accessing-common values'! |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
166 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
167 |
ui_username |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
168 |
^ self get:#(ui username) default: nil. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
169 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
170 |
" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
171 |
HGConfig userConfig ui_username |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
172 |
" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
173 |
|
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
174 |
"Created: / 18-02-2014 / 11:24:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
175 |
! ! |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
176 |
|
145 | 177 |
!HGConfig methodsFor:'private'! |
178 |
||
179 |
mustReload |
|
180 |
root isNil ifTrue:[ ^ true ]. |
|
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
181 |
|
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
182 |
repository notNil ifTrue:[ |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
183 |
(self mustReloadBecauseOf: repository path / '.hg' / 'hgrc') ifTrue:[ |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
184 |
^true |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
185 |
]. |
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
186 |
]. |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
187 |
HGConfig userConfigFiles do:[:e| |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
188 |
(self mustReloadBecauseOf: e) ifTrue:[ ^ true ]. |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
189 |
]. |
145 | 190 |
^false |
191 |
||
192 |
"Created: / 06-12-2012 / 21:38:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
193 |
"Modified: / 07-12-2012 / 16:28:33 / jv" |
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
194 |
"Modified: / 18-02-2014 / 11:20:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
195 |
! |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
196 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
197 |
mustReloadBecauseOf: filenameOrString |
150
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
198 |
"Return true, if config must be reloaded because file is newer" |
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
199 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
200 |
| filename | |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
201 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
202 |
filename := filenameOrString asFilename. |
150
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
203 |
"/compensate for lack of milliseconds in OS time ---v |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
204 |
^filename exists and:[(filename modificationTime + 1000) >= timestamp]. |
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
205 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
206 |
"Created: / 07-12-2012 / 16:26:38 / jv" |
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
207 |
"Modified: / 18-02-2014 / 12:33:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
145 | 208 |
! |
209 |
||
210 |
root |
|
211 |
self mustReload ifTrue:[ |
|
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
212 |
| command | |
150
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
213 |
timestamp := Timestamp now. |
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
214 |
command :=HGCommand showconfig. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
215 |
repository notNil ifTrue:[ |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
216 |
command workingDirectory: repository pathName. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
217 |
]. |
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
218 |
root := command execute. |
145 | 219 |
]. |
220 |
^root |
|
221 |
||
222 |
"Created: / 06-12-2012 / 20:25:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
223 |
"Modified: / 18-02-2014 / 11:16:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
145 | 224 |
! ! |
225 |
||
226 |
!HGConfig::Entry methodsFor:'accessing'! |
|
227 |
||
228 |
name |
|
229 |
^ name |
|
230 |
! |
|
231 |
||
232 |
value |
|
233 |
^ value |
|
234 |
! ! |
|
235 |
||
236 |
!HGConfig::Entry methodsFor:'initialization'! |
|
237 |
||
238 |
setName: nm value: val |
|
239 |
name := nm. |
|
240 |
value := val. |
|
241 |
||
242 |
"Created: / 06-12-2012 / 19:29:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
243 |
! ! |
|
244 |
||
245 |
!HGConfig::Entry methodsFor:'testing'! |
|
246 |
||
247 |
isEntry |
|
248 |
^true |
|
249 |
||
250 |
"Created: / 06-12-2012 / 19:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
251 |
! |
|
252 |
||
253 |
isSection |
|
254 |
^false |
|
255 |
||
256 |
"Created: / 06-12-2012 / 19:36:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
257 |
! ! |
|
258 |
||
259 |
!HGConfig::Section methodsFor:'accessing'! |
|
260 |
||
261 |
get: key |
|
262 |
||
263 |
| entry | |
|
264 |
||
265 |
entry := self. |
|
266 |
(key isCollection and:[key isString not]) ifTrue:[ |
|
267 |
key do:[:e|entry := entry at: e] |
|
268 |
] ifFalse:[ |
|
269 |
entry := entry at:key. |
|
270 |
]. |
|
271 |
^entry value |
|
272 |
||
273 |
"Created: / 06-12-2012 / 20:01:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
274 |
"Modified: / 06-12-2012 / 21:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
275 |
! |
|
276 |
||
277 |
get: key default: default |
|
278 |
| entry | |
|
279 |
||
280 |
entry := self. |
|
281 |
(key isCollection and:[key isString not]) ifTrue:[ |
|
282 |
key do:[:e|entry := entry at: e ifAbsent:[ ^ default ]] |
|
283 |
] ifFalse:[ |
|
284 |
entry := entry at:key ifAbsent:[ ^ default ]. |
|
285 |
]. |
|
286 |
^entry value |
|
287 |
||
288 |
"Created: / 06-12-2012 / 20:07:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
289 |
"Modified: / 06-12-2012 / 21:49:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
290 |
! |
|
291 |
||
292 |
name |
|
293 |
^ name |
|
294 |
! ! |
|
295 |
||
296 |
!HGConfig::Section methodsFor:'initialization'! |
|
297 |
||
298 |
setName: nm |
|
299 |
name := nm. |
|
300 |
||
301 |
"Created: / 06-12-2012 / 19:57:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
375
6ecd3ade39be
More sanity check in HG settings dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
302 |
"Modified: / 18-02-2014 / 12:31:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
145 | 303 |
! ! |
304 |
||
305 |
!HGConfig::Section methodsFor:'testing'! |
|
306 |
||
307 |
isEntry |
|
308 |
^false |
|
309 |
||
310 |
"Created: / 06-12-2012 / 19:36:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
311 |
! |
|
312 |
||
313 |
isSection |
|
314 |
^true |
|
315 |
||
316 |
"Created: / 06-12-2012 / 19:36:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
317 |
! ! |
|
318 |
||
319 |
!HGConfig class methodsFor:'documentation'! |
|
320 |
||
642 | 321 |
version |
322 |
^ '$Header$' |
|
323 |
! |
|
324 |
||
325 |
version_CVS |
|
326 |
^ '$Header$' |
|
327 |
! |
|
328 |
||
145 | 329 |
version_HG |
330 |
||
331 |
^ '$Changeset: <not expanded> $' |
|
332 |
! ! |
|
210 | 333 |