author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 28 Nov 2012 09:12:38 +0000 | |
changeset 109 | 08c6eca6df25 |
parent 67 | 985488894699 |
child 115 | b1ed2d29054b |
permissions | -rw-r--r-- |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
1 |
"{ Package: 'stx:libscm/mercurial' }" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
2 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
3 |
SCMAbstractCommitDialog subclass:#HGCommitDialog |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
4 |
instanceVariableNames:'defaultLogo' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
5 |
classVariableNames:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
7 |
category:'SCM-Mercurial-StX-Interface' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
8 |
! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
9 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
10 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
11 |
!HGCommitDialog class methodsFor:'image specs'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
12 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
13 |
dialogIcon |
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
14 |
^ HGIconLibrary hgLogo2 |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
15 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
16 |
"Created: / 14-11-2012 / 00:14:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
17 |
"Modified: / 16-11-2012 / 11:01:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
18 |
! ! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
19 |
|
55 | 20 |
!HGCommitDialog class methodsFor:'interface specs'! |
21 |
||
22 |
fileListColumnSpec |
|
23 |
"This resource specification was automatically generated |
|
24 |
by the DataSetBuilder of ST/X." |
|
25 |
||
26 |
"Do not manually edit this!! If it is corrupted, |
|
27 |
the DataSetBuilder may not be able to read the specification." |
|
28 |
||
29 |
" |
|
30 |
DataSetBuilder new openOnClass:SVN::CommitDialog2 andSelector:#fileListColumnSpec |
|
31 |
" |
|
32 |
||
33 |
<resource: #tableColumns> |
|
34 |
||
35 |
^#( |
|
36 |
(DataSetColumnSpec |
|
37 |
label: '' |
|
38 |
activeHelpKey: '' |
|
39 |
activeHelpKeyForLabel: '' |
|
40 |
labelButtonType: None |
|
41 |
width: 22 |
|
42 |
minWidth: 22 |
|
43 |
editorType: CheckToggle |
|
44 |
rendererType: CheckToggle |
|
45 |
model: include |
|
46 |
menuFromApplication: false |
|
47 |
printSelector: include |
|
48 |
showRowSeparator: false |
|
49 |
showColSeparator: false |
|
50 |
) |
|
51 |
(DataSetColumnSpec |
|
52 |
label: '' |
|
53 |
activeHelpKey: '' |
|
54 |
activeHelpKeyForLabel: '' |
|
55 |
labelButtonType: Button |
|
56 |
width: 22 |
|
57 |
minWidth: 22 |
|
58 |
menuFromApplication: false |
|
59 |
printSelector: statusIcon |
|
60 |
canSelect: false |
|
61 |
showRowSeparator: false |
|
62 |
showColSeparator: false |
|
63 |
) |
|
64 |
(DataSetColumnSpec |
|
65 |
label: 'Container' |
|
66 |
labelAlignment: left |
|
67 |
activeHelpKey: '' |
|
68 |
activeHelpKeyForLabel: '' |
|
69 |
labelButtonType: Button |
|
70 |
menuFromApplication: false |
|
71 |
printSelector: pathText |
|
72 |
canSelect: false |
|
73 |
showRowSeparator: false |
|
74 |
showColSeparator: false |
|
75 |
) |
|
76 |
" |
|
77 |
(DataSetColumnSpec |
|
78 |
label: 'Rev' |
|
79 |
activeHelpKey: '' |
|
80 |
activeHelpKeyForLabel: '' |
|
81 |
labelButtonType: Button |
|
82 |
usePreferredWidth: true |
|
83 |
menuFromApplication: false |
|
84 |
printSelector: revision |
|
85 |
canSelect: false |
|
86 |
showRowSeparator: false |
|
87 |
showColSeparator: false |
|
88 |
) |
|
89 |
(DataSetColumnSpec |
|
90 |
label: 'Author' |
|
91 |
labelAlignment: left |
|
92 |
activeHelpKey: '' |
|
93 |
activeHelpKeyForLabel: '' |
|
94 |
labelButtonType: Button |
|
95 |
usePreferredWidth: true |
|
96 |
menuFromApplication: false |
|
97 |
printSelector: author |
|
98 |
canSelect: false |
|
99 |
showRowSeparator: false |
|
100 |
showColSeparator: false |
|
101 |
) |
|
102 |
(DataSetColumnSpec |
|
103 |
label: 'Date' |
|
104 |
activeHelpKey: '' |
|
105 |
activeHelpKeyForLabel: '' |
|
106 |
labelButtonType: Button |
|
107 |
usePreferredWidth: true |
|
108 |
menuFromApplication: false |
|
109 |
printSelector: date |
|
110 |
canSelect: false |
|
111 |
showRowSeparator: false |
|
112 |
showColSeparator: false |
|
113 |
) |
|
114 |
" |
|
115 |
) |
|
116 |
||
117 |
"Created: / 15-11-2012 / 09:28:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! ! |
|
119 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
120 |
!HGCommitDialog methodsFor:'change & update'! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
121 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
122 |
updateFileList |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
123 |
| wcroot statuses entries showOnlyModified wcrootPathNameRelative wcrootPathNameRelativeLen | |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
124 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
125 |
showOnlyModified := fileListShowOnlyModifiedHolder value. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
126 |
"HACK..." |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
127 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
128 |
wcroot := self model package root. |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
129 |
wcrootPathNameRelative := wcroot pathNameRelative. |
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
130 |
wcrootPathNameRelativeLen := wcrootPathNameRelative size. |
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
131 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
132 |
statuses := HGCommand status |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
133 |
workingDirectory: wcroot pathName; |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
134 |
execute. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
135 |
entries := OrderedCollection new: statuses size. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
136 |
statuses do:[:statusAndPath| |
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
137 |
(fileListShowOnlyModifiedHolder value not |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
138 |
or:[statusAndPath first isCleanOrIgnored not]) ifTrue:[ |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
139 |
| nm entry | |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
140 |
|
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
141 |
(statusAndPath second startsWith: wcrootPathNameRelative) ifTrue:[ |
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
142 |
nm := statusAndPath second. |
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
143 |
wcrootPathNameRelativeLen ~~ 0 ifTrue:[ |
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
144 |
nm := nm copyFrom:wcrootPathNameRelativeLen + 2. |
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
145 |
]. |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
146 |
entry := SCMAbstractCommitDialog::FileEntry application: self entry: wcroot / nm name: nm. |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
147 |
entries add: entry |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
148 |
]. |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
149 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
150 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
151 |
self fileListHolder value: entries |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
152 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
153 |
"Created: / 08-02-2012 / 18:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
154 |
"Modified: / 16-11-2012 / 11:27:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
155 |
! ! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
156 |
|
109
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
157 |
!HGCommitDialog methodsFor:'private'! |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
158 |
|
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
159 |
doUpdateWorkingCopy |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
160 |
| heads changeset | |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
161 |
|
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
162 |
super doUpdateWorkingCopy. |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
163 |
heads := self task package workingCopy heads. |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
164 |
changeset := self task package workingCopy changeset. |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
165 |
(heads includes: changeset) ifFalse:[ |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
166 |
self infoPanel |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
167 |
reset; |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
168 |
beInformation; |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
169 |
message: (self resources string:'Comitting a new head.'); |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
170 |
addButtonWithLabel: (self resources string:'Proceed') action: [self infoPanel hide]; |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
171 |
addButtonWithLabel: (self resources string:'Cancel') action:[self doCancel]; |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
172 |
show. |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
173 |
] |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
174 |
|
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
175 |
"Created: / 27-11-2012 / 23:36:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
176 |
! ! |
08c6eca6df25
Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
177 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
178 |
!HGCommitDialog class methodsFor:'documentation'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
179 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
180 |
version_HG |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
181 |
"Never, ever change this method. Ask JV or CG why" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
182 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
183 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
184 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
185 |
version_SVN |
55 | 186 |
^ '§Id:: §' |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
187 |
! ! |