Subversion Repositories DevTools

Rev

Rev 1334 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1334 Rev 1376
Line 116... Line 116...
116
         " PK_ENVIRONMENT.REPLACE_PACKAGE ( :RETPV_ID, :ORIG_PV_ID, :RTAG_ID, :USER_ID ); "&_
116
         " PK_ENVIRONMENT.REPLACE_PACKAGE ( :RETPV_ID, :ORIG_PV_ID, :RTAG_ID, :USER_ID ); "&_
117
         "END;"
117
         "END;"
118
 
118
 
119
         retNEWpv_id = OraDatabase.Parameters("RETPV_ID").Value
119
         retNEWpv_id = OraDatabase.Parameters("RETPV_ID").Value
120
 
120
 
121
      If (Original_SSnewver) <> ""  Then
-
 
122
        Call UpdateSubVersionSrcPath(retNEWpv_id)
-
 
123
      End If
-
 
124
 
-
 
125
      End If
121
      End If
126
   Else
122
   Else
127
      OraDatabase.ExecuteSQL _
123
      OraDatabase.ExecuteSQL _
128
      "BEGIN "&_
124
      "BEGIN "&_
129
      " PK_PACKAGE.NEW_VERSION ( :ORIG_PV_ID, "&_
125
      " PK_PACKAGE.NEW_VERSION ( :ORIG_PV_ID, "&_
Line 138... Line 134...
138
      " PK_ENVIRONMENT.REPLACE_PACKAGE ( :RETPV_ID, :ORIG_PV_ID, :RTAG_ID, :USER_ID ); "&_
134
      " PK_ENVIRONMENT.REPLACE_PACKAGE ( :RETPV_ID, :ORIG_PV_ID, :RTAG_ID, :USER_ID ); "&_
139
      "END;"
135
      "END;"
140
 
136
 
141
      retNEWpv_id = OraDatabase.Parameters("RETPV_ID").Value
137
      retNEWpv_id = OraDatabase.Parameters("RETPV_ID").Value
142
 
138
 
143
      If (Original_SSnewver) <> ""  Then
-
 
144
        Call UpdateSubVersionSrcPath(retNEWpv_id)
-
 
145
      End If
-
 
146
 
-
 
147
   End If
139
   End If
148
 
140
 
149
   objEH.CatchORA ( OraSession )
141
   objEH.CatchORA ( OraSession )
150
   If objEH.LastOraFailed = FALSE Then
142
   If objEH.LastOraFailed = FALSE Then
151
      Call UpdateChangeType (retNEWpv_id, Request("change_type"))
143
      Call UpdateChangeType (retNEWpv_id, Request("change_type"))
Line 190... Line 182...
190
 
182
 
191
   Set objRegEx = Nothing
183
   Set objRegEx = Nothing
192
   Set objRegEx2 = Nothing
184
   Set objRegEx2 = Nothing
193
End Function
185
End Function
194
 
186
 
195
'---------------------------------------------------------------
-
 
196
'Returns a new subversion package source path string by replacing or adding
-
 
197
'the specified label to the specified subversion package source path string.
-
 
198
Function  GetNewSvnSrcPath(asrc_path, alabel)
-
 
199
  Dim ssrc_base
-
 
200
  Dim snew_src_path
-
 
201
  Dim ssrc_path
-
 
202
  Dim slast_char
-
 
203
  Dim i,j
-
 
204
 
-
 
205
  if IsNull(asrc_path) then
-
 
206
    ssrc_path = ""
-
 
207
  else
-
 
208
    ssrc_path = asrc_path
-
 
209
  end if
-
 
210
  
-
 
211
  'get project directory from current package source path, ie path above either "tags" or "branches" or "trunk" directory
-
 
212
  i = InStrRev(LCase(ssrc_path), "/tags")
-
 
213
  if i = 0 then
-
 
214
    i = InStrRev(LCase(ssrc_path), "/branches")
-
 
215
    if i = 0 then
-
 
216
      i = InStrRev(LCase(ssrc_path), "/trunk")
-
 
217
    end if
-
 
218
  end if
-
 
219
  
-
 
220
  if i = 0 then
-
 
221
    '"tags" or "branches" or "trunk" not found
-
 
222
    'use current package source path as the project directory
-
 
223
    ssrc_base = ssrc_path
-
 
224
      
-
 
225
    'ensure project directory ends in a slash
-
 
226
    j = Len(ssrc_base)
-
 
227
    slast_char = Right(ssrc_base,1)
-
 
228
    if (j > 0) and (slast_char <> "/") then
-
 
229
      ssrc_base = ssrc_base & "/"
-
 
230
    end if
-
 
231
  else
-
 
232
    '"tags" or "branches" or "trunk" found so extract project directory
-
 
233
    ssrc_base = Mid(ssrc_path,1,i)
-
 
234
  end if
-
 
235
 
-
 
236
  'append new directory to the default project directory string.
-
 
237
  'the default path will be <project directory>/branches/<label>
-
 
238
  snew_src_path = ssrc_base & "branches/" & alabel
-
 
239
    
-
 
240
  GetNewSvnSrcPath = snew_src_path
-
 
241
  
-
 
242
End Function
-
 
243
 
-
 
244
'------------------------------------------------------------------
-
 
245
'This function is used to create the default package source path
-
 
246
'string when a new SubVersion package version is added.
-
 
247
'Assumes the specified pv_id is for a subversion package
-
 
248
Sub UpdateSubVersionSrcPath(apv_id)
-
 
249
  Dim rsQry
-
 
250
  Dim anew_src_path
-
 
251
  Dim ivcs_type_id
-
 
252
  Dim apkg_label
-
 
253
  Dim asrc_path
-
 
254
  Dim ssql
-
 
255
 
-
 
256
  'select the package and ensure it is a subversion package
-
 
257
  ssql = "SELECT * FROM PACKAGE_VERSIONS WHERE PV_ID ="& apv_id &" AND VCS_TYPE_ID=23"
-
 
258
 
-
 
259
  Set rsQry = OraDatabase.DbCreateDynaset(ssql, cint(0))
-
 
260
 
-
 
261
  If rsQry.RecordCount > 0 Then
-
 
262
    ivcs_type_id = rsQry("vcs_type_id")
-
 
263
    'pkg_label contains the new auto generated label for this version
-
 
264
    apkg_label = rsQry("pkg_label")
-
 
265
    asrc_path = rsQry("src_path")
-
 
266
    anew_src_path = GetNewSvnSrcPath(asrc_path,apkg_label)
-
 
267
 
-
 
268
    OraDatabase.ExecuteSQL _
-
 
269
      "BEGIN "&_
-
 
270
      " UPDATE PACKAGE_VERSIONS SET SRC_PATH ='"& anew_src_path &"' WHERE PV_ID ="& apv_id &"; "&_
-
 
271
      "END;"
-
 
272
  End If
-
 
273
 
-
 
274
  rsQry.Close()
-
 
275
  Set rsQry = nothing
-
 
276
  
-
 
277
End Sub
-
 
278
 
-
 
279
'-----------------------------------------------------------------------------------
187
'-----------------------------------------------------------------------------------
280
%>
188
%>
281
<%
189
<%
282
'-----------------------  MAIN LINE  ---------------------------
190
'-----------------------  MAIN LINE  ---------------------------
283
Dim rsQry, Query_String, Record_Count
191
Dim rsQry, Query_String, Record_Count