LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-23-2010, 02:49 AM   #1
stsivaraj
LQ Newbie
 
Registered: Dec 2010
Posts: 5

Rep: Reputation: 0
How to delete particular revision of file from SVN Repos


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..

Last edited by stsivaraj; 01-14-2011 at 12:09 AM.
 
Old 12-23-2010, 07:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,682

Rep: Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735Reputation: 1735
Merely saying 'it didn't work' and dumping some raw code is not a good way to get help. What happens? In what way did it not work? Any error messages you're keeping secret from us?
 
Old 12-27-2010, 10:30 PM   #3
stsivaraj
LQ Newbie
 
Registered: Dec 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Upgrade

Quote:
Originally Posted by acid_kewpie View Post
Merely saying 'it didn't work' and dumping some raw code is not a good way to get help. What happens? In what way did it not work? Any error messages you're keeping secret from us?
Hi Chirs,
There is no error i was getting at the moment. I think, i have to upgrade my svn kit version.
 
Old 12-28-2010, 12:34 AM   #4
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 3,653

Rep: Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038Reputation: 1038
http://subversion.apache.org/faq.html#removal

BTW, why would you want to do this, and why are you writing a Java program to do it?

Last edited by dugan; 12-28-2010 at 12:53 AM.
 
Old 01-10-2011, 12:16 AM   #5
stsivaraj
LQ Newbie
 
Registered: Dec 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I have situation to delete throug the SVN API(Java Code)

Quote:
Originally Posted by dugan View Post
http://subversion.apache.org/faq.html#removal

BTW, why would you want to do this, and why are you writing a Java program to do it?
Hi,
Thanks for your reply at all. I have situation to delete throug the SVN API(Java Code)
 
Old 01-10-2011, 01:00 AM   #6
stsivaraj
LQ Newbie
 
Registered: Dec 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Can i delete particular revision from SVN Repository using java code?

Hi,
I have one situation to delete particular revision of file from SVN repository. Am using tmatesoft svn.

Thanks in advance..
 
Old 01-10-2011, 10:59 PM   #7
stsivaraj
LQ Newbie
 
Registered: Dec 2010
Posts: 5

Original Poster
Rep: Reputation: 0
While deleting the revision i am getting this error...

Quote:
Originally Posted by stsivaraj View Post
Hi,
I have one situation to delete particular revision of file from SVN repository. Am using tmatesoft svn.

Thanks in advance..
Hi,
I have one situation to delete particular revision from SVN repository. So, am getting this error.

org.tmatesoft.svn.core.SVNException: svn: Item '/cixAdmin/docColl/344/Enhancements List.ods' is out of date
svn: DELETE of '/svn-repos/cixAdmin/!svn/wrk/2d60616f-2d01-0010-9029-cb9e00ce62c0/cixAdmin/docColl/344/Enhancements%20List.ods': 409 Conflict (http://efycaci.stg.com)

and

org.tmatesoft.svn.core.SVNException: svn: File or directory '/cixAdmin/docColl/344/Enhancements%20List.ods' is out of date; try updating
svn: The version resource does not correspond to the resource within the transaction. Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit).
svn: CHECKOUT of '/svn-repos/cixAdmin/!svn/ver/13050/cixAdmin/docColl/344/Enhancements%20List.ods': 409 Conflict (http://efycaci.stg.com)

I have pasted my code in this cyclic mail(at top). Is it possible to delete revision from repository?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
svn checkout by revision number prayag_pjs Linux - Newbie 2 11-03-2009 07:44 AM
How to Add projects to SVN keeping revision/ history? your_shadow03 Linux - Server 1 06-10-2009 09:21 AM
Merging Two SVN Repos? your_shadow03 Linux - Server 1 03-13-2009 08:53 AM
svn restore directory to a revision also removing files not part of revision Four Linux - Software 1 03-03-2009 04:18 PM
SVN: Is it possible to commit to multiple Subversion repos? nathacof Linux - Software 1 07-22-2007 08:15 PM


All times are GMT -5. The time now is 02:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration