简体   繁体   中英

setCopyContents SVNKit. How to create branch on existing branch without branch content?

Assume I create a Branch1 on existing branch Branches\\ the following way using SVNKit:

SVNCopyClient copyClient = new SVNCopyClient(authManager, options);
SVNCopySource copySource = new SVNCopySource(SVNRevision.UNDEFINED, SVNRevision.HEAD, sourceUrl);
copySource.setCopyContents(false);

copyClient.doCopy(new SVNCopySource[] { copySource }, toUrl, 
        false, // isMove
        true,  // make parents
        true,  // failWhenDstExists
        commitMessage, // commit message
        null); // SVNProperties

All works nice, branch created. Then I want to create Branch2 on the same source branch using previous code. Branch2 created, but included existing source branch conent, ie Branch1. So the branches structure is:

  • Branches\\
  • Branches\\Branch1
  • Branches\\Branch2\\Branch1

Seems SVNKit uses the source branch including its content as a source for Branch2. According to documentation setCopyContents(false) should exclude this content but it does not. What am I doing wrong?

Fugured out. I used copy operation so all worked as disigned. Need to use mkDir operation instead in such cases.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM