This commit is contained in:
wuaho 2021-10-18 11:05:35 +08:00
parent c783389276
commit 101182f907
2 changed files with 53 additions and 1 deletions

2
.gitignore vendored
View File

@ -128,4 +128,4 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
.idea

52
main.py Normal file
View File

@ -0,0 +1,52 @@
# coding:utf-8
import os
import subprocess
class SvnUP:
def __init__(self, root_path):
self.json_files = set()
self.root_path = root_path
self.skeleton_json_files = set()
self.file_count = 0
self.error_file = set()
def check_all_file(self, path):
"""
取所有文件
:param path:
:return:
"""
if '.svn' in path:
return
all_files = os.listdir(path)
for file in all_files:
filepath = os.path.join(path, file)
# print(filepath)
self.file_count += 1
if os.path.isdir(filepath):
self.check_all_file(filepath)
cmd = fr"""svn update {filepath}"""
try:
status, output = subprocess.getstatusoutput(cmd)
# print(output)
if 'svn: E130003' in output:
print('='*50)
print(filepath)
print(output)
self.error_file.add(filepath)
except Exception as e:
print('=' * 50)
print(e)
self.error_file.add(filepath)
def run(self):
self.check_all_file(self.root_path)
print('*' * 50)
for i in self.error_file:
print(i)
if __name__ == '__main__':
up = SvnUP(r'I:\work\SVN\new_shenghua\cehua\EXCEL')
up.run()