Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:50:11+00:00 2026-06-11T04:50:11+00:00

I develop a Java program using the SVNKit library that will be responsible to

  • 0

I develop a Java program using the SVNKit library that will be responsible to update or commit a directory under version control.
The directory content can be changed by another program which I don’t have control, this program can add, delete or edit files ignoring to set subversion information.

Question is «How can my program know what to commit» ?

Because new files were not added I tried to process a doImport of rootDirectory but it causes an SVNException saying that file already exist at repository side.

SVNCommitClient cc = cm.getCommitClient();
cc.doImport(new File(subVersionedDirectory), SVNURL.parseURIEncoded(repositoryURL), "<import> " + commitMessage, null, false, true, SVNDepth.fromRecurse(true));

I also find a piece of code that will probably mark missing files as DELETED before commit

cc.setCommitParameters(new ISVNCommitParameters() {
   // delete even those files
   // that are not scheduled for deletion.
   public Action onMissingFile(File file) {
      return DELETE;
   }
   public Action onMissingDirectory(File file) {
      return DELETE;
   }

   // delete files from disk after committing deletion.
   public boolean onDirectoryDeletion(File directory) {
      return true;
   }
   public boolean onFileDeletion(File file) {
      return true;
   }
   });
   cc.doCommit(new File[]{new File(subVersionedDirectory)}, false, "<commit> " + commitMessage, null, null, false, true, SVNDepth.INFINITY);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:50:13+00:00Added an answer on June 11, 2026 at 4:50 am

    How can my program know what to commit?

    The solution I found is to use doStatus to set deleted and added files information to the working copy just before commit

    cm = SVNClientManager.newInstance(new DefaultSVNOptions());
    // Use do status to set deleted and added files information into SVN working copy management
    cm.getStatusClient().doStatus(subVersionedDirectory, SVNRevision.HEAD, SVNDepth.INFINITY, false, false, false, false, new ISVNStatusHandler() {
                @Override
                public void handleStatus(SVNStatus status) throws SVNException {
                    if (SVNStatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus())) {
                        cm.getWCClient().doAdd(status.getFile(), true, false, false, SVNDepth.EMPTY, false, false);
                    } else if (SVNStatusType.MISSING.equals(status.getNodeStatus())) {
                        cm.getWCClient().doDelete(status.getFile(), true, false, false);
                    }
                }
            }, null);        
    cm.getCommitClient().doCommit(new File[]{subVersionedDirectory}, false, "<commit> " + commitMessage, null, null, false, true, SVNDepth.INFINITY);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am using java to develop program that receives and processes SMS messages. I have
I want to develop a program using the Java MSN Messenger library ( JML
I have to develop a Java ME (formerly known as J2ME) application that will
I'm planning to develop program in Java which will provide diagnosis. The data set
I'm using Eclipse to develop a Java program, and figured I'd add an option
I am trying to develop a java program for networking where I require that
I am using Eclipse to develop Java program and I had to downgrade from
I'm trying to develop a Java program that does the following: uses a background
I am trying to develop a mobile app, that registered with a Java program
I am using Eclipse to develop a Java program. If I want to share

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.