You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Zia Syed <zs...@comp.rgu.ac.uk> on 2004/12/09 22:41:13 UTC

Is it possible to delete last revision?

Hi, 

I'm new to subversion and would like to know if it is possible to delete
the last revision from the repository? I've mistakenly commited some
code with known problems (my stupidity) in the repository, and would
like to delete it now just to keep the repository clean with last stable
version. If its not possible then I guess I will have to make another
revision. 

Also, is it possible to write comments to revisions after commit? 

Thanks,
Zia


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Is it possible to delete last revision?

Posted by Ben Collins-Sussman <su...@collab.net>.
On Dec 9, 2004, at 4:41 PM, Zia Syed wrote:

> Hi,
>
> I'm new to subversion and would like to know if it is possible to 
> delete
> the last revision from the repository? I've mistakenly commited some
> code with known problems (my stupidity) in the repository, and would
> like to delete it now just to keep the repository clean with last 
> stable
> version. If its not possible then I guess I will have to make another
> revision.

You can't remove revisions.  But you can commit a new revision that 
'undoes' the change.  Read about it in chapter 4, 'undoing changes'.


>
> Also, is it possible to write comments to revisions after commit?
>

You can edit any commit log-message by running

    svn propedit --revprop -r REVNUM svn:log



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Is it possible to delete last revision?

Posted by Zia Syed <zs...@comp.rgu.ac.uk>.
Hi, 
Thanks for your replies. I've copied the .tmpl file to
pre-revprop-change in hooks directory. Restarted the svnserve and use
the following command in the checked out (working) copye of the code. I
get the following error...
 
[root@zs irman]# svn propedit --revprop -r 42 svn:log --username xx
--password xxxx
No changes to property 'svn:log' on revision 42

I've set SVN_EDITOR to gvim but i get the No change message before gvim
loads up. Any ideas?

Thanks,

Zia

On Thu, 2004-12-09 at 23:15, Patrick Smears wrote:
> On Thu, 9 Dec 2004, Zia Syed wrote:
> 
> > Hi, 
> > 
> > I'm new to subversion and would like to know if it is possible to delete
> > the last revision from the repository? I've mistakenly commited some
> > code with known problems (my stupidity) in the repository, and would
> > like to delete it now just to keep the repository clean with last stable
> > version. If its not possible then I guess I will have to make another
> > revision. 
> 
> You can't delete a revision, but what you can do (if nobody has committed
> since) is to perform a dump of the repository (look at the documentation
> for 'svnadmin dump'), specifying only the revisions that you want (ie if
> you've just mistakenly committed r6, you'd dump r1-5, "-r 1:5"), and then
> delete/restore the repository from that dump - that will effectively
> remove the last revision. (But be careful, and preferably back up your
> repository before doing this!)
> 
> > Also, is it possible to write comments to revisions after commit? 
> 
> Yes, use "svn propedit --revprop -r <REVNUM> svn:log". But by default this
> is not permitted - you'll need to set up a pre-revprop-change hook. That's 
> much easier to do than it sounds: go into the directory <repos>/hooks, and 
> rename the file "pre-revprop-change.tmpl" to "pre-revprop-change", and 
> ensure it's executable. [ I'm assuming you're running Linux/other Unix 
> here, if you're running Windows the procedure will be different... ]
> 
> Patrick


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Is it possible to delete last revision?

Posted by Patrick Smears <pa...@ensoft.co.uk>.
On Thu, 9 Dec 2004, Zia Syed wrote:

> Hi, 
> 
> I'm new to subversion and would like to know if it is possible to delete
> the last revision from the repository? I've mistakenly commited some
> code with known problems (my stupidity) in the repository, and would
> like to delete it now just to keep the repository clean with last stable
> version. If its not possible then I guess I will have to make another
> revision. 

You can't delete a revision, but what you can do (if nobody has committed
since) is to perform a dump of the repository (look at the documentation
for 'svnadmin dump'), specifying only the revisions that you want (ie if
you've just mistakenly committed r6, you'd dump r1-5, "-r 1:5"), and then
delete/restore the repository from that dump - that will effectively
remove the last revision. (But be careful, and preferably back up your
repository before doing this!)

> Also, is it possible to write comments to revisions after commit? 

Yes, use "svn propedit --revprop -r <REVNUM> svn:log". But by default this
is not permitted - you'll need to set up a pre-revprop-change hook. That's 
much easier to do than it sounds: go into the directory <repos>/hooks, and 
rename the file "pre-revprop-change.tmpl" to "pre-revprop-change", and 
ensure it's executable. [ I'm assuming you're running Linux/other Unix 
here, if you're running Windows the procedure will be different... ]

Patrick
-- 
The easy way to type accents in Windows: http://www.frkeys.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org