From: Grzegorz J. <ja...@he...> - 2003-03-18 01:21:21
|
On Mon, 17 Mar 2003, Alexandre Tolmos wrote: > > Le samedi, 15 mar 2003, =E0 14:25 Europe/Paris, Grzegorz Jakacki a =E9c= rit : > > > Alexandre Tolmos writes: > > > >> I'm not expert at using Cvs and I see no command to do a rollback; > >> can you help? > > > > Wow, it is harder that I thougt (or maybe I am missing something). > > This is what I came up with: > > (1) Check out working copy > > cvs co opencxx > > cd opencxx > > [sticky tag: none, sticky date: none] > > (2) Use 'cvs log' on one of files that need rollback to > > find out to what date you want to roll back. > > [sticky tag: none, sticky date: none] > > (3) Go back to the rollback date, e.g. > > cvs update -D'2003/03/15 12:07:26 UTC' > > WARNING: Remember to specify "UTC". 'cvs status' give you times in > > UTC, > > but other commands accept date in your local time, unless you > > specify > > UTC. > > [sticky tag: none, sticky date: 2003.03.15.12.07.26] > > (3) Tag the rollback point: > > cvs tag sandbox_USERID_rollback_point > > [sticky tag: none, sticky date: 2003.03.15.12.07.26] > > (4) Get head revision in your working dir > > cvs update -A > > [sticky tag: none, sticky date: none] > > Do I need to change the working directory? If the rollback point tag is > created locally then it might be erased. No. You do everything in the same directory. Tags in CVS are always global (that's why we try to use "sandbox_USER" prefix to resolve potential tag names conflicts). If in doubt, set up a small repository with one file just on your machine and run the procedure on it first (this is what I did): $ mkdir repo $ mkdir test $ export CVSROOT=3D`pwd`/repo $ cvs init $ cd test $ cat >test.cc <<END > line1 > line2 > line3 END $ test $ cvs -d import -m '' test start kthulu N test/file.txt No conflicts created by this import $ cd .. $ rm -r test $ cvs -d co test cvs checkout: Updating test U test/file.txt $ cd test $ # edit file.txt $ commit cvs commit: Examining . Checking in file.txt; .../repo/test/file.txt,v <-- file.txt new revision: 1.2; previous revision: 1.1 done $ cd .. $ rm -r test Now you have a repository with two revisions of the file. You may try the procedure to revert the file to the first revision. Hope this helps. Best regards Grzegorz ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |