You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Giulio Troccoli <Gi...@uk.linedata.com> on 2008/02/06 10:10:21 UTC
Reverting a delete
One developer deleted a file (with svn delete) and committed. Now we
want that file back. I can think of two ways to do that:
1. update to the revision before the deletion, make a copy of the file,
update to HEAD, move back the file, svn add and svn commit
2. update to HEAD, reverse merge the revison that deleted the file (svn
merge -c-<rev>), svn commit
The end result is obviously the same: I will have my file back. However:
- the first method does not preserve the history of the file
- none of the methods is a cheap copy
Am I right? Is there a way to reverse that deletion, preserving the
history and with a cheap copy? In this case, I'm not too bothered about
cheap or non-cheap copies, as it's just one small file. But it would be
nice to know if it's possible it case I would need to do the same for
more and/or larger files.
Giulio
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by marc gonzalez-carnicer <ca...@gmail.com>.
very interesting, thanks.
2008/2/6, Andy Levy <an...@gmail.com>:
> On Feb 6, 2008 5:30 AM, Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> > Thanks Jean-Claude, don't know why I didn't think of this very simple solution, which does exactly what I want: preserve history and cheap copy.
>
> See also http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.resurrect
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Andy Levy <an...@gmail.com>.
On Feb 6, 2008 5:30 AM, Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> Thanks Jean-Claude, don't know why I didn't think of this very simple solution, which does exactly what I want: preserve history and cheap copy.
See also http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.resurrect
> > -----Original Message-----
> > From: Jean-Claude Antonio [mailto:jcantonio@arcetis.com]
> > Sent: 06 February 2008 10:23
> > To: Giulio Troccoli
> > Cc: users@subversion.tigris.org
> > Subject: Re: Reverting a delete
> >
> > Hi,
> >
> > If you want to keep history you can use:
> > svn copy -r (the revision before it was deleted) url_to_path url_to_path
> > Cheers,
> >
> >
> > Giulio Troccoli a écrit :
> > > One developer deleted a file (with svn delete) and committed. Now we
> > > want that file back. I can think of two ways to do that:
> > >
> > > 1. update to the revision before the deletion, make a copy of the file,
> > > update to HEAD, move back the file, svn add and svn commit
> > > 2. update to HEAD, reverse merge the revison that deleted the file (svn
> > > merge -c-<rev>), svn commit
> > >
> > > The end result is obviously the same: I will have my file back. However:
> > > - the first method does not preserve the history of the file
> > > - none of the methods is a cheap copy
> > >
> > > Am I right? Is there a way to reverse that deletion, preserving the
> > > history and with a cheap copy? In this case, I'm not too bothered about
> > > cheap or non-cheap copies, as it's just one small file. But it would be
> > > nice to know if it's possible it case I would need to do the same for
> > > more and/or larger files.
> > >
> > > Giulio
> > >
> > >
> > > Linedata Services (UK) Ltd
> > > Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1
> > 6DB
> > > Registered in England and Wales No 3027851 VAT Reg No 778499447
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > > For additional commands, e-mail: users-help@subversion.tigris.org
> > >
> > >
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Reverting a delete
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
Thanks Jean-Claude, don't know why I didn't think of this very simple solution, which does exactly what I want: preserve history and cheap copy.
Thanks
Giulio
> -----Original Message-----
> From: Jean-Claude Antonio [mailto:jcantonio@arcetis.com]
> Sent: 06 February 2008 10:23
> To: Giulio Troccoli
> Cc: users@subversion.tigris.org
> Subject: Re: Reverting a delete
>
> Hi,
>
> If you want to keep history you can use:
> svn copy -r (the revision before it was deleted) url_to_path url_to_path
> Cheers,
>
>
> Giulio Troccoli a écrit :
> > One developer deleted a file (with svn delete) and committed. Now we
> > want that file back. I can think of two ways to do that:
> >
> > 1. update to the revision before the deletion, make a copy of the file,
> > update to HEAD, move back the file, svn add and svn commit
> > 2. update to HEAD, reverse merge the revison that deleted the file (svn
> > merge -c-<rev>), svn commit
> >
> > The end result is obviously the same: I will have my file back. However:
> > - the first method does not preserve the history of the file
> > - none of the methods is a cheap copy
> >
> > Am I right? Is there a way to reverse that deletion, preserving the
> > history and with a cheap copy? In this case, I'm not too bothered about
> > cheap or non-cheap copies, as it's just one small file. But it would be
> > nice to know if it's possible it case I would need to do the same for
> > more and/or larger files.
> >
> > Giulio
> >
> >
> > Linedata Services (UK) Ltd
> > Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1
> 6DB
> > Registered in England and Wales No 3027851 VAT Reg No 778499447
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> >
> >
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Mark Reibert <sv...@reibert.com>.
On Wed, 2008-02-06 at 21:55 -0600, Ryan Schmidt wrote:
> > I think you'll also need a peg revision in there:
> >
> > svn copy -r<rev> url_to_path@<rev> url_to_path
> >
> > Where <rev> is the revision just before the delete was commited.
>
> You'd think so, but svn copy doesn't support peg revisions until
> Subversion 1.5.0.
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2546
Well that is interesting ... and explains the problem I had on a
different thread on this list a couple of weeks back:
http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=74050
Thanks for the insight.
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 6, 2008, at 22:20, Troy Curtis Jr wrote:
> On Feb 6, 2008 9:55 PM, Ryan Schmidt wrote:
>
>> On Feb 6, 2008, at 21:42, Troy Curtis Jr wrote:
>>
>>> On Feb 6, 2008 4:23 AM, Jean-Claude Antonio wrote:
>>>
>>>> If you want to keep history you can use:
>>>> svn copy -r (the revision before it was deleted) url_to_path
>>>> url_to_path
>>>
>>> I think you'll also need a peg revision in there:
>>>
>>> svn copy -r<rev> url_to_path@<rev> url_to_path
>>>
>>> Where <rev> is the revision just before the delete was commited.
>>
>> You'd think so, but svn copy doesn't support peg revisions until
>> Subversion 1.5.0.
>>
>> http://subversion.tigris.org/issues/show_bug.cgi?id=2546
>
> Craziness! So does it work without peg revisions as Jean-Claude says?
It does work, in 1.4. Not sure how it'll work in 1.5.
> It seems to go against everything else! How strange!
It does seem crazy. :) I guess that's why they're fixing it.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Troy Curtis Jr <tr...@gmail.com>.
On Feb 6, 2008 9:55 PM, Ryan Schmidt <su...@ryandesign.com> wrote:
> On Feb 6, 2008, at 21:42, Troy Curtis Jr wrote:
>
> > On Feb 6, 2008 4:23 AM, Jean-Claude Antonio wrote:
> >
> >> Giulio Troccoli a écrit :
> >>
> >>> One developer deleted a file (with svn delete) and committed. Now we
> >>> want that file back. I can think of two ways to do that:
> >>>
> >>> 1. update to the revision before the deletion, make a copy of the
> >>> file,
> >>> update to HEAD, move back the file, svn add and svn commit
> >>> 2. update to HEAD, reverse merge the revison that deleted the
> >>> file (svn
> >>> merge -c-<rev>), svn commit
> >>>
> >>> The end result is obviously the same: I will have my file back.
> >>> However:
> >>> - the first method does not preserve the history of the file
> >>> - none of the methods is a cheap copy
> >>>
> >>> Am I right? Is there a way to reverse that deletion, preserving the
> >>> history and with a cheap copy? In this case, I'm not too bothered
> >>> about
> >>> cheap or non-cheap copies, as it's just one small file. But it
> >>> would be
> >>> nice to know if it's possible it case I would need to do the same
> >>> for
> >>> more and/or larger files.
> >>
> >> If you want to keep history you can use:
> >> svn copy -r (the revision before it was deleted) url_to_path
> >> url_to_path
> >
> > I think you'll also need a peg revision in there:
> >
> > svn copy -r<rev> url_to_path@<rev> url_to_path
> >
> > Where <rev> is the revision just before the delete was commited.
>
> You'd think so, but svn copy doesn't support peg revisions until
> Subversion 1.5.0.
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2546
>
>
>
>
Craziness! So does it work without peg revisions as Jean-Claude says?
It seems to go against everything else! How strange!
Troy
--
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 6, 2008, at 21:42, Troy Curtis Jr wrote:
> On Feb 6, 2008 4:23 AM, Jean-Claude Antonio wrote:
>
>> Giulio Troccoli a écrit :
>>
>>> One developer deleted a file (with svn delete) and committed. Now we
>>> want that file back. I can think of two ways to do that:
>>>
>>> 1. update to the revision before the deletion, make a copy of the
>>> file,
>>> update to HEAD, move back the file, svn add and svn commit
>>> 2. update to HEAD, reverse merge the revison that deleted the
>>> file (svn
>>> merge -c-<rev>), svn commit
>>>
>>> The end result is obviously the same: I will have my file back.
>>> However:
>>> - the first method does not preserve the history of the file
>>> - none of the methods is a cheap copy
>>>
>>> Am I right? Is there a way to reverse that deletion, preserving the
>>> history and with a cheap copy? In this case, I'm not too bothered
>>> about
>>> cheap or non-cheap copies, as it's just one small file. But it
>>> would be
>>> nice to know if it's possible it case I would need to do the same
>>> for
>>> more and/or larger files.
>>
>> If you want to keep history you can use:
>> svn copy -r (the revision before it was deleted) url_to_path
>> url_to_path
>
> I think you'll also need a peg revision in there:
>
> svn copy -r<rev> url_to_path@<rev> url_to_path
>
> Where <rev> is the revision just before the delete was commited.
You'd think so, but svn copy doesn't support peg revisions until
Subversion 1.5.0.
http://subversion.tigris.org/issues/show_bug.cgi?id=2546
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Jean-Claude Antonio <jc...@arcetis.com>.
FYI
>svn rm help.txt
D help.txt
>svn commit -m "bad delete"
Suppression trunk\help.txt
Révision 45 propagée.
>svn copy -r44 http://localhost/svn/repo-test/ProjectA/trunk/help.txt
http://localhost/svn/repo-test/ProjectA/trunk/help.txt -m "resurect"
Révision 46 propagée.
>svn up
A help.txt
>svn log help.txt
------------------------------------------------------------------------
r46 | jcantonio | 2008-02-07 10:44:34 +0100 (jeu., 07 févr. 2008) | 1 line
resurect
------------------------------------------------------------------------
r44 | jcantonio | 2008-02-06 18:48:45 +0100 (mer., 06 févr. 2008) | 1 line
...
Troy Curtis Jr a écrit :
> On Feb 6, 2008 4:23 AM, Jean-Claude Antonio <jc...@arcetis.com> wrote:
>
>> Hi,
>>
>> If you want to keep history you can use:
>> svn copy -r (the revision before it was deleted) url_to_path url_to_path
>> Cheers,
>>
>>
>> Giulio Troccoli a écrit :
>>
>>
>>> One developer deleted a file (with svn delete) and committed. Now we
>>> want that file back. I can think of two ways to do that:
>>>
>>> 1. update to the revision before the deletion, make a copy of the file,
>>> update to HEAD, move back the file, svn add and svn commit
>>> 2. update to HEAD, reverse merge the revison that deleted the file (svn
>>> merge -c-<rev>), svn commit
>>>
>>> The end result is obviously the same: I will have my file back. However:
>>> - the first method does not preserve the history of the file
>>> - none of the methods is a cheap copy
>>>
>>> Am I right? Is there a way to reverse that deletion, preserving the
>>> history and with a cheap copy? In this case, I'm not too bothered about
>>> cheap or non-cheap copies, as it's just one small file. But it would be
>>> nice to know if it's possible it case I would need to do the same for
>>> more and/or larger files.
>>>
>>> Giulio
>>>
>>>
>>> Linedata Services (UK) Ltd
>>> Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
>>> Registered in England and Wales No 3027851 VAT Reg No 778499447
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>>> For additional commands, e-mail: users-help@subversion.tigris.org
>>>
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: users-help@subversion.tigris.org
>>
>>
>>
>
> I think you'll also need a peg revision in there:
>
> svn copy -r<rev> url_to_path@<rev> url_to_path
>
> Where <rev> is the revision just before the delete was commited.
>
> Troy
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Troy Curtis Jr <tr...@gmail.com>.
On Feb 6, 2008 4:23 AM, Jean-Claude Antonio <jc...@arcetis.com> wrote:
> Hi,
>
> If you want to keep history you can use:
> svn copy -r (the revision before it was deleted) url_to_path url_to_path
> Cheers,
>
>
> Giulio Troccoli a écrit :
>
> > One developer deleted a file (with svn delete) and committed. Now we
> > want that file back. I can think of two ways to do that:
> >
> > 1. update to the revision before the deletion, make a copy of the file,
> > update to HEAD, move back the file, svn add and svn commit
> > 2. update to HEAD, reverse merge the revison that deleted the file (svn
> > merge -c-<rev>), svn commit
> >
> > The end result is obviously the same: I will have my file back. However:
> > - the first method does not preserve the history of the file
> > - none of the methods is a cheap copy
> >
> > Am I right? Is there a way to reverse that deletion, preserving the
> > history and with a cheap copy? In this case, I'm not too bothered about
> > cheap or non-cheap copies, as it's just one small file. But it would be
> > nice to know if it's possible it case I would need to do the same for
> > more and/or larger files.
> >
> > Giulio
> >
> >
> > Linedata Services (UK) Ltd
> > Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
> > Registered in England and Wales No 3027851 VAT Reg No 778499447
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
I think you'll also need a peg revision in there:
svn copy -r<rev> url_to_path@<rev> url_to_path
Where <rev> is the revision just before the delete was commited.
Troy
--
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Jean-Claude Antonio <jc...@arcetis.com>.
Hi,
If you want to keep history you can use:
svn copy -r (the revision before it was deleted) url_to_path url_to_path
Cheers,
Giulio Troccoli a écrit :
> One developer deleted a file (with svn delete) and committed. Now we
> want that file back. I can think of two ways to do that:
>
> 1. update to the revision before the deletion, make a copy of the file,
> update to HEAD, move back the file, svn add and svn commit
> 2. update to HEAD, reverse merge the revison that deleted the file (svn
> merge -c-<rev>), svn commit
>
> The end result is obviously the same: I will have my file back. However:
> - the first method does not preserve the history of the file
> - none of the methods is a cheap copy
>
> Am I right? Is there a way to reverse that deletion, preserving the
> history and with a cheap copy? In this case, I'm not too bothered about
> cheap or non-cheap copies, as it's just one small file. But it would be
> nice to know if it's possible it case I would need to do the same for
> more and/or larger files.
>
> Giulio
>
>
> Linedata Services (UK) Ltd
> Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
> Registered in England and Wales No 3027851 VAT Reg No 778499447
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Reverting a delete
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
Thanks everybody for their input. I would never have guessed that such a
simple post will generate so much debate. As usual, it's a pleasure to
read this ML and always a way to learn more about Subversion.
In the end I went for the reverse merge method. The reasons being it's
easier to understand (I have a couple of other guys willing to become
SvnAdmin), it's one command rather than a copy for each file (and we did
want to re-instate all files previously deleted) and it's a cheap copy
preserving history (the same as svn copy, I know).
Thanks again to everybody
Giulio
>
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
-----Original Message-----
> From: Blair Zajac [mailto:blair@orcaware.com]
> Sent: 07 February 2008 06:19
> To: Giulio Troccoli
> Cc: users@subversion.tigris.org
> Subject: Re: Reverting a delete
>
> Giulio Troccoli wrote:
> > One developer deleted a file (with svn delete) and committed. Now we
> > want that file back. I can think of two ways to do that:
> >
> > 1. update to the revision before the deletion, make a copy of the
file,
> > update to HEAD, move back the file, svn add and svn commit
> > 2. update to HEAD, reverse merge the revison that deleted the file
(svn
> > merge -c-<rev>), svn commit
> >
> > The end result is obviously the same: I will have my file back.
However:
> > - the first method does not preserve the history of the file
> > - none of the methods is a cheap copy
>
> That's not true. The second method is still a cheap copy. You'll see
> that the
> file is a copy of an existing file. Doing the status should show
>
> A + filename
>
> svn info will show the file as a copy:
>
> $ svn info filename
>
> Copied From URL: file:///tmp/repos/filename
> Copied From Rev: 1
>
> So doing the reverse merge is the easiest way.
>
> Regards,
> Blair
>
> --
> Blair Zajac, Ph.D.
> CTO, OrcaWare Technologies
> <bl...@orcaware.com>
> Subversion training, consulting and support
> http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Reverting a delete
Posted by Blair Zajac <bl...@orcaware.com>.
Giulio Troccoli wrote:
> One developer deleted a file (with svn delete) and committed. Now we
> want that file back. I can think of two ways to do that:
>
> 1. update to the revision before the deletion, make a copy of the file,
> update to HEAD, move back the file, svn add and svn commit
> 2. update to HEAD, reverse merge the revison that deleted the file (svn
> merge -c-<rev>), svn commit
>
> The end result is obviously the same: I will have my file back. However:
> - the first method does not preserve the history of the file
> - none of the methods is a cheap copy
That's not true. The second method is still a cheap copy. You'll see that the
file is a copy of an existing file. Doing the status should show
A + filename
svn info will show the file as a copy:
$ svn info filename
Copied From URL: file:///tmp/repos/filename
Copied From Rev: 1
So doing the reverse merge is the easiest way.
Regards,
Blair
--
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<bl...@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org