2019独角兽企业重金招聘Python工程师标准>>>

1.创建补丁


2.导出补丁(选导出到文件系统就是个文件了,第3步可以读取解析源码路径)

补丁说明:

#项目内修改过的文件全路径

Index: src/sgcc/htjs/bussiness_examine_rule/action/RuleExamineAction.java
===================================================================

#这个应该是和svn进行对比的版本信息
--- src/sgcc/htjs/bussiness_examine_rule/action/RuleExamineAction.java    (revision 7495)
+++ src/sgcc/htjs/bussiness_examine_rule/action/RuleExamineAction.java    (working copy)
@@ -16,6 +16,7 @@
 import sgcc.htjs.bussiness_examine_rule.util.RuleExamineConstants;
 import sgcc.htjs.bussiness_examine_rule.vo.BusinessRulesVo;
 import sgcc.htjs.bussiness_examine_rule.vo.BusinessTypeVo;
+import sgcc.htjs.bussiness_examine_rule.vo.ConSupconProStand;
 import venus.frames.base.action.DefaultDispatchAction;
 import venus.frames.base.action.IForward;
 import venus.frames.base.action.IRequest;

#这个应该是修改内容相关的一些地址信息
@@ -43,11 +44,10 @@
      */
     public IForward listBusinessTypePage(DefaultForm formBean, IRequest request, IResponse response) throws Exception {
 #-表示删除的内容 +新增的内容。如果是更新原有内容,则是先-(删除) 再 +(新增)
-        String queryCondition = getQueryCondition(request);  //从request中获得查询条件
-        Object business_type= request.getParameter("business_type");
-        if(null != business_type && business_type.toString().length() > 0){
-            queryCondition += " business_type = " + business_type;
-        }
+//        Object business_type= request.getParameter("business_type");
+//        if(null != business_type && business_type.toString().length() > 0){
+//            queryCondition += " business_type = " + business_type;
+//        }
         if( !RmJspHelper.transctPageVo(request) ){  //翻页处理
           RmJspHelper.transctPageVo(request,0,getBs().getBusinessTypeCount(queryCondition));        
         }
@@ -331,4 +331,70 @@
         }
         return queryCondition;
     }
+    /**
+     * 合同变更工时设置列表页面
+     * @param formBean
+     * @param request
+     * @param response
+     * @return
+     * @throws Exception
+     */
+    public IForward con_cha_work_hour_list(DefaultForm formBean, IRequest request, IResponse response)throws Exception {
+        String queryCondition = getQueryCondition(request);  //从request中获得查询条件
+        Object business_type= request.getParameter("business_type");
+        if(null != business_type && business_type.toString().length() > 0){
+            queryCondition += " business_type = " + business_type;
+        }
+        List beans = getBs().getCon_cha_work_hour_list(queryCondition); 
+        request.setAttribute(REQUEST_BEANS, beans); 
+        request.setAttribute(REQUEST_WRITE_BACK_FORM_VALUES, RmVoHelper.getMapFromRequest((HttpServletRequest) request));  //回写表单
+        return request.findForward("con_cha_work_hour_list");
+    }
 }

3.执行文件导出代码中的源码或部署文件(这个可以自行定义路径信息)

import java.io.BufferedInputStream;  
import java.io.BufferedOutputStream;  
import java.io.BufferedReader;  
import java.io.File;  
import java.io.FileInputStream;  
import java.io.FileOutputStream;  
import java.io.IOException;  
import java.io.InputStreamReader;  
import java.util.ArrayList;  
import java.util.List;

public class FreePatchUtil {
      
    /** 
     * @param args 
     * @throws Exception  
     */  
    public static void main(String[] args) throws Exception {  
        String patchFile="D:/bosp2_htjs_gxl_2017-10-30/patchx.txt";//补丁文件,由eclipse svn plugin生成  
        List<String> updateFileList = getPatchFileList(patchFile);
//        String updateFile = "";
//        for(int i = 0,len=updateFileList.size();i<len;i++){
//            updateFile = updateFileList.get(i);
//            System.out.println(updateFile);
//        }
        copyFiles(updateFileList);  
        System.out.println("totals:"+updateFileList.size());
    }  
      
