3 ' vbslib ver3.00 Sep.22, 2009
\r
4 ' Copyright (c) 2008-2009, T's-Neko at Sage Plaisir 21 (Japan)
\r
5 ' All rights reserved. Based on 3-clause BSD license.
\r
9 g_MergeLibPath = g_SrcPath
\r
15 '********************************************************************************
\r
16 ' <<< [RunMergePrompt] >>>
\r
17 '********************************************************************************
\r
18 Sub RunMergePrompt( Pathes, Opt )
\r
19 Dim status : Set status = new Merge_Status : ErrCheck
\r
20 Dim i, src_path, dst_path
\r
21 Dim base, ext, new_path
\r
23 If not exist( Opt.m_DiffPath ) Then Err.Raise 1,,"Diff
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ
\81F"+Opt.m_DiffPath
\r
24 If not exist( Opt.m_EditorPath ) Then Err.Raise 1,,"
\83G
\83f
\83B
\83^
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ
\81F"+Opt.m_EditorPath
\r
25 For i=0 To UBound( Pathes )
\r
26 If IsEmpty( Pathes(i) ) Then Err.Raise 1,,"Pathes("&i&")
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82Ü
\82¹
\82ñ
\81B"
\r
27 If not exist( Pathes(i) ) Then Err.Raise 1,,"Pathes("&i&") = " + Pathes(i) + "
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ
\81B"
\r
30 base = g_fs.GetBaseName( Pathes(0) )
\r
31 ext = g_fs.GetExtensionName( Pathes(0) )
\r
32 If IsEmpty( Opt.m_NewPath ) Then new_path = "New\" + base + "." + ext _
\r
33 Else new_path = Opt.m_NewPath
\r
38 If UBound( Pathes ) = 0 Then
\r
41 If exist( new_path ) Then
\r
43 echo "-------------------------------------------"
\r
44 echo base + "." + ext + "
\82Ì
\83R
\83s
\81[
\82Í
\8a®
\97¹
\82µ
\82Ü
\82µ
\82½
\81B"
\r
45 echo "5.
\83R
\83s
\81[
\8dÏ
\82Ý
\82ð
\8aJ
\82"
\r
46 echo "6.
\83R
\83s
\81[
\8dÏ
\82Ý
\83t
\83H
\83\8b\83_
\82ð
\8aJ
\82"
\r
47 echo "8.
\91O
\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
49 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
50 echo "-------------------------------------------"
\r
51 If i = 9 Then Exit Sub
\r
53 i = input( "
\91O
\83X
\83e
\83b
\83v
\82É
\96ß
\82é
\82½
\82ß
\81A" + new_path + "
\82ð
\8dí
\8f\9c\82µ
\82Ü
\82·
\81B[Y/N]" )
\r
54 If i = "y" or i = "Y" Then del new_path : Exit Do
\r
56 If i = 5 Then OpenMergePath Opt.m_EditorPath, new_path
\r
57 If i = 6 Then OpenMergePath Opt.m_EditorPath, g_fs.GetParentFolderName( new_path )
\r
60 sub_pathes(0) = Pathes(0)
\r
61 status.m_EditingNum = -1
\r
62 status.m_StepIDFilePath = Empty
\r
63 RunMergePromptSub sub_pathes, status, Opt
\r
64 If status.m_bExit Then Exit Sub
\r
65 If status.m_CopyNum = 1 Then
\r
66 src_path = Pathes(0) : dst_path = new_path
\r
67 echo "copy """ + src_path + """, """ + dst_path + """"
\r
68 copy src_path, dst_path
\r
74 ElseIf UBound( Pathes ) = 1 Then
\r
76 status.m_CurrentStep = 1
\r
77 status.m_LastStep = 1
\r
81 '//== 2 files Step A
\r
82 If not exist( new_path ) and _
\r
83 not exist( "Editing\" + base + "(1)M." + ext ) Then
\r
85 sub_pathes(0) = Pathes(0)
\r
86 sub_pathes(1) = Pathes(1)
\r
87 status.m_EditingNum = 0
\r
88 status.m_StepIDFilePath = Empty
\r
91 RunMergePromptSub sub_pathes, status, Opt
\r
92 If status.m_bExit Then Exit Sub
\r
95 Select Case status.m_CopyNum
\r
97 src_path = Pathes(0) : dst_path = "Editing\" + base + "(1)M." + ext
\r
98 echo "copy """ + src_path + """, """ + dst_path + """"
\r
99 copy src_path, dst_path
\r
101 src_path = Pathes(1) : dst_path = "Editing\" + base + "(1)M." + ext
\r
102 echo "copy """ + src_path + """, """ + dst_path + """"
\r
103 copy src_path, dst_path
\r
107 '//== 2 files Step B
\r
108 ElseIf not exist( new_path ) Then
\r
109 Redim sub_pathes(2)
\r
110 sub_pathes(0) = Pathes(0)
\r
111 sub_pathes(1) = "Editing\" + base + "(1)M." + ext
\r
112 sub_pathes(2) = Pathes(1)
\r
113 status.m_EditingNum = 2
\r
114 status.m_StepIDFilePath = sub_pathes(1)
\r
117 RunMergePromptSub sub_pathes, status, Opt
\r
118 If status.m_bExit Then Exit Sub
\r
121 If exist( sub_pathes(1) ) Then
\r
122 src_path = sub_pathes(1) : dst_path = new_path
\r
123 echo "copy """ + src_path + """, """ + dst_path + """"
\r
124 copy src_path, dst_path
\r
129 '//== 2 files complated
\r
132 echo "-------------------------------------------"
\r
133 echo base + "." + ext + "
\82Ì
\83}
\81[
\83W
\82Í
\8a®
\97¹
\82µ
\82Ü
\82µ
\82½
\81B"
\r
134 echo "5.
\83}
\81[
\83W
\8dÏ
\82Ý
\82ð
\8aJ
\82"
\r
135 echo "6.
\83}
\81[
\83W
\8dÏ
\82Ý
\83t
\83H
\83\8b\83_
\82ð
\8aJ
\82"
\r
136 If not IsEmpty( Opt.m_SyncPathes ) Then _
\r
137 echo "7.
\93¯
\82¶
\96¼
\91O
\82Ì
\83t
\83@
\83C
\83\8b\82ð
\82·
\82×
\82Ä
\83}
\81[
\83W
\8dÏ
\82Ý
\82É
\8dX
\90V
\82·
\82é"
\r
138 echo "8.
\91O
\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
140 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
141 echo "-------------------------------------------"
\r
142 If i = 9 Then Exit Sub
\r
144 i = input( "
\91O
\83X
\83e
\83b
\83v
\82É
\96ß
\82é
\82½
\82ß
\81A" + new_path + "
\82ð
\8dí
\8f\9c\82µ
\82Ü
\82·
\81B[Y/N]" )
\r
145 If i = "y" or i = "Y" Then del new_path : Exit Do
\r
147 If i = 5 Then OpenMergePath Opt.m_EditorPath, new_path
\r
148 If i = 6 Then OpenMergePath Opt.m_EditorPath, g_fs.GetParentFolderName( new_path )
\r
149 If i = 7 and (not IsEmpty(Opt.m_SyncPathes)) Then RunMergeUpdate new_path, Pathes, Opt
\r
158 status.m_LastStep = UBound( Pathes ) - 1
\r
161 '//== N files merged
\r
162 If exist( new_path ) Then
\r
164 echo "-------------------------------------------"
\r
165 echo base + "." + ext + "
\82Ì
\83}
\81[
\83W
\82Í
\8a®
\97¹
\82µ
\82Ü
\82µ
\82½
\81B"
\r
166 echo "5.
\83}
\81[
\83W
\8dÏ
\82Ý
\82ð
\8aJ
\82"
\r
167 echo "6.
\83}
\81[
\83W
\8dÏ
\82Ý
\83t
\83H
\83\8b\83_
\82ð
\8aJ
\82"
\r
168 If not IsEmpty( Opt.m_SyncPathes ) Then _
\r
169 echo "7.
\82·
\82×
\82Ä
\82Ì
\83t
\83@
\83C
\83\8b\82ð
\83}
\81[
\83W
\8dÏ
\82Ý
\82É
\8dX
\90V
\82·
\82é"
\r
170 echo "8.
\91O
\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
172 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
173 echo "-------------------------------------------"
\r
174 If i = 9 Then Exit Sub
\r
176 i = input( "
\91O
\83X
\83e
\83b
\83v
\82É
\96ß
\82é
\82½
\82ß
\81A" + new_path + "
\82ð
\8dí
\8f\9c\82µ
\82Ü
\82·
\81B[Y/N]" )
\r
177 If i = "y" or i = "Y" Then del new_path : Exit Do
\r
179 If i = 5 Then OpenMergePath Opt.m_EditorPath, new_path
\r
180 If i = 6 Then OpenMergePath Opt.m_EditorPath, g_fs.GetParentFolderName( new_path )
\r
181 If i = 7 and (not IsEmpty(Opt.m_SyncPathes)) Then RunMergeUpdate new_path, Pathes, Opt
\r
187 '//== Count step by counting file exists
\r
188 status.m_StepIDFilePath = Empty
\r
189 status.m_EditingNum = 0
\r
190 For i = UBound( Pathes ) To 1 Step -1
\r
191 If exist( "Editing\" + base + "(" & i & ")L." + ext ) Then
\r
192 status.m_StepIDFilePath = "Editing\" + base + "(" & i & ")L." + ext
\r
193 status.m_EditingNum = 1 : Exit For
\r
194 ElseIf exist( "Editing\" + base + "(" & i & ")M." + ext ) Then
\r
195 status.m_StepIDFilePath = "Editing\" + base + "(" & i & ")M." + ext
\r
196 status.m_EditingNum = 2 : Exit For
\r
197 ElseIf exist( "Editing\" + base + "(" & i & ")R." + ext ) Then
\r
198 status.m_StepIDFilePath = "Editing\" + base + "(" & i & ")R." + ext
\r
199 status.m_EditingNum = 3 : Exit For
\r
200 ElseIf exist( "Editing\" + base + "(" & i & ")." + ext ) Then
\r
201 status.m_StepIDFilePath = "Editing\" + base + "(" & i & ")." + ext
\r
202 status.m_EditingNum = 0 : Exit For
\r
205 If i = 0 Then status.m_CurrentStep = 1 _
\r
206 Else status.m_CurrentStep = i
\r
209 '//== N files Step A
\r
210 Redim sub_pathes(2)
\r
211 If status.m_EditingNum = 0 Then
\r
212 If status.m_CurrentStep = 1 Then
\r
213 sub_pathes(0) = Pathes(1)
\r
214 sub_pathes(1) = Pathes(0)
\r
215 sub_pathes(2) = Pathes(2)
\r
217 sub_pathes(0) = "Editing\" + base + _
\r
218 "(" & status.m_CurrentStep & ")." + ext
\r
219 sub_pathes(1) = Pathes(0)
\r
220 sub_pathes(2) = Pathes( status.m_CurrentStep + 1 )
\r
224 RunMergePromptSub sub_pathes, status, Opt
\r
225 If status.m_bExit Then Exit Sub
\r
228 Select Case status.m_CopyNum
\r
230 src_path = sub_pathes(0) : dst_path = "Editing\" + base + "(" & status.m_CurrentStep & ")L." + ext
\r
231 echo "copy """ + src_path + """, """ + dst_path + """"
\r
232 copy src_path, dst_path
\r
234 src_path = sub_pathes(1) : dst_path = "Editing\" + base + "(" & status.m_CurrentStep & ")M." + ext
\r
235 echo "copy """ + src_path + """, """ + dst_path + """"
\r
236 copy src_path, dst_path
\r
238 src_path = sub_pathes(2) : dst_path = "Editing\" + base + "(" & status.m_CurrentStep & ")R." + ext
\r
239 echo "copy """ + src_path + """, """ + dst_path + """"
\r
240 copy src_path, dst_path
\r
244 '//== N files Step B
\r
246 If status.m_EditingNum = 1 Then
\r
247 sub_pathes(0) = "Editing\" + base + "(" & status.m_CurrentStep & ")L." + ext
\r
248 ElseIf status.m_CurrentStep = 1 Then
\r
249 sub_pathes(0) = Pathes(1)
\r
251 sub_pathes(0) = "Editing\" + base + "(" & status.m_CurrentStep & ")." + ext
\r
253 If status.m_EditingNum = 2 Then
\r
254 sub_pathes(1) = "Editing\" + base + "(" & status.m_CurrentStep & ")M." + ext
\r
256 sub_pathes(1) = Pathes(0)
\r
258 If status.m_EditingNum = 3 Then
\r
259 sub_pathes(2) = "Editing\" + base + "(" & status.m_CurrentStep & ")R." + ext
\r
261 sub_pathes(2) = Pathes( status.m_CurrentStep + 1 )
\r
265 RunMergePromptSub sub_pathes, status, Opt
\r
266 If status.m_bExit Then Exit Sub
\r
269 If status.m_CopyNum <> 0 Then
\r
270 If status.m_CurrentStep = status.m_LastStep Then
\r
271 Select Case status.m_EditingNum
\r
273 src_path = "Editing\" + base + "(" & status.m_CurrentStep & ")L." + ext : dst_path = new_path
\r
274 echo "copy """ + src_path + """, """ + dst_path + """"
\r
275 copy src_path, dst_path
\r
277 src_path = "Editing\" + base + "(" & status.m_CurrentStep & ")M." + ext : dst_path = new_path
\r
278 echo "copy """ + src_path + """, """ + dst_path + """"
\r
279 copy src_path, dst_path
\r
281 src_path = "Editing\" + base + "(" & status.m_CurrentStep & ")R." + ext : dst_path = new_path
\r
282 echo "copy """ + src_path + """, """ + dst_path + """"
\r
283 copy src_path, dst_path
\r
286 Select Case status.m_EditingNum
\r
288 src_path = "Editing\" + base + "(" & status.m_CurrentStep & ")L." + ext
\r
289 dst_path = "Editing\" + base + "(" & (status.m_CurrentStep+1) & ")." + ext
\r
290 echo "copy """ + src_path + """, """ + dst_path + """"
\r
291 copy src_path, dst_path
\r
293 src_path = "Editing\" + base + "(" & status.m_CurrentStep & ")M." + ext
\r
294 dst_path = "Editing\" + base + "(" & (status.m_CurrentStep+1) & ")." + ext
\r
295 echo "copy """ + src_path + """, """ + dst_path + """"
\r
296 copy src_path, dst_path
\r
298 src_path = "Editing\" + base + "(" & status.m_CurrentStep & ")R." + ext
\r
299 dst_path = "Editing\" + base + "(" & (status.m_CurrentStep+1) & ")." + ext
\r
300 echo "copy """ + src_path + """, """ + dst_path + """"
\r
301 copy src_path, dst_path
\r
312 '********************************************************************************
\r
313 ' <<< [RunMergePromptSub] >>>
\r
314 '********************************************************************************
\r
315 Sub RunMergePromptSub( SubPathes, Status, Opt )
\r
318 Status.m_CopyNum = 0
\r
320 If UBound( SubPathes ) > 1 Then
\r
321 Select Case Status.m_EditingNum
\r
322 Case 1 : i0=0 : i1=2 : i2=1
\r
323 Case 3 : i0=1 : i1=0 : i2=2
\r
324 Case Else : i0=0 : i1=1 : i2=2
\r
331 echo "-------------------------------------------"
\r
332 Select Case Status.m_EditingNum
\r
333 Case -1: echo "
\83t
\83@
\83C
\83\8b\82ð
\83R
\83s
\81[
\82µ
\82Ä
\82
\82¾
\82³
\82¢"
\r
334 Case 0 : echo "
\95Ò
\8fW
\82ª
\8aJ
\8en
\82Å
\82«
\82é
\82æ
\82¤
\82É
\83R
\83s
\81[
\82·
\82é
\83t
\83@
\83C
\83\8b\82ð
\91I
\91ð
\82µ
\82Ä
\82
\82¾
\82³
\82¢"
\r
335 Case 1 : echo "
\8d¶
\82Æ
\92\86\82Ì
\8d·
\95ª
\82ð
\81A
\89E
\82Ì
\83t
\83@
\83C
\83\8b\82É
\94½
\89f
\82³
\82¹
\82Ä
\82
\82¾
\82³
\82¢"
\r
336 Case 2 : echo "
\92\86\89\9b\82Ì
\83t
\83@
\83C
\83\8b\82ð
\95Ò
\8fW
\82µ
\82Ä
\82
\82¾
\82³
\82¢"
\r
337 Case 3 : echo "
\89E
\82Æ
\92\86\82Ì
\8d·
\95ª
\82ð
\81A
\8d¶
\82Ì
\83t
\83@
\83C
\83\8b\82É
\94½
\89f
\82³
\82¹
\82Ä
\82
\82¾
\82³
\82¢"
\r
339 If Status.m_EditingNum <> -1 Then
\r
340 If Status.m_EditingNum = 0 Then i = "A" Else i = "B"
\r
341 echo "
\83}
\81[
\83W
\81E
\83X
\83e
\83b
\83v " & Status.m_CurrentStep & i & "/" & Status.m_LastStep & "B"
\r
344 If UBound( SubPathes ) = 0 Then
\r
345 echo "4.
\8aJ
\82: "+SubPathes(0)
\r
346 ElseIf UBound( SubPathes ) = 1 Then
\r
347 echo "1. Diff
\83c
\81[
\83\8b\8bN
\93®"
\r
348 echo "4.
\8d¶
\82ð
\8aJ
\82: "+SubPathes(0)
\r
349 echo "6.
\89E
\82ð
\8aJ
\82: "+SubPathes(1)
\r
351 echo "1. Diff
\83c
\81[
\83\8b\8bN
\93®"
\r
353 If i0=1 Then s="(old)" Else s=""
\r
354 If Status.m_EditingNum=1 Then s="(edit)"
\r
355 echo "4.
\8d¶
\82ð
\8aJ
\82"+s+": "+SubPathes(i0)
\r
357 If i1=1 Then s="(old)" Else s=""
\r
358 If Status.m_EditingNum=2 Then s="(edit)"
\r
359 echo "5.
\92\86\82ð
\8aJ
\82"+s+": "+SubPathes(i1)
\r
361 If i2=1 Then s="(old)" Else s=""
\r
362 If Status.m_EditingNum=3 Then s="(edit)"
\r
363 echo "6.
\89E
\82ð
\8aJ
\82"+s+": "+SubPathes(i2)
\r
365 Select Case Status.m_EditingNum
\r
366 Case -1: echo "7. New
\83t
\83H
\83\8b\83_
\82Ö
\83R
\83s
\81["
\r
367 Case 0 : echo "7. Editing
\83t
\83H
\83\8b\83_
\82Ö
\83R
\83s
\81[
\81i
\8e\9f\82Ì
\83X
\83e
\83b
\83v
\82Ö
\81j"
\r
368 Case 1 : echo "7.
\8d¶
\82Ì
\95Ò
\8fW
\82ð
\8a®
\97¹
\82µ
\82Ä
\81A
\8e\9f\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
369 Case 2 : echo "7.
\92\86\89\9b\82Ì
\95Ò
\8fW
\82ð
\8a®
\97¹
\82µ
\82Ä
\81A
\8e\9f\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
370 Case 3 : echo "7.
\89E
\82Ì
\95Ò
\8fW
\82ð
\8a®
\97¹
\82µ
\82Ä
\81A
\8e\9f\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
372 If not IsEmpty( Status.m_StepIDFilePath ) Then _
\r
373 echo "8.
\91O
\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
376 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
377 echo "-------------------------------------------"
\r
381 If UBound( SubPathes ) > 0 Then
\r
382 echo "Starting Diff tool : " + Opt.m_DiffPath
\r
383 If UBound( SubPathes ) = 1 Then
\r
384 g_sh.Run """"+Opt.m_DiffPath+""" """+SubPathes(i0)+""" """+SubPathes(i1)+""""
\r
386 g_sh.Run """"+Opt.m_DiffPath+""" """+SubPathes(i0)+""" """+SubPathes(i1)+""" """+SubPathes(i2)+""""
\r
388 echo "-------------------------------------------"
\r
391 g_sh.Run """"+Opt.m_EditorPath+""" """+SubPathes(i0)+""""
\r
393 If UBound( SubPathes ) >= 2 Then _
\r
394 g_sh.Run """"+Opt.m_EditorPath+""" """+SubPathes(i1)+""""
\r
396 If UBound( SubPathes ) = 1 Then
\r
397 g_sh.Run """"+Opt.m_EditorPath+""" """+SubPathes(i1)+""""
\r
398 ElseIf UBound( SubPathes ) = 2 Then
\r
399 g_sh.Run """"+Opt.m_EditorPath+""" """+SubPathes(i2)+""""
\r
402 If Status.m_EditingNum <> 0 Then Status.m_CopyNum = 1 : Exit Sub
\r
404 echo "Editing
\83t
\83H
\83\8b\83_
\82Ö
\83R
\83s
\81[
\81i
\8e\9f\82Ì
\83X
\83e
\83b
\83v
\82Ö
\81j"
\r
405 If UBound( SubPathes ) >= 2 Then
\r
406 echo "4.
\8d¶
\82ð
\83R
\83s
\81[
\82µ
\82Ä
\81A
\92\86\82Æ
\89E
\82Ì
\95\
\8e¦
\82ð
\93ü
\82ê
\91Ö
\82¦
\82é"
\r
407 echo "5.
\92\86\82ð
\83R
\83s
\81["
\r
408 echo "6.
\89E
\82ð
\83R
\83s
\81[
\82µ
\82Ä
\81A
\8d¶
\82Æ
\92\86\82Ì
\95\
\8e¦
\82ð
\93ü
\82ê
\91Ö
\82¦
\82é"
\r
410 echo "4.
\8d¶
\82ð
\83R
\83s
\81[
\82µ
\82Ä
\81A
\92\86\89\9b\82É
\92Ç
\89Á
\82·
\82é"
\r
411 echo "6.
\89E
\82ð
\83R
\83s
\81[
\82µ
\82Ä
\81A
\92\86\89\9b\82É
\92Ç
\89Á
\82·
\82é"
\r
414 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
415 echo "-------------------------------------------"
\r
417 Case 4 : Status.m_CopyNum = 1 : Exit Sub
\r
418 Case 5 : If UBound( SubPathes ) >= 2 Then Status.m_CopyNum = 2 : Exit Sub
\r
419 Case 6 : If UBound( SubPathes ) >= 2 Then Status.m_CopyNum = 3 : Exit Sub _
\r
420 Else Status.m_CopyNum = 2 : Exit Sub
\r
425 If not IsEmpty( Status.m_StepIDFilePath ) Then
\r
426 i = input( "
\91O
\83X
\83e
\83b
\83v
\82É
\96ß
\82é
\82½
\82ß
\81A" + Status.m_StepIDFilePath + "
\82ð
\8dí
\8f\9c\82µ
\82Ü
\82·
\81B[Y/N]" )
\r
427 If i = "y" or i = "Y" Then del Status.m_StepIDFilePath : Status.m_CopyNum = 0 : Exit Sub
\r
430 Status.m_bExit = True : Exit Sub
\r
437 '********************************************************************************
\r
438 ' <<< [GetMergeStep] >>>
\r
439 '********************************************************************************
\r
440 Function GetMergeStep( Pathes, Opt )
\r
442 Dim base, ext, new_path
\r
444 If UBound( Pathes ) = -1 Then GetMergeStep = "Empty" : Exit Function
\r
445 base = g_fs.GetBaseName( Pathes(0) )
\r
446 ext = g_fs.GetExtensionName( Pathes(0) )
\r
447 If IsEmpty( Opt.m_NewPath ) Then new_path = "New\" + base + "." + ext _
\r
448 Else new_path = Opt.m_NewPath
\r
451 If exist( new_path ) Then GetMergeStep = "Fin" : Exit Function
\r
455 If UBound( Pathes ) = 1 Then
\r
457 If exist( "Editing\" + base + "(1)M." + ext ) Then GetMergeStep = "1B" : Exit Function
\r
458 GetMergeStep = "1A"
\r
463 For i = UBound( Pathes ) To 1 Step -1
\r
464 If exist( "Editing\" + base + "(" & i & ")L." + ext ) Then
\r
465 GetMergeStep = i & "B" : Exit Function
\r
466 ElseIf exist( "Editing\" + base + "(" & i & ")M." + ext ) Then
\r
467 GetMergeStep = i & "B" : Exit Function
\r
468 ElseIf exist( "Editing\" + base + "(" & i & ")R." + ext ) Then
\r
469 GetMergeStep = i & "B" : Exit Function
\r
470 ElseIf exist( "Editing\" + base + "(" & i & ")." + ext ) Then
\r
471 GetMergeStep = i & "A" : Exit Function
\r
474 GetMergeStep = "1A"
\r
482 '********************************************************************************
\r
483 ' <<< [OpenMergePath] >>>
\r
484 '********************************************************************************
\r
485 Sub OpenMergePath( EditorPath, OpenPath )
\r
486 echo "Open """ + OpenPath + """"
\r
487 If g_fs.FileExists( OpenPath ) Then
\r
488 g_sh.Run """"+EditorPath+""" """+OpenPath+""""
\r
489 ElseIf g_fs.FolderExists( OpenPath ) Then
\r
490 g_sh.Run """"+OpenPath+""""
\r
494 echo """" + OpenPath + """
\82ª
\8c©
\82Â
\82©
\82è
\82Ü
\82¹
\82ñ"
\r
497 path = g_fs.GetParentFolderName( path )
\r
498 If path = "" Then Exit Sub
\r
499 If g_fs.FolderExists( path ) Then
\r
500 echo """" + path + """
\82ð
\91ã
\82í
\82è
\82É
\8aJ
\82«
\82Ü
\82·"
\r
501 g_sh.Run """"+path+""""
\r
509 '********************************************************************************
\r
510 ' <<< [RunMergeUpdate] >>>
\r
511 '********************************************************************************
\r
512 Sub RunMergeUpdate( NewPath, Pathes, Opt )
\r
516 If not IsEmpty( Opt ) Then
\r
517 If not IsEmpty( Opt.m_SyncPathes ) Then n = UBound( Opt.m_SyncPathes )
\r
520 ReDim pathes2( UBound( Pathes ) + 1 + n )
\r
522 For i=0 To UBound( Pathes )
\r
523 pathes2( i ) = Pathes( i )
\r
526 pathes2( UBound( Pathes ) + 1 + i ) = Opt.m_SyncPathes( i )
\r
529 RunMergeUpdateSub NewPath, pathes2, Opt
\r
533 Sub RunMergeUpdateSub( NewPath, Pathes, Opt )
\r
535 ReDim b_equal( UBound( Pathes ) )
\r
538 echo "[MergeUpdate]"
\r
540 '//=== Compare file with New file
\r
541 For i = 0 To UBound( Pathes )
\r
542 b_equal( i ) = fc_r( NewPath, Pathes( i ), Empty )
\r
543 If not b_equal( i ) Then echo Pathes(i)
\r
547 '//=== Run confirm prompt
\r
548 i = input( "
\88È
\8fã
\82Ì
\83t
\83@
\83C
\83\8b\82ð
\8dX
\90V
\82µ
\82Ü
\82·
\82© [Y/N]" )
\r
549 If i <> "Y" and i <> "y" Then Exit Sub
\r
552 '//=== Do merge update
\r
553 Dim backup_base, path, j
\r
555 For i = 0 To UBound( Pathes )
\r
556 If not b_equal( i ) Then
\r
557 backup_base = g_fs.GetParentFolderName( Pathes(i) )
\r
558 backup_base = backup_base + "\backup\" + _
\r
559 g_fs.GetBaseName( Pathes(i) ) + " ("
\r
561 path = backup_base & j & ")." & g_fs.GetExtensionName( Pathes(i) )
\r
562 If not exist( path ) Then
\r
563 copy Pathes(i), path
\r
564 copy NewPath, Pathes(i)
\r
568 If j<>0 Then Err.Raise 1,,"Cannot write """ + path + """"
\r
575 '*-------------------------------------------------------------------------*
\r
576 '*
\81\9f<<<< [Merge_Option] Class >>>> */
\r
577 '*-------------------------------------------------------------------------*
\r
581 Public m_EditorPath
\r
584 Public m_SyncPathes ' as array of string, or Empty
\r
590 '*-------------------------------------------------------------------------*
\r
591 '*
\81\9f<<<< [Merge_Status] Class >>>> */
\r
592 '*-------------------------------------------------------------------------*
\r
596 Public m_CurrentStep
\r
600 Public m_EditingNum
\r
601 Public m_StepIDFilePath
\r
607 '********************************************************************************
\r
608 ' <<< [RunMergeRepPrompt] >>>
\r
609 '********************************************************************************
\r
610 Sub RunMergeRepPrompt( OldPath, NewPath, PatchFolderPath, OldPatchStepPath, NewPatchStepPath, Opt )
\r
611 Dim src_path, dst_path
\r
612 Dim status : Set status = new MergeRep_Status : ErrCheck
\r
614 If OldPatchStepPath = g_fs.GetAbsolutePathName( OldPatchStepPath ) or _
\r
615 Left( OldPatchStepPath, 2 ) = ".." Then
\r
616 Err.Raise 1,,"OldPatchStepPath needs step path and not parent path : " + OldPatchStepPath
\r
618 If NewPatchStepPath = g_fs.GetAbsolutePathName( NewPatchStepPath ) or _
\r
619 Left( NewPatchStepPath, 2 ) = ".." Then
\r
620 Err.Raise 1,,"NewPatchStepPath needs step path and not parent path : " + NewPatchStepPath
\r
623 status.m_PatchFolderPath = PatchFolderPath
\r
624 status.m_OldPatchStepPath = OldPatchStepPath
\r
625 status.m_NewPatchStepPath = NewPatchStepPath
\r
626 status.m_OldPatchPath = PatchFolderPath + "\" + OldPatchStepPath
\r
629 GetMergeRepStep status
\r
631 If status.m_CurrentStep = "Fin" Then
\r
633 echo "-------------------------------------------"
\r
634 echo status.m_OldPatchStepPath + "
\82Ì
\83}
\81[
\83W
\82Í
\8a®
\97¹
\82µ
\82Ü
\82µ
\82½
\81B"
\r
635 echo "5.
\83}
\81[
\83W
\8dÏ
\82Ý
\82ð
\8aJ
\82"
\r
636 echo "6.
\83}
\81[
\83W
\8dÏ
\82Ý
\83t
\83H
\83\8b\83_
\82ð
\8aJ
\82"
\r
637 echo "8.
\91O
\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
639 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
640 echo "-------------------------------------------"
\r
641 If i=9 Then Exit Sub
\r
643 i = input( "
\91O
\83X
\83e
\83b
\83v
\82É
\96ß
\82é
\82½
\82ß
\81A" + status.m_NewPatchPath + "
\82ð
\8dí
\8f\9c\82µ
\82Ü
\82·
\81B[Y/N]" )
\r
644 If i = "y" or i = "Y" Then del status.m_NewPatchPath : Exit Do
\r
646 If i=5 Then OpenMergePath Opt.m_EditorPath, status.m_NewPatchPath
\r
647 If i=6 Then OpenMergePath Opt.m_EditorPath, g_fs.GetParentFolderName( status.m_NewPatchPath )
\r
649 GetMergeRepStep status
\r
652 echo "-------------------------------------------"
\r
653 echo "
\83}
\81[
\83W
\81E
\83X
\83e
\83b
\83v " & status.m_CurrentStep & "/2"
\r
654 If g_fs.FileExists( NewPath ) Then echo "1. Diff OldPatch, OldOrg, NewOrg"
\r
655 echo "2. OldPatch
\82ð
\8aJ
\82: " + status.m_OldPatchPath
\r
656 If status.m_CurrentStep <> "1" Then
\r
657 echo "3. NewPatch
\82ð
\8aJ
\82: " + status.m_NewPatchPath
\r
659 If status.m_CurrentStep <> "1" Then
\r
660 If g_fs.FileExists( status.m_NewPatchPath ) Then
\r
661 echo "4. Diff OldPatch, NewPatch, NewOrg"
\r
664 If exist( OldPath ) Then echo "5. OldOrg
\82ð
\8aJ
\82: " + OldPath _
\r
665 Else echo "5. OldOrg
\82Í
\91¶
\8dÝ
\82µ
\82Ü
\82¹
\82ñ: " + OldPath
\r
666 If exist( NewPath ) Then echo "6. NewOrg
\82ð
\8aJ
\82: " + NewPath _
\r
667 Else echo "6. NewOrg
\82Í
\91¶
\8dÝ
\82µ
\82Ü
\82¹
\82ñ: " + NewPath
\r
668 Select Case status.m_CurrentStep
\r
669 Case "1" : echo "7. OldPatch
\82ð Editing
\83t
\83H
\83\8b\83_
\82Ö
\83R
\83s
\81[
\82µ
\82Ä
\95Ò
\8fW
\8aJ
\8en
\81i
\8e\9f\82Ì
\83X
\83e
\83b
\83v
\82Ö
\81j"
\r
670 Case "2" : echo "7. NewPatch
\82ð New
\83t
\83H
\83\8b\83_
\82Ö
\83R
\83s
\81[
\82µ
\82Ä
\8a®
\97¹"
\r
672 If status.m_CurrentStep <> "1" Then _
\r
673 echo "8.
\91O
\82Ì
\83X
\83e
\83b
\83v
\82Ö"
\r
676 i = CInt2( input("
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B>") )
\r
677 echo "-------------------------------------------"
\r
681 If g_fs.FileExists( NewPath ) Then
\r
682 echo "Starting Diff tool : " + Opt.m_DiffPath
\r
683 g_sh.Run """"+Opt.m_DiffPath+""" """+status.m_OldPatchPath+""" """+OldPath+""" """+NewPath+""""
\r
685 Case 2 : OpenMergePath Opt.m_EditorPath, status.m_OldPatchPath
\r
686 Case 3 : If status.m_CurrentStep <> "1" Then _
\r
687 OpenMergePath Opt.m_EditorPath, status.m_NewPatchPath
\r
690 If status.m_CurrentStep <> "1" Then
\r
691 If g_fs.FileExists( status.m_NewPatchPath ) Then
\r
692 echo "Starting Diff tool : " + Opt.m_DiffPath
\r
693 g_sh.Run """"+Opt.m_DiffPath+""" """+status.m_OldPatchPath+""" """+status.m_NewPatchPath+""" """+NewPath+""""
\r
696 Case 5 : OpenMergePath Opt.m_EditorPath, OldPath
\r
697 Case 6 : OpenMergePath Opt.m_EditorPath, NewPath
\r
700 Select Case status.m_CurrentStep
\r
702 src_path = status.m_OldPatchPath : dst_path = "Editing\" + status.m_NewPatchStepPath
\r
703 If g_fs.FolderExists( src_path ) Then src_path = src_path + "\*"
\r
704 echo "copy """ + src_path + """, """ + dst_path + """"
\r
705 copy src_path, dst_path
\r
707 src_path = status.m_NewPatchPath : dst_path = "New\" + status.m_NewPatchStepPath
\r
708 If g_fs.FolderExists( src_path ) Then src_path = src_path + "\*"
\r
709 echo "copy """ + src_path + """, """ + dst_path + """"
\r
710 copy src_path, dst_path
\r
714 If not IsEmpty( status.m_NewPatchPath ) Then
\r
715 i = input( "
\91O
\83X
\83e
\83b
\83v
\82É
\96ß
\82é
\82½
\82ß
\81A" + status.m_NewPatchPath + "
\82ð
\8dí
\8f\9c\82µ
\82Ü
\82·
\81B[Y/N]" )
\r
716 If i = "y" or i = "Y" Then del status.m_NewPatchPath
\r
725 '********************************************************************************
\r
726 ' <<< [GetMergeRepStep] >>>
\r
728 '- Status as MergeRep_Status
\r
729 '- (In) Status.m_PatchFolderPath, Status.m_NewPatchStepPath
\r
730 '- (Out) Status.m_CurrentStep and Status.m_NewPatchPath
\r
731 '********************************************************************************
\r
732 Sub GetMergeRepStep( Status )
\r
735 path = "New\" + Status.m_NewPatchStepPath
\r
736 If exist( path ) Then
\r
737 Status.m_NewPatchPath = path : Status.m_CurrentStep = "Fin" : Exit Sub
\r
740 path = "Editing\" + Status.m_NewPatchStepPath
\r
741 If exist( path ) Then
\r
742 Status.m_NewPatchPath = path : Status.m_CurrentStep = CStr( 2 ) : Exit Sub
\r
745 Status.m_NewPatchPath = Empty : Status.m_CurrentStep = CStr( 1 )
\r
752 '*-------------------------------------------------------------------------*
\r
753 '*
\81\9f<<<< [MergeRep_Status] Class >>>> */
\r
754 '*-------------------------------------------------------------------------*
\r
757 Class MergeRep_Status
\r
758 Public m_PatchFolderPath
\r
759 Public m_OldPatchStepPath
\r
760 Public m_NewPatchStepPath
\r
762 Public m_OldPatchPath
\r
763 Public m_NewPatchPath
\r
765 Public m_CurrentStep
\r
771 '*-------------------------------------------------------------------------*
\r
772 '*
\81\9f<<<< [PatchFiles] Class >>>> */
\r
773 '*-------------------------------------------------------------------------*
\r
776 Public m_MergeOption ' as Merge_Option
\r
777 Public m_OldFolderPath ' as string
\r
778 Public m_OldFolderPath2 ' as string
\r
779 Public m_PatchFolderPath ' as string
\r
780 Public m_NewFolderPath ' as string
\r
781 Public m_Items() ' as array of PatchFile
\r
782 Public m_RenamedFrom() ' as array of string. step path
\r
783 Public m_RenamedTo() ' as array of string. step path
\r
786 Public m_PatchFileType '//Const
\r
787 Public m_ReplaceType '//Const
\r
789 Private Sub Class_Initialize
\r
790 Me.m_PatchFileType = 1
\r
791 Me.m_ReplaceType = 2
\r
793 ReDim m_RenamedFrom(-1)
\r
794 ReDim m_RenamedTo(-1)
\r
795 g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )
\r
798 Public Sub AddPatchFile( StepPath )
\r
799 Dim item : Set item = new PatchFile : ErrCheck
\r
803 .m_Type = Me.m_PatchFileType
\r
804 .m_StepPath = StepPath
\r
807 ReDim Preserve m_Items( UBound( m_Items ) + 1 )
\r
808 Set m_Items( UBound( m_Items ) ) = item
\r
811 Public Sub AddReplace( OldStepPath, NewStepPath, PatchStepPath )
\r
812 Dim item : Set item = New ReplaceFile
\r
816 .m_Type = Me.m_ReplaceType
\r
817 .m_OldStepPath = OldStepPath
\r
818 .m_NewStepPath = NewStepPath
\r
819 .m_StepPath = PatchStepPath
\r
822 ReDim Preserve m_Items( UBound( m_Items ) + 1 )
\r
823 Set m_Items( UBound( m_Items ) ) = item
\r
826 Public Sub AddRenamed( OldStepPath, NewStepPath )
\r
827 ReDim Preserve m_RenamedFrom( UBound( m_RenamedFrom ) + 1 )
\r
828 m_RenamedFrom( UBound( m_RenamedFrom ) ) = OldStepPath
\r
830 ReDim Preserve m_RenamedTo( UBound( m_RenamedTo ) + 1 )
\r
831 m_RenamedTo( UBound( m_RenamedTo ) ) = NewStepPath
\r
834 Public Function GetRenamedPath( ByVal path )
\r
837 For i = 0 To UBound( Me.m_RenamedFrom )
\r
838 If Me.m_RenamedFrom(i) = Left( path, Len(Me.m_RenamedFrom(i)) ) Then
\r
839 path = Me.m_RenamedTo(i) + Mid( path, Len(Me.m_RenamedFrom(i)) + 1 )
\r
843 GetRenamedPath = path
\r
846 Public Sub EchoSteps()
\r
848 echo "[Update_Merge_Steps]"
\r
849 Me.m_IDefault = Empty
\r
850 For i=0 To UBound( Me.m_Items )
\r
851 step_ = Me.m_Items(i).GetStep() : If step_<>"Fin" and IsEmpty(Me.m_IDefault) Then Me.m_IDefault = i
\r
852 echo (i+1) & ") Step=" & step_ & " : " + Me.m_Items(i).m_StepPath
\r
854 If IsEmpty( Me.m_IDefault ) Then
\r
855 echo "All items are Finished."
\r
857 If UBound( Me.m_Items ) > 10 Then
\r
859 step_ = Me.m_Items(i).GetStep()
\r
860 echo "0) Step=" & step_ & " : " + Me.m_Items(i).m_StepPath
\r
865 Public Sub RunMergePrompt()
\r
866 g_CUI.SetAutoKeysFromMainArg
\r
870 i = CInt2( input( "
\83}
\81[
\83W
\82·
\82é
\83t
\83@
\83C
\83\8b\82Ì
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢>" ) )
\r
871 If i = -1 Then Exit Sub
\r
872 echo "-------------------------------------------"
\r
873 If i = 0 and ( not IsEmpty( Me.m_IDefault ) ) Then i = Me.m_IDefault + 1
\r
874 If i <= UBound( Me.m_Items )+1 Then Me.m_Items(i-1).RunMergePromptMe
\r
881 '*-------------------------------------------------------------------------*
\r
882 '*
\81\9f<<<< [PatchFile] Class >>>> */
\r
883 '*-------------------------------------------------------------------------*
\r
886 Public m_Parent ' as PatchFiles
\r
887 Public m_Type '// PatchFiles::m_PatchFileType
\r
891 Public Sub RunMergePromptMe()
\r
893 Me_SetupParams pathes
\r
894 RunMergePrompt pathes, m_Parent.m_MergeOption
\r
897 Public Function GetStep()
\r
899 Me_SetupParams pathes
\r
900 GetStep = GetMergeStep( pathes, m_Parent.m_MergeOption )
\r
903 Private Sub Me_SetupParams( pathes )
\r
910 path = Me.m_Parent.m_OldFolderPath + "\" + Me.m_StepPath
\r
911 If exist( path ) Then
\r
912 pathes(i) = path : i=i+1
\r
913 ElseIf not IsEmpty( Me.m_Parent.m_OldFolderPath2 ) Then
\r
914 path = Me.m_Parent.m_OldFolderPath2+ "\" + Me.m_StepPath
\r
915 If exist( path ) Then pathes(i) = path : i=i+1
\r
919 path = Me.m_Parent.m_PatchFolderPath + "\" + Me.m_StepPath
\r
920 If exist( path ) Then pathes(i) = path : i=i+1
\r
924 path = Me.m_Parent.m_NewFolderPath + "\" + Me.m_StepPath
\r
925 path = Me.m_Parent.GetRenamedPath( path )
\r
926 If exist( path ) Then pathes(i) = path : i=i+1
\r
927 Redim Preserve pathes(i-1)
\r
931 Me.m_Parent.m_MergeOption.m_NewPath = "New\" + Me.m_StepPath
\r
938 '*-------------------------------------------------------------------------*
\r
939 '*
\81\9f<<<< [ReplaceFile] Class >>>> */
\r
940 '*-------------------------------------------------------------------------*
\r
943 Public m_Parent ' as PatchFiles
\r
944 Public m_Type '// PatchFiles::m_ReplaceType
\r
946 Public m_StepPath '// PatchPath
\r
947 Public m_OldStepPath
\r
948 Public m_NewStepPath
\r
950 Public Sub RunMergePromptMe()
\r
951 RunMergeRepPrompt _
\r
952 Me.m_Parent.m_OldFolderPath + "\" + m_OldStepPath, _
\r
953 Me.m_Parent.m_NewFolderPath + "\" + Me.m_Parent.GetRenamedPath( m_NewStepPath ), _
\r
954 Me.m_Parent.m_PatchFolderPath, _
\r
956 Me.m_Parent.GetRenamedPath( m_StepPath ), _
\r
957 Me.m_Parent.m_MergeOption
\r
960 Public Function GetStep()
\r
961 Dim status : Set status = new MergeRep_Status : ErrCheck
\r
962 status.m_PatchFolderPath = Me.m_Parent.m_PatchFolderPath
\r
963 status.m_NewPatchStepPath = Me.m_Parent.GetRenamedPath( m_StepPath )
\r
964 GetMergeRepStep status
\r
965 GetStep = status.m_CurrentStep
\r
971 '*-------------------------------------------------------------------------*
\r
972 '*
\81\9f<<<< [SyncFiles] Class >>>> */
\r
973 '*-------------------------------------------------------------------------*
\r
976 Public m_MergeOption ' as Merge_Option
\r
977 Public m_Items() ' as array of SyncFile
\r
978 Public m_SubCount ' as integer
\r
981 Private Sub Class_Initialize
\r
984 g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )
\r
987 Public Sub NextSyncFile()
\r
991 Public Sub AddRepliFile( Path )
\r
992 Dim item : Set item = AddFileSub( Path )
\r
996 Public Sub AddSameFile( Path )
\r
997 Dim item : Set item = AddFileSub( Path )
\r
998 item.AddSameFile Path
\r
1001 Private Function AddFileSub( Path )
\r
1004 If Me.m_SubCount = 0 Then
\r
1005 Set item = new SyncFile : ErrCheck
\r
1006 ReDim Preserve m_Items( UBound( m_Items ) + 1 )
\r
1007 Set m_Items( UBound( m_Items ) ) = item
\r
1009 Set item.m_Parent = Me
\r
1010 item.m_Name = g_fs.GetFileName( Path )
\r
1012 Set item = m_Items( UBound( m_Items ) )
\r
1014 Me.m_SubCount = Me.m_SubCount + 1
\r
1016 Set AddFileSub = item
\r
1019 Public Sub EchoSteps()
\r
1021 echo "[Sync_Merge_Steps]"
\r
1022 Me.m_IDefault = Empty
\r
1023 For i=0 To UBound( Me.m_Items )
\r
1024 step_ = Me.m_Items(i).GetStep() : If step_<>"Fin" and IsEmpty(Me.m_IDefault) Then Me.m_IDefault = i
\r
1025 echo (i+1) & ") Step=" & step_ + " : " + Me.m_Items(i).m_Name
\r
1027 If IsEmpty( Me.m_IDefault ) Then
\r
1028 echo "All items are Finished."
\r
1030 If UBound( Me.m_Items ) > 10 Then
\r
1032 step_ = Me.m_Items(i).GetStep()
\r
1033 echo "0) Step=" & step_ + " : " + Me.m_Items(i).m_Name
\r
1038 Public Sub RunMergePrompt()
\r
1039 g_CUI.SetAutoKeysFromMainArg
\r
1041 echo "-------------------------------------------"
\r
1044 i = CInt2( input( "
\83}
\81[
\83W
\82·
\82é
\83t
\83@
\83C
\83\8b\82Ì
\94Ô
\8d\86\82ð
\93ü
\97Í
\82µ
\82Ä
\82
\82¾
\82³
\82¢>" ) )
\r
1045 If i = -1 Then Exit Sub
\r
1046 If i = 0 and ( not IsEmpty( Me.m_IDefault ) ) Then i = Me.m_IDefault + 1
\r
1047 If i <= UBound( Me.m_Items )+1 Then Me.m_Items(i-1).RunMergePromptMe
\r
1055 '*-------------------------------------------------------------------------*
\r
1056 '*
\81\9f<<<< [SyncFile] Class >>>> */
\r
1057 '*-------------------------------------------------------------------------*
\r
1060 Public m_Parent ' as SyncFiles
\r
1061 Public m_Name ' as string
\r
1062 Public m_FilePathes() ' as array of string
\r
1063 Public m_SameFilePathes() ' as array of string
\r
1065 Private Sub Class_Initialize
\r
1066 ReDim m_FilePathes(-1)
\r
1067 ReDim m_SameFilePathes(-1)
\r
1070 Public Sub AddFile( Path )
\r
1071 ReDim Preserve m_FilePathes( UBound( m_FilePathes ) + 1 )
\r
1072 m_FilePathes( UBound( m_FilePathes ) ) = Path
\r
1075 Public Sub AddSameFile( Path )
\r
1076 ReDim Preserve m_SameFilePathes( UBound( m_SameFilePathes ) + 1 )
\r
1077 m_SameFilePathes( UBound( m_SameFilePathes ) ) = Path
\r
1080 Public Sub RunMergePromptMe()
\r
1081 Me.m_Parent.m_MergeOption.m_NewPath = Empty
\r
1082 Me.m_Parent.m_MergeOption.m_SyncPathes = m_SameFilePathes
\r
1083 RunMergePrompt m_FilePathes, Me.m_Parent.m_MergeOption
\r
1086 Public Function GetStep()
\r
1087 Me.m_Parent.m_MergeOption.m_NewPath = Empty
\r
1088 GetStep = GetMergeStep( Me.m_FilePathes, Me.m_Parent.m_MergeOption )
\r