public void importAssetsFromGit ( ProgressMonitor ... monitors ) throws IOException { if ( inProgress ) throw new IOException ( "Asset import already in progress..." ) ; try { inProgress = true ; getOut ( ) . println ( "Importing from Git into: " + getProjectDir ( ) + "...(branch: " + branch + ")(Hard Reset: " + ( hardReset ? "YES)" : "NO)" ) ) ; // Check Asset inconsistencies Vercheck vercheck = new Vercheck ( ) ; vercheck . setConfigLoc ( getConfigLoc ( ) ) ; vercheck . setAssetLoc ( getAssetLoc ( ) ) ; vercheck . setGitRoot ( getGitRoot ( ) ) ; vercheck . setForImport ( true ) ; vercheck . setDebug ( true ) ; vercheck . run ( ) ; if ( vercheck . getErrorCount ( ) > 0 ) { throw new IOException ( "Asset version conflict(s). See log for details" ) ; } // Perform import (Git pull) versionControl . hardCheckout ( branch , hardReset ) ; // Clear cached previous asset revisions versionControl . clear ( ) ; // Capture new Refs in ASSET_REF after import (Git pull) and insert/update VALUE table Checkpoint checkpoint = new Checkpoint ( getEngineAssetRoot ( ) , versionControl , versionControl . getCommit ( ) , pooledConn ) ; try { checkpoint . updateRefs ( true ) ; } catch ( SQLException ex ) { throw new IOException ( ex . getMessage ( ) , ex ) ; } } catch ( Throwable ex ) { if ( ex instanceof IOException ) throw ( IOException ) ex ; else throw new IOException ( ex . getMessage ( ) , ex ) ; } finally { inProgress = false ; } }
This is for importing project assets from Git into an environment .