[p4] Syncing to and modifying old revisions of a file

David Weintraub qazwart at gmail.com
Tue May 22 09:19:13 PDT 2007


There's information in Tech Note #14 - "How do you back out a
changelist that's already been submitted?" which may help:
<http://perforce.com/perforce/technotes/note014.html>.

What you need to do is sync back to the head of the revision once
you've marked the file for edit:

Your first two steps are correct:

    $ p4 sync revisionText.txt#3
    $ p4 edit revisionText.txt

The last step needs to be:

    $ p4 sync revisionText.txt#head

That will get "revisionText.txt" back to the tip of the branch, but
because you've marked revision.txt with a "p4 edit", it won't be
replaced. Then, all you have to do is a "p4 submit" and you don't have
to do a "p4 resolve" first.

On 5/22/07, Looney, James B <james.b.looney at lmco.com> wrote:
> I've found an issue that confuses me with Perforce related to file
> revisions, and modifying older revisions.  I've got a file
> "revisionText.txt".  It has 4 revisions.  I realize that revision 4 has
> something in it that I don't want.  So, I sync to revisionText.txt#3.
> When I edit that file, Perforce tells me that I'll need to resolve this
> with #4 prior to submitting it.  However, after modifying the file, I
> try to resolve it.  It says there's nothing to resolve.  So, I submit.
> It tells me I have unresolved files.  After the submit returns (and I
> have my new changelist #), I do the resolve again, this time it
> resolves.  I submit with the previous changelist #, and life is good.
>
> My question is, why didn't the resolve work the first time?  After all,
> Perforce is the one who told me I needed to resolve before submitting,
> but wouldn't let me.  I've only tried this from the command line, so I
> don't know if the GUI would give similar results, although I'd hope the
> two are consistent.
>
> Thanks,
> -JB
>
> Below is the session dump:
>
> p4 filelog revisionText.txt
> //ula/distributions/revisionText.txt
> ... #4 change 32 edit on 2007/05/17 by jlooney at bc_ula (text) ' revision
> 4 '
> ... #3 change 31 edit on 2007/05/17 by jlooney at bc_ula (text) ' This
> should become version 3. '
> ... #2 change 28 edit on 2007/05/17 by jlooney at bc_ula (text) ' revision
> 2 of the file. '
> ... #1 change 27 add on 2007/05/17 by jlooney at bc_ula (text) 'Revision 1
> of the text file. '
>
> p4 sync revisionText.txt#3
> //ula/distributions/revisionText.txt#3 - updating
> /disk01/perforce,refactor/jbProto/ula/distributions/revisionText.txt
>
> p4 edit revisionText.txt
> //ula/distributions/revisionText.txt#3 - opened for edit
> ... //ula/distributions/revisionText.txt - must sync/resolve #4 before
> submitting
>
> echo "new revision" >> revisionText.txt
>
> p4 resolve revisionText.txt
> revisionText.txt - no file(s) to resolve.
>
> p4 submit
> <vi session....>
> Submitting change 34.
> //ula/distributions/revisionText.txt - must resolve before submitting
> //ula/distributions/revisionText.txt - must resolve #4
> Out of date files must be resolved or reverted.
> Submit failed -- fix problems above then use 'p4 submit -c 34'.
>
> p4 resolve
> /disk01/perforce,refactor/jbProto/ula/distributions/revisionText.txt -
> merging //ula/distributions/revisionText.txt#4
> Diff chunks: 1 yours + 1 theirs + 0 both + 0 conflicting
> Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) am: ay
> //bc_ula/distributions/revisionText.txt - ignored
> //ula/distributions/revisionText.txt
>
> <file content verified correct...>
>
> p4 submit -c 34
> Submitting change 34.
> Locking 1 files ...
> edit //ula/distributions/revisionText.txt#5
> Change 34 submitted.
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>


-- 
--
David Weintraub
qazwart at gmail.com



More information about the perforce-user mailing list