author | Merge Script |
Tue, 09 Aug 2016 06:39:39 +0200 | |
branch | jv |
changeset 1179 | a3c51fbc33cf |
parent 834 | b40d7ef9ea17 |
permissions | -rw-r--r-- |
640 | 1 |
" |
2 |
Copyright (c) 2007-2010 Jan Vrany |
|
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any person |
|
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
25 |
" |
|
26 |
"{ Package: 'stx:libsvn' }" |
|
27 |
||
28 |
"{ NameSpace: SVN }" |
|
29 |
||
30 |
Object subclass:#ExternalMergeTool |
|
31 |
instanceVariableNames:'tempDir textA labelA textB labelB textC labelC textMerged' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
category:'SVN-Diff-External' |
|
35 |
! |
|
36 |
||
37 |
!ExternalMergeTool class methodsFor:'documentation'! |
|
38 |
||
39 |
copyright |
|
40 |
" |
|
41 |
Copyright (c) 2007-2010 Jan Vrany |
|
42 |
Copyright (c) 2009-2010 eXept Software AG |
|
43 |
||
44 |
Permission is hereby granted, free of charge, to any person |
|
45 |
obtaining a copy of this software and associated documentation |
|
46 |
files (the 'Software'), to deal in the Software without |
|
47 |
restriction, including without limitation the rights to use, |
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
49 |
copies of the Software, and to permit persons to whom the |
|
50 |
Software is furnished to do so, subject to the following |
|
51 |
conditions: |
|
52 |
||
53 |
The above copyright notice and this permission notice shall be |
|
54 |
included in all copies or substantial portions of the Software. |
|
55 |
||
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
63 |
OTHER DEALINGS IN THE SOFTWARE. |
|
64 |
||
65 |
" |
|
66 |
! ! |
|
67 |
||
834
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
68 |
!ExternalMergeTool class methodsFor:'others'! |
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
69 |
|
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
70 |
version_CVS |
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
71 |
^ '$Header$' |
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
72 |
! ! |
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
73 |
|
640 | 74 |
!ExternalMergeTool class methodsFor:'testing'! |
75 |
||
76 |
isAvailable |
|
77 |
"raise an error: must be redefined in concrete subclass(es)" |
|
78 |
||
79 |
^ self subclassResponsibility |
|
80 |
! ! |
|
81 |
||
82 |
!ExternalMergeTool methodsFor:'accessing'! |
|
83 |
||
84 |
labelA |
|
85 |
^ labelA ? 'A' |
|
86 |
! |
|
87 |
||
88 |
labelA:aString |
|
89 |
labelA := aString. |
|
90 |
! |
|
91 |
||
92 |
labelB |
|
93 |
^ labelB ? 'B' |
|
94 |
! |
|
95 |
||
96 |
labelB:aString |
|
97 |
labelB := aString. |
|
98 |
! |
|
99 |
||
100 |
labelC |
|
101 |
^ labelC ? 'C' |
|
102 |
! |
|
103 |
||
104 |
labelC:aString |
|
105 |
labelC := aString. |
|
106 |
! |
|
107 |
||
108 |
textA |
|
109 |
^ textA |
|
110 |
! |
|
111 |
||
112 |
textA:aString |
|
113 |
textA := aString. |
|
114 |
! |
|
115 |
||
116 |
textB |
|
117 |
^ textB |
|
118 |
! |
|
119 |
||
120 |
textB:aString |
|
121 |
textB := aString. |
|
122 |
! |
|
123 |
||
124 |
textC |
|
125 |
^ textC |
|
126 |
! |
|
127 |
||
128 |
textC:aString |
|
129 |
textC := aString. |
|
130 |
! |
|
131 |
||
132 |
textMerged |
|
133 |
^ textMerged |
|
134 |
! ! |
|
135 |
||
136 |
!ExternalMergeTool methodsFor:'merging'! |
|
137 |
||
138 |
merge |
|
139 |
||
140 |
tempDir := Filename newTemporaryDirectory. |
|
141 |
[self |
|
142 |
save: textA as: tempDir / 'a.txt'; |
|
143 |
save: textB as: tempDir / 'b.txt'; |
|
144 |
save: textC as: tempDir / 'c.txt'. |
|
145 |
||
146 |
self runExternalProgram. |
|
147 |
(tempDir / 'merged.txt') exists ifTrue: |
|
148 |
[textMerged := (tempDir / 'merged.txt') readStream contents asString]. |
|
149 |
] ensure: |
|
150 |
[tempDir recursiveRemove. |
|
151 |
tempDir := nil] |
|
152 |
! ! |
|
153 |
||
154 |
!ExternalMergeTool methodsFor:'private'! |
|
155 |
||
156 |
runExternalProgram |
|
157 |
||
158 |
self subclassResponsibility |
|
159 |
! |
|
160 |
||
161 |
save: aString as: aFilename |
|
162 |
||
163 |
| s | |
|
164 |
s := aFilename asFilename writeStream. |
|
165 |
[s nextPutAll: aString] |
|
166 |
ensure:[s close] |
|
167 |
! ! |
|
168 |
||
169 |
!ExternalMergeTool class methodsFor:'documentation'! |
|
170 |
||
171 |
version |
|
172 |
^ '$Header$' |
|
173 |
! |
|
174 |
||
175 |
version_SVN |
|
834
b40d7ef9ea17
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
640
diff
changeset
|
176 |
^ '§Id: SVN__ExternalMergeTool.st 363 2011-08-08 13:49:48Z vranyj1 §' |
640 | 177 |
! ! |