SVN 创建分支
2种方法:
创建分支之前一定要先更新到最新版本号。
1.你用tortoiseSVN点版本号库浏览,在须要建立分支的路径(比方trunk)点copy to + 新分支名称(注意:必须与trunk不能同名,你能够新建一个名称比方branch),然后在分支文件夹的根文件夹update。2.tortoiseSVN点版本号库浏览,你在须要创建的路径下右键tortoiseSVN 选择create folder 然后创建新路径名称(目录)然后把主干或者其它分支路径的代码(拉分支这样的情况预计想并行开发)导入到这个路径下就能够了。然后在分支目录的根目录update。
创建分支是否成功,在分支目录里面 TortoiseSVN ---->版本号库浏览器 定位的是分支路径那就对了。假设还是主干路径那创建分支就有问题了。
注意:1、假设分支文件夹在没有分支的情况下check out下来的项目,这时候工作副本相应版本号库的路径仍为原来相应的主干的文件夹。所以在client文本夹中删除之后 再从serverUpdate分支的项目。不能用clientSVN delete。这样会删除主干上的项目。
2、假设是多个项目,仅仅保留几个项目做分支。那就从版本号库浏览器中分支的项目右键删除,不能从本地svn delete。这样会删除主干上的项目。
改动相关文件项目名,这样就能引入eclipse 了
/gjmj/mallv2/branchs/gjmj_20141110/shop/.classpath
/gjmj/mallv2/branchs/gjmj_20141110/shop/.project
/gjmj/mallv2/branchs/gjmj_20141110/shop/WebRoot/WEB-INF/web.xml
/gjmj/mallv2/branchs/gjmj_20141110/shop/config/boot.xml
/gjmj/mallv2/branchs/gjmj_20141110/shop/config/ui/path.xml
以下修改相关文件项目名的代码依据详细须要修改
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; /** * 1、改动多个项目的路径,以便导入eclipse * 2、所有替换gjmj_20141110为分支目录 * @author Coco * */ public class FileContentReplace { private static String REPLACE_SRC_FILE = "E:\\workspaces\\gjmj\\mallv2\\branchs\\gjmj_20141110"; private static String REPLACE_EXCLUDE_FILE = "E:\\Workspaces\\gjmj\\mallv2\\branchs\\gjmj_20141110\\core\\WebRoot\\sr;E:\\Workspaces\\gjmj\\mallv2\\branchs\\gjmj_20141110\\core\\WebRoot\\upload;E:\\Workspaces\\gjmj\\mallv2\\branchs\\gjmj_20141110\\core\\WebRoot\\WEB-INF\\lib;toruk.xml"; private static String REPLACE_CONTENT = "gjmj_mallv2->gjmj_20141110;E:/Workspaces/gjmj/mallv2/project/->E:/Workspaces/gjmj/mallv2/branchs/gjmj_20141110/;E:/workspaces/gjmj/mallv2/project/->E:/workspaces/gjmj/mallv2/branchs/gjmj_20141110/"; public static List<String> EXCLUDE_FILE_LIST = null; public static Map<String,String> getReplaceMaping() { Map<String,String> map = new HashMap<String,String>(); if(REPLACE_CONTENT!=null){ String[] repContentArr = REPLACE_CONTENT.split(";"); for(String repMap:repContentArr){ String[] arg = repMap.split("->"); if(arg.length!=2){ throw new RuntimeException(repMap+"不对"); }else{ map.put(arg[0], arg[1]); } } } return map; } public static List<String> excludeFileList(){ if(EXCLUDE_FILE_LIST==null){ EXCLUDE_FILE_LIST = new ArrayList<String>(); if(REPLACE_EXCLUDE_FILE!=null){ String[] strArr = REPLACE_EXCLUDE_FILE.split(";"); for(String str:strArr){ EXCLUDE_FILE_LIST.add(str.trim()); } } return EXCLUDE_FILE_LIST; }else{ return EXCLUDE_FILE_LIST; } } public static void handFile(File infile,String fromCharSet,String toCharSet) throws Exception{ if(infile.getName().equals(".svn")){ return; } if(infile.getName().contains("!")){ return; } for(String excludeFile:excludeFileList()){ if(infile.getPath().toLowerCase().contains(excludeFile.toLowerCase())||infile.getName().equals(excludeFile)){ return; } } BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream(infile), fromCharSet)); String reading; String content = ""; while ((reading = in.readLine()) != null) { content +=reading+"\r\n"; } boolean flag = false; Map<String,String> replaceMapping = getReplaceMaping(); if(replaceMapping!=null){ Set<Map.Entry<String, String>> replaceEntrys = replaceMapping.entrySet(); for(Iterator<Map.Entry<String, String>> it = replaceEntrys.iterator();it.hasNext();){ Map.Entry<String, String> entry = it.next(); String key = entry.getKey(); if(content.contains(key)){ flag = true; } } } if(flag){ File outfile = new File(infile + ".tmp"); PrintWriter out = new PrintWriter(new BufferedWriter( new OutputStreamWriter(new FileOutputStream(outfile), toCharSet))); if(replaceMapping!=null){ Set<Map.Entry<String, String>> replaceEntrys = replaceMapping.entrySet(); for(Iterator<Map.Entry<String, String>> it = replaceEntrys.iterator();it.hasNext();){ Map.Entry<String, String> entry = it.next(); String key = entry.getKey(); String value = entry.getValue(); content = content.replaceAll(key, value); } System.out.println("替换文件:"+infile.getPath()); } out.println(content); out.flush(); out.close(); in.close(); infile.delete(); outfile.renameTo(infile); }else{ in.close(); } } public static void main(String[] args) throws Exception { replaceFile(new File(REPLACE_SRC_FILE),"UTF-8","UTF-8"); } public static void replaceFile(File filePath,String fromCharSet,String toCharSet) throws Exception{ if(filePath.exists()==false){ new RuntimeException(filePath.getPath()+"不存在"); } if(filePath.getName().equals(".svn")){ return; } for(String excludeFile:excludeFileList()){ if(filePath.getPath().toLowerCase().contains(excludeFile.toLowerCase())){ return; } } if(filePath.isDirectory()){ File[] childFiles = filePath.listFiles(); if(childFiles!=null){ for(File childFile:childFiles){ if(childFile.isFile()){ handFile(childFile,fromCharSet, toCharSet); }else{ replaceFile(childFile,fromCharSet, toCharSet); } } } }else{ handFile(filePath,fromCharSet, toCharSet); } } }
相关文章
- git从指定的commit创建分支
- 创建一个没有父节点的分支
- svn根据项目来创建目录结构或者根据分支来创建项目结构
- VS中 无法创建虚拟目录 本地IIS IIS Express 外部主机
- Word控件Spire.Doc 【表单域】教程(七):在 C#、VB.NET 中的 Word 中创建对书签的交叉引用
- 《穿越时空的git》之创建版本库和常用命令操作
- Idea:Git的常用菜单操作和常用命令【含分支创建、检出、提交、合并】
- 使用 Python 创建你自己的 Shell(下)
- linux创建新的虚拟环境,并安装指定版本的包
- Qt中创建、写入、删除(INI、XML文件)
- 创建多线程类
- SAP RETAIL 使用事务代码MM41创建商品主数据时不能激活检验类型?
- 《Git学习指南》——1.3 分支的创建与合并很简单
- SwiftUI 中使用 SpriteKit 创建雨动画效果(教程含源码)
- 力扣解法汇总606-根据二叉树创建字符串
- Laravel如何用artisan创建监听器
- GitHub分支创建及合并
- Github 之 分支 branch 操作之 查看分支/创建分支/切换分支/提交分支/删除分支/合并分支 等操作
- 5创建型模式之简单工厂模式
- D1net阅闻:硅谷资深投资者与IDG资本创建10亿美元中国风投基金
- CAD怎么创建多个视口?CAD视口创建技巧
- 创建一个简单QT桌面应用
- git 入门(创建与合并分支、解决冲突、分支策略、bug分支)
- java idea 创建第一个java 程序