    public static List<String> getPatchFileList(String patchFile) throws Exception{  
        List<String> fileList=new ArrayList<String>();  
        FileInputStream f = new FileInputStream(patchFile);   
        BufferedReader dr=new BufferedReader(new InputStreamReader(f,"utf-8"));  
        String line;  
        while((line=dr.readLine())!=null){   
            if(line.indexOf("Index:") > -1){  
                line=line.replaceAll(" ","");  
                line=line.substring(line.indexOf(":")+1,line.length());  
                fileList.add(line);  
            }  
        }   
        return fileList;  
    }  
      
    private static String project_path="C:/VenusTools2010/workspace/BOSP_2v2";//源码项目路径  
    
    public static String des_project_path="D:/bosp2_htjs_gxl_2017-10-30/bosp_v2";//目标项目目录
    
    public static void copyFiles(List<String> list){  
        for(String fullFileName:list){  
            String source_file_path = project_path+ File.separator + fullFileName;  
            String des_file_path= des_project_path + File.separator + fullFileName;  
            File sourceFile=new File(source_file_path);  
            if(!sourceFile.exists()){
                System.out.println("sorry,file dose not exists:"+source_file_path);
                continue;
            }
            File desFile=new File(des_file_path);  
            if(!desFile.exists()){  
                String parent_parth = desFile.getParent();
                boolean file_create = new File(parent_parth).mkdirs();
                if(file_create){
                    try {
                        desFile.createNewFile();
                    } catch (IOException e) {
                        // XXX Auto-generated catch block
                        e.printStackTrace();
                    }    
                }
            }  
            copyFile(source_file_path, des_file_path);  
            System.out.println("copy done:");
            System.out.println(source_file_path);
            System.out.println("->"+des_file_path);
        }  
    }

private static void copyFile(String sourceFileNameStr, String desFileNameStr) {  
        File srcFile=new File(sourceFileNameStr);  
        File desFile=new File(desFileNameStr);  
        try {  
            copyFile(srcFile, desFile);  
        } catch (IOException e) {  
            e.printStackTrace();  
        }  
    }  
      
     public static void copyFile(File sourceFile, File targetFile) throws IOException {  
         BufferedInputStream inBuff = null;  
         BufferedOutputStream outBuff = null;  
         try {  
             // 新建文件输入流并对它进行缓冲  
             inBuff = new BufferedInputStream(new FileInputStream(sourceFile));  
   
             // 新建文件输出流并对它进行缓冲  
             outBuff = new BufferedOutputStream(new FileOutputStream(targetFile));  
   
             // 缓冲数组  
             byte[] b = new byte[1024 * 5];  
             int len;  
             while ((len = inBuff.read(b)) != -1) {  
                 outBuff.write(b, 0, len);  
             }  
             // 刷新此缓冲的输出流  
             outBuff.flush();  
         } finally {  
             // 关闭流  
             if (inBuff != null)  
                 inBuff.close();  
             if (outBuff != null)  
                 outBuff.close();  
         }  
     }

}
4.导出项目中的源码和指定路径的目录结构相同的目录文件信息(项目中可以比较方便的覆盖)

转载于:https://my.oschina.net/u/1052786/blog/1558172

