[p4] Revision confusion

Jeff Jensen jjensen at apache.org
Thu Aug 30 12:47:48 PDT 2007

On Thu, 30 Aug 2007 11:18:31 -0500
  "Ivey, William" <william_ivey at bmc.com> wrote:
>> It makes sense because that is what you synced to.
> It would make sense if sync completed, but it didn't. 
> first half fails, but the implicit p4 flush is 

I disagree - what do you think failed, no file content 
change?  Local file contents do not need to change for a 
sync to change revision pointer (which I know you know! 

How is this any different than the standard "back out a 
change" a la technote 14?  I see them as the same, just 

Perforce has a great safey measure: it will not change 
contents on writable files, especially never if you have 
one opened.  I find remembering that "rule" key to 
understanding some behaviors.

> by that. I assume it set the stage for a potential 
> but I'd feel better if what it were doing were made more
> explicit. (Or if I had to explicitly issue a p4 flush to
> put it into that state.)

I see it as having consistent behavior (which I am 
thankful for!), per my notes above.

>> Some would think on revert it syncs to the latest
>> revision
> No, my assumption would have been that it reverted the 
> to the same revsion it was at when you opened it for 
> That's what it usually does. 

No, it reverts to the version last synced to.  This is 
even documented:

p4 help revert

revert -- Discard changes from an opened file

p4 revert [ -a -n -c changelist# ] file ...

     Revert an open file back to the revision previously 
synced from
     the depot, discarding any pending changelists or 
integrations that
     have been made.

Possibly the word "previously" should be changed to 
"last", as in "...revision last synced...", for better 

> I tend to think of 
> as a do/undo pair, but that's not the case now that I 
> a command seemingly unrelated to editing can affect the
> outcome.

I can see that as a logical thought, reverting to the 
version started from, but it is the last sync instead! 

> -Wm
> -----Original Message-----
>From: Jeff Jensen [mailto:jjensen at apache.org] 
> Sent: Thursday, August 30, 2007 11:07 AM
> It makes sense because that is what you synced to. 
> Perforce does change the synced revision on you 
> (thankfully).  Some would think on revert it syncs to 
> latest revision, a la lesser SCMs :-), but Perforce does 
> not.
> If the file contents were different, you would see the 
> contents at rev 1 e.g. on the revert.
> _______________________________________________
> perforce-user mailing list  - 
> perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user

More information about the perforce-user mailing list