Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

revert to a previous version of a directory

62 views
Skip to first unread message

Andrew Michael Levin

unread,
Jul 5, 2012, 1:48:18 PM7/5/12
to info...@nongnu.org
Hi,

How do I revert to a version of a cvs directory that I had at a
previous date. Do I have to go through and revert each file
individually? When I do

cvs up -C -D "2012-07-05 13:41"

it sets the sticky date for all of the files, so I can't check the
reverted files in to the HEAD. Is there some way around this?

Thanks.

Andrew


Arthur Barrett

unread,
Jul 5, 2012, 7:04:08 PM7/5/12
to Andrew Michael Levin, info...@nongnu.org
Hi Andrew,

I was recently in Nashville (in spring) helping a local company (pharma
biz) with their configuration management requirements and processes.
Too many breakfasts at Midtown Noshville (or maybe dinners at Royal
Thai) saw off any chance of getting into shape for summer ...

>
> cvs up -C -D "2012-07-05 13:41"
>
> it sets the sticky date for all of the files, so I can't check the
> reverted files in to the HEAD. Is there some way around this?
>


Generally as a rule of thumb CVS operates on HEAD (or the branch of the
sandbox). You can force it instead using:

cvs up -A -C -D "2012-07-05 13:41"

Implementing and using CVS well takes some work - I recommend you get a
good book on the subject from Amazon or your favourite technical books
seller. I
had a hand in writing 'All About CVS' or there is the ever popular
'Essential CVS' or many many others.

Regards,


Arthur Barrett
Product Manager
CVS Suite

March Hare Software LLC
200 Broadhollow Road
Suite 207
Melville, NY 11747

Andrew Michael Levin

unread,
Jul 5, 2012, 7:29:23 PM7/5/12
to Arthur Barrett, info...@nongnu.org
Hi,

But doesn't

cvs up -A -C -D "2012-07-05 13:41

still set the sticky date so that I can't commit to the HEAD?

Thanks.

Andrew

Jim Hyslop

unread,
Jul 6, 2012, 12:07:47 AM7/6/12
to Andrew Michael Levin, info...@nongnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-07-05 1:48 PM, Andrew Michael Levin wrote:
> Hi,
>
> How do I revert to a version of a cvs directory that I had at a
> previous date. Do I have to go through and revert each file
> individually? When I do
>
> cvs up -C -D "2012-07-05 13:41"
>
> it sets the sticky date for all of the files, so I can't check the
> reverted files in to the HEAD. Is there some way around this?

1) ensure that the above command did, in fact, give you exactly the
right versions of the files.

2) Create a tag based on the date (this is not strictly speaking
necessary, but it helps when you're viewing the logs so you know
what's what):

cvs tag -D "2012-07-05 13:41" revert_point

3) ensure the HEAD is the current version
cvs up -A

4) Apply a tag to the HEAD so you can back out the reverted files, if
necessary

cvs tag pre_revert

5) Perform a "reverse merge":

cvs update -j pre_revert -j revert_point


6) You'll want to compare the current directory against the old
version to ensure nothing went wrong:

cvs -q diff -r revert_point

If you did not add any files, there should be no output from the diff
command. If you added files, then each file you added will spit out a
message "cvs diff: [filename] was removed, no comparison available"

If it spits out a bunch of differences, then back out the merge by
issuing the command `cvs update -C`, and try again.

When you are satisfied that the directory contains the correct
information, commit it, and tag the post-revert version. Be sure to
mention the tag you used for the revert.

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/2ZJMACgkQLdDyDwyJw+PvagCbBLXCFCDdG9aA6OziD56fjO7X
dJkAnjgUpnGaIIZZ6tHq0O0q9CKm1uz0
=G67X
-----END PGP SIGNATURE-----

Andrew Michael Levin

unread,
Jul 6, 2012, 11:29:15 PM7/6/12
to Jim Hyslop, info...@nongnu.org
On Fri, Jul 6, 2012 at 6:07 AM, Jim Hyslop <jhysl...@dreampossible.ca> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12-07-05 1:48 PM, Andrew Michael Levin wrote:
>> Hi,
>>
>> How do I revert to a version of a cvs directory that I had at a
>> previous date. Do I have to go through and revert each file
>> individually? When I do
>>
>> cvs up -C -D "2012-07-05 13:41"
>>
>> it sets the sticky date for all of the files, so I can't check the
>> reverted files in to the HEAD. Is there some way around this?
>
> 1) ensure that the above command did, in fact, give you exactly the
> right versions of the files.
>
> 2) Create a tag based on the date (this is not strictly speaking
> necessary, but it helps when you're viewing the logs so you know
> what's what):

How can you do this without creating a tag?

Jim Hyslop

unread,
Jul 7, 2012, 11:24:38 PM7/7/12
to Andrew Michael Levin, info...@nongnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-07-06 11:29 PM, Andrew Michael Levin wrote:
> On Fri, Jul 6, 2012 at 6:07 AM, Jim Hyslop
> <jhysl...@dreampossible.ca> wrote:
>> 2) Create a tag based on the date (this is not strictly speaking
>> necessary, but it helps when you're viewing the logs so you know
>> what's what):
>
> How can you do this without creating a tag?

I don't understand the question. The instruction was "create a tag
based on the date."

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/4/XUACgkQLdDyDwyJw+OWvwCg19M9UqrVDXlLI+ostskp2GgN
KW4AoPF+5pqYdo8/smBGWaiF1mBVMtny
=CSQe
-----END PGP SIGNATURE-----

Andrew Michael Levin

unread,
Jul 8, 2012, 4:32:23 AM7/8/12
to Jim Hyslop, info...@nongnu.org
Hi,

Yes, but you said "this is not strictly speaking necessary," so I was
asking what the alternative way is.

Thanks.

Andrew

Jim Hyslop

unread,
Jul 8, 2012, 11:27:20 AM7/8/12
to Andrew Michael Levin, info...@nongnu.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-07-08 4:32 AM, Andrew Michael Levin wrote:
> Yes, but you said "this is not strictly speaking necessary," so I
> was asking what the alternative way is.

Ah, I see. The point I was trying to make is that the step is
optional. It is not required to perform the revert, but it does make
it easier in the future if you go back to look at exactly what was done.

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/5ptgACgkQLdDyDwyJw+P9GgCgmZEh3MrC5/0R7psD9usSN6La
mIAAoKMa5HOVqabAa4B034irddXARwSF
=jxgd
-----END PGP SIGNATURE-----

0 new messages