On Thu, Dec 23, 2010 at 2:33 AM, stsivaraj <stsiva...@yahoo.co.in> wrote:
>
> 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..

Your message is not about developing Subversion, but about it's usage.
 Please redirect your query to us...@subversion.apache.org.

In short, though, Subversion does not have a direct method for
removing revision history.  The solution to your problem will likely
be a combination of 'svnadmin dump' / 'svnadmin load' and
'svndumpfilter'.

-Hyrum

Reply via email to