'use strict';
const svnUltimate = require('node-svn-ultimate');
const _ = require('lodash');
const path = require('path');
// const svnConfig = require('./svn_config');

module.exports = {

    init: function(pathDir, svnConfig, fn) {

        let cwd = process.cwd(),
            absPath;
        if (path.isAbsolute(pathDir)) {
            absPath = pathDir;
        } else {
            absPath = path.resolve(cwd, pathDir);
        }

        //创建svn 根目录
        svnUltimate.commands.mkdir(svnConfig.svn, {
            params: [
                '-m "init ' + svnConfig.tagName + ' "'
            ]
        }, function(err) {
            if(err){
                throw err;
            }
            //checkout项目，然后在项目中构建目录
            svnUltimate.commands.checkout(svnConfig.svn,absPath, function(err){
                if(err){
                    throw err;
                }
                //TODO 创建文件夹
                fn(absPath);
            });

            //TODO 创建相关tag目录以及qb目录



        });
    }
}

@@ -63,17 +63,20 @@
 ;%0Aconst 
-_
+path
  = requi
@@ -83,93 +83,556 @@
 re('
-lodash');%0Aconst path = require('path');%0A// const svnConfig = require('./svn_config');
+path');%0A%0A/**%0A * %E5%88%9D%E5%A7%8B%E5%8C%96TAG%E4%B8%8EQB%E6%96%87%E4%BB%B6%E5%A4%B9%0A * @param  %7B%5Btype%5D%7D svnConfig %5Bdescription%5D%0A * @return %7B%5Btype%5D%7D           %5Bdescription%5D%0A */%0Afunction buildQB(svnConfig) %7B%0A    svnUltimate.commands.mkdir(svnConfig.tagPath, %7B%0A        params: %5B'-m %22init tag ' + svnConfig.tagName + ' %22'%5D%0A    %7D,function(err)%7B%0A        if(err)%7B%0A            throw err;%0A        %7D%0A        svnUltimate.commands.mkdir(svnConfig.tagPath + '/qb/', %7B%0A            params:%5B'-m %22init qb%22'%5D%0A        %7D, function(err)%7B%0A            if(err) %7B%0A                throw err;%0A            %7D%0A        %7D);%0A    %7D);%0A%7D%0A%0A
 %0A%0Amo
@@ -1094,37 +1094,39 @@
 %7B%0A            if
+ 
 (err)
+ 
 %7B%0A              
@@ -1244,16 +1244,17 @@
 fig.svn,
+ 
 absPath,
@@ -1259,32 +1259,33 @@
 h, function(err)
+ 
 %7B%0A              
@@ -1280,37 +1280,39 @@
               if
+ 
 (err)
+ 
 %7B%0A              
@@ -1362,23 +1362,54 @@
         
-//TODO 
+buildQB(svnConfig);%0A                //
 %E5%88%9B%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9%0A  
@@ -1456,46 +1456,8 @@
 );%0A%0A
-            //TODO %E5%88%9B%E5%BB%BA%E7%9B%B8%E5%85%B3tag%E7%9B%AE%E5%BD%95%E4%BB%A5%E5%8F%8Aqb%E7%9B%AE%E5%BD%95%0A%0A%0A%0A
     

add build tag and qb