You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Errol Sayre <er...@research.olemiss.edu> on 2008/01/17 22:46:42 UTC
Newb help moving to older revision of file
I'm trying to figure out how I can restore an older copy of a single
file in my working copy and then commit that back to the branch I'm
working on.
From the SVN book I gather that I'm supposed to use svn merge but I'm
just not getting it.
I've "updated" my file to the older revision and can see that it's the
revision I want, and can make changes to it. However, when I check the
status of my working copy svn tells me there is a newer version of the
file on the repository...
How do I make this old version commit with my project as a new revision?
After a few months of using SVN this is the first time I've had to do
this and I'm totally in the dark about this process that seems more
than a little opaque.
Thanks for the help.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Newb help moving to older revision of file
Posted by Jean-Claude Antonio <jc...@arcetis.com>.
Hi,
You can use svn merge -r your_actual_revision:your_desired_revision
filemane
example:
svn merge -r189:182 readme.txt
then commit.
The update will not allow you to commit...
*Jean-Claude Antonio*
Responsable Méthodes/Outils
Arcetis
Tél: +33 (0)6 09 13 15 63 - Fax: +33 (0)9 59 18 24 38
Mél: jcantonio@arcetis.com
www.arcetis.com
forum francophone Subversion et moteur de recherche pour Subversion
www.voilasvn.com
Errol Sayre a écrit :
> I'm trying to figure out how I can restore an older copy of a single
> file in my working copy and then commit that back to the branch I'm
> working on.
>
> From the SVN book I gather that I'm supposed to use svn merge but I'm
> just not getting it.
>
> I've "updated" my file to the older revision and can see that it's the
> revision I want, and can make changes to it. However, when I check the
> status of my working copy svn tells me there is a newer version of the
> file on the repository...
>
> How do I make this old version commit with my project as a new revision?
>
> After a few months of using SVN this is the first time I've had to do
> this and I'm totally in the dark about this process that seems more
> than a little opaque.
>
> Thanks for the help.
>
> ---------------------------------------------------------------------
> 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: Newb help moving to older revision of file
Posted by Hari Kodungallur <hk...@gmail.com>.
On Jan 17, 2008 2:46 PM, Errol Sayre <er...@research.olemiss.edu> wrote:
> I'm trying to figure out how I can restore an older copy of a single
> file in my working copy and then commit that back to the branch I'm
> working on.
>
> From the SVN book I gather that I'm supposed to use svn merge but I'm
> just not getting it.
>
> I've "updated" my file to the older revision and can see that it's the
> revision I want, and can make changes to it. However, when I check the
> status of my working copy svn tells me there is a newer version of the
> file on the repository...
>
> How do I make this old version commit with my project as a new revision?
>
> After a few months of using SVN this is the first time I've had to do
> this and I'm totally in the dark about this process that seems more
> than a little opaque.
>
TIMTOWTDI [No I am not a perl guy :-)]
Say the head revision is at 100. And you decide that revision 50 is the way
to go. And let's assume there are many revisions of this file between 50 and
100.
First thing first, make sure you are the only one using that file. If other
people are modifying the file as well, you can't decide on their behalf
whether moving back to 50 is the way to go. Assuming this small matter is
out of the way, here are things you can do:
1. Merge
svn merge 100:51 /url/to/file /path/to/file
svn commit
This will do the trick.. but may be an overkill if the revision is way back
in history. If it is just the prior revision (basically undoing the previous
commit, then this is the best thing to do)
2. Copy
svn rm /path/to/file
svn copy -r 50 /url/to/file /path/to/file
svn commit
This will also do the trick. But this will make the immediate ancestor of
file to be revision 50. So the logs will stop showing the history between 50
and 100 unless you ask for it using /url/to/file@50 syntax.
3. Get the latest content and check it back in.
svn cat -r 50 /url/to/file > /path/to/file
or
svn cat /url/to/file@50 > /path/to/file
[Use one of the above depending on whether the file was deleted between 50
and 100 or not]
svn commit
This probably the best way to go if the revision is far back in history.
HTH,
-Hari
Re: Newb help moving to older revision of file
Posted by Larry Martell <la...@gmail.com>.
On Jan 17, 2008 3:46 PM, Errol Sayre <er...@research.olemiss.edu> wrote:
> I'm trying to figure out how I can restore an older copy of a single
> file in my working copy and then commit that back to the branch I'm
> working on.
>
> From the SVN book I gather that I'm supposed to use svn merge but I'm
> just not getting it.
>
> I've "updated" my file to the older revision and can see that it's the
> revision I want, and can make changes to it. However, when I check the
> status of my working copy svn tells me there is a newer version of the
> file on the repository...
>
> How do I make this old version commit with my project as a new revision?
>
> After a few months of using SVN this is the first time I've had to do
> this and I'm totally in the dark about this process that seems more
> than a little opaque.
>
> Thanks for the help.
When I need to do this I simply check out the head, then export the
revision of the file I want, then copy that file to my working copy of the head
and commit.
-larry
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org