; CDSVN: subversion compatibility for Cadence/CDS tools ; Copyright (c) 2008 Poojan Wagh (poojanwagh {at} circuitdesign {dot} info) ; This file is part of CDSVN. ; ; CDSVN is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; CDSVN is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with CDSVN. If not, see . procedure(svnLockCell(reason Lib Cell View file cat) let( (newLibField newCellField newbrowser) when( !(boundp( `svnLockCellForm ) && svnLockCellForm) newLibField = hiCreateStringField( ?name 'newLibName ?prompt "Select Library" ?value Lib ) newCellField = hiCreateStringField( ?name 'newCellName ?prompt "Enter Cell name" ?value Cell ) newbrowser = hiCreateButton( ?name 'newbrowser ?buttonText "Browse for Cell" ?callback "ddsSyncWithForm(svnLockCellForm 'newbrowser 'newLibName 'newCellName )" ) ; hiCreateButton( svnLockCellForm = hiCreateAppForm( ?name `svnLockCellForm ?fields `(newLibField newCellField newbrowser) ?callback "svnLockCellFormCB( svnLockCellForm )" ) ) ; when( svnLockCellForm~>newLibName->value=Lib; svnLockCellForm~>newCellName->value=Cell; hiDisplayForm( svnLockCellForm ) svnLockCellForm->refresh ; return true if we need to refresh data from disk ) ; let( ) ; procedure( procedure(svnUnlockCell(reason Lib Cell View file cat) let( (newLibField newCellField newbrowser) when( !(boundp( `svnUnlockCellForm ) && svnUnlockCellForm) newLibField = hiCreateStringField( ?name 'newLibName ?prompt "Select Library" ?value Lib ) newCellField = hiCreateStringField( ?name 'newCellName ?prompt "Enter Cell name" ?value Cell ) newbrowser = hiCreateButton( ?name 'newbrowser ?buttonText "Browse for Cell" ?callback "ddsSyncWithForm(svnUnlockCellForm 'newbrowser 'newLibName 'newCellName )" ) ; hiCreateButton( svnUnlockCellForm = hiCreateAppForm( ?name `svnUnlockCellForm ?fields `(newLibField newCellField newbrowser) ?callback "svnUnlockCellFormCB( svnUnlockCellForm )" ) ) ; when( svnUnlockCellForm~>newLibName->value=Lib; svnUnlockCellForm~>newCellName->value=Cell; hiDisplayForm( svnUnlockCellForm ) svnUnlockCellForm->refresh ; return true if we need to refresh data from disk ) ; let( ) ; procedure( procedure(svnLockCellFormCB( form ) let( (newLib newCell cellPath svnCmd svnCid workarea_dir) wa_dir = getShellEnvVar("WORKAREA_DIR") if( ( boundp(`form) && form ) then form->refresh = nil newLib = form->newLibName->value; newCell = form->newCellName->value; printf("svnLockCell: subversion lock cell\n") printf("Lock: Lib = %s Cell = %s\n", newLib, newCell) if(cell = ddGetObj(newLib newCell) then ; library & cell exist, but we need to create new view cPath = cell->readPath; else error("svnLockCell: cell doesn't exist (create new cell first)\n") ) svnCmd = sprintf(nil "svn propset --non-interactive svn:ignore -F %s/cadence_ignores.txt %s", wa_dir, cPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); foreach(file cell~>files if( !(rexMatchp(".*.svn$", file~>readPath) || rexMatchp(" ", file~>readPath)) then svnCmd = sprintf(nil "svn lock %s\n", file~>readPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); ) ; if(!rexMatchp ) ; foreach(file foreach(view cell~>views svnCmd = sprintf(nil "svn propset --non-interactive svn:ignore -F %s/cadence_ignores.txt %s", wa_dir, view~>readPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) form->refresh = nil ; No need to refresh Cadence ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); foreach(file view~>files if( !(rexMatchp(".*.svn$", file~>readPath) || rexMatchp(" ", file~>readPath)) then svnCmd = sprintf(nil "svn lock %s\n", file~>readPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); ) ; if(!rexMatchp ) ; foreach(file ) ; foreach(view ) ; if( ) ) ; procedure( procedure(svnUnlockCellFormCB( form ) let( (newLib newCell cellPath svnCmd svnCid workarea_dir) wa_dir = getShellEnvVar("WORKAREA_DIR") if( ( boundp(`form) && form ) then form->refresh = nil newLib = form->newLibName->value; newCell = form->newCellName->value; printf("svnUnlockCell: subversion unlock cell\n") printf("Unlock: Lib = %s Cell = %s\n", newLib, newCell) if(cell = ddGetObj(newLib newCell) then ; library & cell exist, but we need to create new view cPath = cell->readPath; else error("svnUnlockCell: cell doesn't exist (create new cell first)\n") ) foreach(file cell~>files if( !(rexMatchp(".*.svn$", file~>readPath) || rexMatchp(" ", file~>readPath)) then svnCmd = sprintf(nil "svn unlock %s\n", file~>readPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); ) ; if(!rexMatchp ) ; foreach(file foreach(view cell~>views if( !(rexMatchp(".*.svn$", view~>readPath) || rexMatchp(" ", view~>readPath)) then svnCmd = sprintf(nil "svn unlock %s\n", view~>readPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); foreach(file view~>files if( !(rexMatchp(".*.svn$", file~>readPath) || rexMatchp(" ", file~>readPath)) then svnCmd = sprintf(nil "svn unlock %s\n", file~>readPath); printf("Executing %s\n" svnCmd); svnCid = ipcBeginProcess(svnCmd) ipcWait(svnCid) ; wait for subversion to finish printf("SVN Result: %s\n" ipcReadProcess(svnCid)); ) ; if(!rexMatchp ) ; foreach(file ) ; foreach(view ) ; if( ) ; if( ) )