Subversion Repositories DevTools

Rev

Rev 1281 | Rev 3621 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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