首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >pysvn import_ pysvn._pysvn_3_6.ClientError:导入文件时需要新的条目名称

pysvn import_ pysvn._pysvn_3_6.ClientError:导入文件时需要新的条目名称
EN

Stack Overflow用户
提问于 2018-08-17 06:13:27
回答 1查看 300关注 0票数 0
代码语言:javascript
运行
复制
client = pysvn.Client();
client.callback_get_login = get_login ;

drList = re.findall(r"[A-Z]+:.*$",os.popen("mountvol /").read(),re.MULTILINE) ;
for rootDir in drList:
    #for item in  [os.path.join(rootdir, file ) for rootdir, sbuFolders, files in os.walk(rootDir, topdown=True) for d in rootdir if d not in config.get('inc_exc','exclude_prefixes')  for file in files ]:
    for rootdir, subFolders, files in os.walk(rootDir, topdown=True):
        subFolders[:] = [d for d in subFolders if d not in config.get('inc_exc','exclude_prefixes')]
        print ( rootdir );
        print ( client.import_( rootdir  , "http://localhost/svn/repo1" , 'checking' ,         recurse=False,         ignore=False,     autoprops=False ) );

代码成功导入数据,但由于重复重试导致导入重复文件错误

代码语言:javascript
运行
复制
print ( client.import_( os.path.join ( rootdir , file )   , "http://localhost/svn/repo1" , 'checking' ,         recurse=False,         ignore=False,     autoprops=False ) );

失败并显示: pysvn._pysvn_3_6.ClientError:导入文件时需要新条目名称

代码语言:javascript
运行
复制
print ( client.import_( os.path.abspath( os.path.join ( rootdir , file ) )   , "http://localhost/svn/repo1" , 'checking' ,         recurse=False,         ignore=False,     autoprops=False ) );

失败并返回pysvn._pysvn_3_6.ClientError:导入文件时需要新条目名称

任何见解都会受到高度赞赏。

EN

回答 1

Stack Overflow用户

发布于 2018-08-18 08:37:40

代码语言:javascript
运行
复制
print ( client.import_( os.path.join(root, file)  , "http://localhost/svn/repo1/"  +  root.replace ( os.path.sep , '/' ).replace(':','')+'/'+file  , 'checking' , recurse=True, ignore=False, autoprops=False ) );

以下代码起作用了

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51890282

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档