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

Re: How to delete particular revision of file from SVN Repos

From: Hyrum K Wright <hyrum_at_hyrumwright.org>
Date: Thu, 23 Dec 2010 06:54:14 -0600

On Thu, Dec 23, 2010 at 2:33 AM, stsivaraj <stsivaraj_at_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 users_at_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
Received on 2010-12-23 13:54:53 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.