首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SVN版本号随每个文件而变化

SVN版本号随每个文件而变化
EN

Stack Overflow用户
提问于 2013-03-22 11:39:49
回答 1查看 279关注 0票数 0

我使用SVNKit从一个SVN Repo检入文件。给另一个人。

我的问题是

目标svn的版本随着每个文件的增加而增加。

例如:我从Repo签出了5个文件。A到Repo。B在一个承诺下。我期待回购的版本。B只增加了一个单位,但实际上变成了5个单位。

这是我的代码。"cubes“用于恢复我想要检出的文件信息。

代码语言:javascript
复制
for (int i=0; i<cubes.size();i++) {
    souRepo.getFile(cubes.get(i).getLocalPath()+"/"+cubes.get(i).getLocalFile(),cubes.get(i).getLocalVer(), fileProperties, baos);
    input  = new ByteArrayInputStream(baos.toByteArray() );
    SVNNodeKind nodeKind = tarRepo.checkPath( cubes.get(i).getLocalFile(),  -1 );
    editor = tarRepo.getCommitEditor(logMessage, new CommitMediator() );
    editor.openRoot(-1);

    if ( nodeKind == SVNNodeKind.NONE ) {
       editor.addFile(cubes.get(i).getLocalFile(), null, -1);
    } else {
       editor.openFile(cubes.get(i).getLocalFile(), -1);
    }   // end of else
    editor.applyTextDelta(cubes.get(i).getLocalFile(), null); 
    String baseChecksum = deltaGenerator.sendDelta(cubes.get(i).getLocalFile(), input, editor, true);
    editor.textDeltaEnd(cubes.get(i).getLocalFile() );
    editor.closeFile(cubes.get(i).getLocalFile(), baseChecksum);
    info =  editor.closeEdit();
}

任何想法都会很感谢~~

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-22 16:49:37

代码显示您每次提交一个文件。试试下面这样的代码:

代码语言:javascript
复制
editor = tarRepo.getCommitEditor(logMessage, new CommitMediator() );
editor.openRoot(-1);
for (int i=0; i<cubes.size();i++) {
    souRepo.getFile(cubes.get(i).getLocalPath()+"/"+cubes.get(i).getLocalFile(),cubes.get(i).getLocalVer(), fileProperties, baos);
    input  = new ByteArrayInputStream(baos.toByteArray() );
    SVNNodeKind nodeKind = tarRepo.checkPath( cubes.get(i).getLocalFile(),  -1 );

    if ( nodeKind == SVNNodeKind.NONE ) {
       editor.addFile(cubes.get(i).getLocalFile(), null, -1);
    } else {
       editor.openFile(cubes.get(i).getLocalFile(), -1);
    }   // end of else
    editor.applyTextDelta(cubes.get(i).getLocalFile(), null); 
    String baseChecksum = deltaGenerator.sendDelta(cubes.get(i).getLocalFile(), input, editor, true);
    editor.textDeltaEnd(cubes.get(i).getLocalFile() );
    editor.closeFile(cubes.get(i).getLocalFile(), baseChecksum);
}
info =  editor.closeEdit();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15562328

复制
相关文章

相似问题

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