On 8/29/05, Huaer XC <[EMAIL PROTECTED]> wrote: > Hi, Russ: Can you help me with a question. Hi. Please post cvs quesitons directly to the group and start a new thread for a new question. > I have a file, like f1.c, > which has a revision history from 1.1.1.1->1.1->1.2->1.3. the current > head is 1.3, this file(f1.c) in my working directory has minor > modifications. Now I do: > cvs update -j1.1 f1.c Why? > and then "pg f1.c", I found the file did not change anything. (there > is no sticky tags on f1.c). I am wondering how "cvs update -j1.1" > workaround???
Not sure what you mean. > > BTW. I am using cvs: version 1.12.12.. > > Another question: I suppose that rev-1.1.1.1 and rev-1.1 have the same > contents? Is it right? What is the output of cvs diff -r 1.1.1.1 -r 1.1 f1.c? > Many thanks > > Huaer > > On 8/29/05, Russ Sherk <[EMAIL PROTECTED]> wrote: > > On 8/28/05, xiangbin <[EMAIL PROTECTED]> wrote: > > > Hi,all > > > What I really want is to replace the contents of main.c with the contents > > > it had at 1.1.1.1 and DO NOT change the version(keep it 1.2) . > > With CVS it is not possible to change history. Also, it is not a good > > idea to think about file revisions in terms of version numbers. > > However, it is possible to 'work around' the issue. There are 2 > > possible start states for your situation. > > > > 1. main.c v1.2 is at the tip of the trunk. This is good; you don't > > have to change history.. Just cvs up -A main.c; cvs up -j1.1.1.1 > > main.c; cvs ci -m "Replacing 1.2 with 1.1.1.1." main.c. This is how > > cvs is supposed to work. > > > > 2. main.c v1.2 is not at the tip of the trunk ( e.g. main.c -> 1.1 -> > > 1.2 -> 1.3). This is where you have to change history. Basically in > > english this means "I want to replace main.c v1.2 with main.c v1.1.1.1 > > without disturbing the main trunk. (So 1.3 and child revisions will > > not be affected.) In this case, I see no other way but to create a > > branch for main.c, update it with 1.1.1.1 and reference it with a tag. > > (Please note, this is a kludge and is not straightforward to > > implement but will achieve what you want.) > > ---- > > cvs rtag -b -r1.2 BR_1_2 main.c > > cvs co -rBR_1_2 main.c > > cvs co -p -r1.1.1.1 main.c > main.c > > cvs ci -m "Replacing main.c 1.2 with 1.1.1.1 without disturbing the > > main trunk." main.c > > cvs rtag -rBR_1_2 NEW_1_2 main.c > > # To include the new revision in a build from a tag: > > cvs rtag MY_BUILD_TAG <other source code from main trunk> > > cvs rtag -F -r NEW_1_2 MY_BUILD_TAG main.c > > # The disadvantage here is that you must remember to tag this revision > > each time. > > ---- > > > > Can you explain why you want to replace the version like that? > > > > --Russ > > > > > The following > > > command: > > > $cvs up -r1.1.1.1 -C main.c > > > only checkout the 1.1.1.1 version and when I modifed it and do commit: > > > ------------------ > > > $cvs commit > > > cvs commit: Examining . > > > cvs commit: sticky tag `1.1.1.1' for file `main.c' is not a branch > > > cvs [commit aborted]: correct above errors first! > > > ---------------------------------- > > > As you see,that's not what I want . > > > Finally,thanks for Todd,by > > > cvs update -j1.1.1.1 main.c > > > really achieves my goals . > > > > > > -Xiangbin > > > > > > > ----- Original Message ----- > > > > From: "Todd Denniston" <[EMAIL PROTECTED]> > > > > To: "xiangbin" <[EMAIL PROTECTED]> > > > > Cc: <[email protected]> > > > > Sent: Friday, August 26, 2005 9:31 PM > > > > Subject: Re: checkout a old version file to cover the new one > > > > > > > > > > > >> xiangbin wrote: > > > >>> > > > >>> Hi, > > > >>> I am new user to CVS. When I work with the newest version, I > > > >>> suddenly found I need the old version of a file, say,main.c of version > > > >>> 1.1.1.1 .I know that I can checkout the whole version of 1.1.1.1 in > > > >>> another > > > >>> directory,then copy....But,if there is any way to achieve this just by > > > >>> checkout the old file and cover the local one ? > > > >> > > > >> in the sandbox directory where main.c normally exists do: > > > >> > > > >> cvs checkout -p -r1.1.1.1 main.c > main_1.1.1.1.c > > > >> > > > >> -p Check out files to standard output (avoids stickiness). > > > >> > > > >> but lets clarify one point ... you say "and cover the local one", do > > > >> you > > > >> mean you want to replace the contents of main.c (our example file) in > > > >> your > > > >> sandbox with the contents it had at 1.1.1.1 (our example rev), perhaps > > > >> because you want to undo all the changes since 1.1.1.1? > > > >> > > > >> I think that could be accomplished by either > > > >> cvs update -j1.1.1.1 main.c > > > >> or > > > >> cvs checkout -jcurrentRev -j1.1.1.1 main.c > > > >> > > > >> -- > > > >> Todd Denniston > > > >> Crane Division, Naval Surface Warfare Center (NSWC Crane) > > > >> Harnessing the Power of Technology for the Warfighter > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Info-cvs mailing list > > > [email protected] > > > http://lists.nongnu.org/mailman/listinfo/info-cvs > > > > > > > > > _______________________________________________ > > Info-cvs mailing list > > [email protected] > > http://lists.nongnu.org/mailman/listinfo/info-cvs > > > _______________________________________________ Info-cvs mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/info-cvs
