pysvn操作svn

zhiying8710 2011-11-22 06:31:57
def cover_file(originitems, destitems, odir, ddir, client):
updateitems = []
additems = []
for item in originitems:
fpath = ddir + item
dir = os.path.dirname(fpath)
if not os.path.exists(dir):
os.makedirs(dir)
if item in destitems and os.path.exists(fpath):
os.remove(fpath)
file(fpath, 'wb').write(file(odir + item).read())
updateitems.append(fpath)
elif item not in destitems:
file(fpath, 'wb').write(file(odir + item).read())
additems.append(fpath)
if len(updateitems) > 0:
client.checkin(updateitems, '')
if len(additems) > 0:
client.add(ddir,force=True)

======================

我这pysvn调用得对吗....
...全文
343 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhiying8710 2011-11-28
  • 打赏
  • 举报
回复
自己研究通了, client.add之前需要将当前路径切换到在版本控制下的项目目录的上一级!
panghuhu250 2011-11-23
  • 打赏
  • 举报
回复
自己测试过了吗?

37,743

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