# -*-coding:utf-8-*-
import sys
import os
import os.path
import time
import datetime
import shutil
import math
ProjectPath = sys.argv[1]
Tapd = sys.argv[2]
TargetProjectPath = sys.argv[3]
LogPath = sys.argv[4]
UrlPath = "YourURLPath"
#获取年月日时分
def Get_Time():
return time.strftime('%Y%m%d%H%M',time.localtime(time.time()))
#获取年月日时分秒
def Get_Time2():
return time.strftime('%Y%m%d%H%M%S',time.localtime(time.time()))
#获取年月日时分秒
def Get_Time3():
return time.strftime('%Y%m%d',time.localtime(time.time()))
#获取年-月-日
def Get_Time4(lastTime):
return time.strftime('%Y-%m-%d',time.localtime(time.time()-lastTime))
def Print_Func(Str):
print(Str)
sys.stdout.flush()
def Print_Func2(Str1,Str2):
print('{0}:{1}'.format(Str1,Str2))
sys.stdout.flush()
def Svn_Clean(Path):
cmd_str = "svn cleanup %s --non-interactive" % (Path)
output_file = os.popen(cmd_str)
for outline in output_file.readlines():
print(outline)
sys.stdout.flush()
def Svn_Revert(Path):
cmd_str = "svn revert %s -R --non-interactive" % (Path)
output_file = os.popen(cmd_str)
for outline in output_file.readlines():
print(outline)
sys.stdout.flush()
def Svn_Update(Path,Version):
cmd_str = "svn up -r %s %s --non-interactive" % (Version,Path)
output_file = os.popen(cmd_str)
for outline in output_file.readlines():
print(outline)
sys.stdout.flush()
def Svn_UpdateExternals(Path,Version):
externalSvnCmd = "svn pg svn:externals %s" % Path
targetList = os.popen(externalSvnCmd)
for line in targetList.readlines():
print(line)
line.strip()
if not line.startswith("http"):
cmd_str = "svn up -r %s %s\%s --non-interactive" % (Version,Path,line)
output_file = os.popen(cmd_str)
for outline in output_file.readlines():
print(outline)
sys.stdout.flush()
def Svn_Add(Path):
cmd_str = "svn add %s" % (Path)
output_file = os.popen(cmd_str)
for outline in output_file.readlines():
print(outline)
sys.stdout.flush()
def Svn_Commit(Path,Desc):
cmd_str = "svn commit -m %s %s" % (Desc,Path)
output_file = os.popen(cmd_str)
for outline in output_file.readlines():
print(outline)
sys.stdout.flush()
def Svn_Version(Path):
cmd_str = "
一个SVN自动merge的小工具
于 2022-03-04 17:53:57 首次发布