大家应该都用过SVN,多个小组开发时,分小组提交代码,可是有特殊情况的,小组要穿插提交增量文件,该怎么做呢?SVN补丁是一种能导出变更增量的方法。...相关推荐

  1. PE文件和COFF文件格式分析——导出表的应用——一种摘掉Inline钩子(Unhook)的方法

    在日常应用中,某些程序往往会被第三方程序下钩子(hook).如果被下钩子的进程是我们的进程,并且第三方钩子严重影响了我们的逻辑和流程,我们就需要把这些钩子摘掉(Unhook).本件讲述一种在32位系统 ...

  2. Eclipse SVN 提交代码,出现Locked情况,问题分析

    情况描述: 最近做的一个项目,我是在项目开发中途参与的,从svn拉了项目之后,就直接进行开发了,到了code submit的时候,我同步代码,先是更新,然后出现更新失败,部分文件已经上锁的类似提示,我 ...

  3. 几种导入导出mysql数据库的方法(建议收藏)

    目录: 通过命令导出.导入mysql数据库 通过管理软件navicat 通过phpmyadmin (一)通过命令导出.导入mysql数据库 1.导出命令 (1)导出数据库 mysqldump -uro ...

  4. 0基础怎么做可视化大屏?2种可以节省95%时间的方法教给你

    如今的可视化大屏已结束快速发展的阶段,逐步趋于稳定.但对于零基础的小白来说,做可视化大屏这件事,本身还是会存在着一定的困难. 比如说,不知道怎么连接数据库,连接完后一旦数据口径发生明显的改变,或是数据 ...

  5. 【论文翻译】在不同数据结构中实现变更数据捕获方法以支持实时数据仓库的实验结果

    文章目录 在不同数据结构中实现变更数据捕获方法以支持实时数据仓库的实验结果 1 引言 2 相关工作 3 方法论 3.1 数据来源 3.2 变更数据捕获方法 4 分析和设计 4.1 环境准备 4.2 变 ...

  6. 增量压缩工具Xdelta3源码解析——增量文件(Header部分)

    前言 通过上一章我们详细介绍了Xdelta3定义的三种增量指令和默认指令代码表后,本章来解析一下编码时生成的增量文件. 由于内容比较多,所以这部分会分为两章来进行解析,这一章先对增量文件的头部内容进行 ...

  7. 解决SVN提交代码撤回---恢复上个版本(回滚)

    在提交代码难免回出现一些问题 想想把提交更新代码从svn上撤回来 1在提交代码的目录上打开 日志 2找到自己提交的代码版本 右击(回滚) 截图 截不到拍了张照凑合着看吧 这样就能 把提交的代码 回滚回 ...

  8. 计算机VFP输出方式有哪几种,VFP导出数据的方法大全

    你可以用多种方法将这些数据导出,以便被其它应用程序(如等)所用.下面向你简单介绍几种导出数据的方法: 1.用"导出数据"对话框.你可以从VFP主菜单中选择"文件/导出-& ...

  9. 三种测试华为手机真伪的方法,你确定都知道吗?学会可进行自查

    很多人进行购买手机时都怕买到山寨机,那么对于手机的真伪,我们应该如何查询呢?其实华为的官方渠道是不会出售山寨机以及翻新机的,其他渠道我们在购机时就要当心下,所购买的产品是否为翻新机,今天就跟大家分享三 ...

最新文章

  1. LeetCode实战:寻找两个有序数组的中位数
  2. PyTorch核心贡献者开源书:《使用PyTorch进行深度学习》完整版现已发布!
  3. voxel 与 pixel
  4. socket网络编程——套接字地址结构
  5. 太爽了!宅男醒来后,发现自己变成了……
  6. C++开发者都应该使用的10个C++11特性
  7. 深入理解Lock的底层实现原理
  8. java中readline函数_自定义BufferedReader中read和readLine方法
  9. python编程首选_Java程序员值得探索的五种新编程语言,Python是首选?
  10. C# 基于 adb 控制安卓
  11. 计算机课程设计Servlet网上订餐系统【jsp+servlet+mysql】代码讲解安装调试
  12. 美赛O奖、F奖论文写作技巧!【微信公众号:校园数模】
  13. window下Python查看已经启动的进程名称并关闭
  14. 【历史上的今天】3 月 17 日:苹果起诉微软;CN 域名开放注册;赛博朋克之父出生
  15. matlab抢占时隙算法,ALOHA anti-collision、二进制数搜索算法以及帧时隙算法
  16. Docker容器搭建运行python深度学习环境
  17. java获取密钥长度_#1071 - 指定密钥太长;最大密钥长度为767字节
  18. Win10系统Jdk环境变量配置遇到'javac' 不是内部或外部命令,也不是可运行的程序 或批处理文件 解决办法。
  19. 什么是网站权重?如何提高网站权重?
  20. 移动互联网引发大融合与大变革

热门文章

  1. 深入理解滤波器!降噪的底层原理!滤波器到底是什么?
  2. win10远程服务器404错误,win10系统无法打开http://localhost出现404错误的修复教程
  3. 【2021.03.10】段描述符与段选择子、GDT、LDT
  4. 马斯洛提出动机理论_【错题本】马斯洛的需要层次理论
  5. JS javaScript 计算从出生到现在多少天
  6. 联通物联卡为什么没有网络_联通物联网卡怎么样?联通物联卡的查询官网是什么?...
  7. cdr显示内容服务器不可用,CorelDRAW常见问题及解决方案
  8. AAC音频编码格式介绍
  9. react-native转场动画,让你的APP瞬间绚丽起来
  10. 基于JAVA基于web的公益募捐网站计算机毕业设计源码+系统+mysql数据库+lw文档+部署