[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

How to delete particular revision of file from SVN Repos

From: stsivaraj <stsivaraj_at_yahoo.co.in>
Date: Thu, 23 Dec 2010 00:33:57 -0800 (PST)

Hi All,
         I am using Subversion version1.2 and need one favour. I have
written code to delete particular revision from SVN Repository.
Unfortunately, i couldn't delete particular version from repository. Any one
can response me.. how to delete?

public void deleteDocRevision(String collDir, String fileName, Long revNum)
                        throws SVNException {
                if (logger.isDebugEnabled()) {
                        logger.debug("deleteDocRevision(String, String, Long) - start");
//$NON-NLS-1$
                }

                String path = this.getPath() + "/" + DOC_COLL_FOLDER_NAME;
                path = path + "/" + collDir;
                String filePath = path + "/" + fileName;

                SVNNodeKind kind = this.getTheRepository().checkPath(filePath, revNum);

                if (kind == SVNNodeKind.NONE) {
                        SVNErrorMessage message = SVNErrorMessage.create(
                                        SVNErrorCode.BAD_FILENAME, filePath + " Not found");
                        throw new SVNException(message);
                }

                try {

                        ISVNEditor editor = this.getTheRepository().getCommitEditor(
                                        "file deleted", null);
                        editor.openRoot(-1);
                        editor.deleteEntry(filePath, revNum);
                        editor.closeDir();
                        editor.closeEdit();
                } catch (Exception e) {

                        logger.error("deleteDocRevision(String, String, Long)", e); //$NON-NLS-1$
                        e.printStackTrace();
                }

                if (logger.isDebugEnabled()) {
                        logger.debug("deleteDocRevision(String, String, Long) - end");
//$NON-NLS-1$
                }
        }

        Can you help me? Thanks in advance..

-- 
View this message in context: http://old.nabble.com/How-to-delete-particular-revision-of-file-from-SVN-Repos-tp30520057p30520057.html
Sent from the Subversion Dev mailing list archive at Nabble.com.
Received on 2010-12-23 09:34:31 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.