[p4] Revision confusion

Ivey, William william_ivey at bmc.com
Thu Aug 30 12:39:38 PDT 2007


I'm not surprised that revert does what it does once you realize that
sync

alters the have list even for a file opened for editing. I don't see
anything

under sync that documents that behavior (except by not saying it
doesn't),

nor under the flush or edit docs.

 

I don't see any documentation suggesting a use for it, either. (Other
than the

general use of sync to schedule resolves.)

 

-Wm

 

________________________________

From: Stephen Vance [mailto:steve at vance.com] 
Sent: Thursday, August 30, 2007 1:23 PM
To: Ivey, William
Cc: perforce-user at perforce.com
Subject: Re: [p4] Revision confusion

 

This is the expected behavior. Note that revert is very carefully
documented as reverting to the "have" revision. Notice also that when
you sync forward and have to resolve that your have version is the newly
synced version, not the one you originally synced. That's how Perforce
keeps track of what you're resolving against in that case.

Steve

Ivey, William wrote: 

 
  

	The other surprise was that the revert reverted you back
	to the revision you had synced to
	    

 
And it really does. I tried it on a file that had differences
between revisions and the revert changed the content to the
earlier version. (Effectively, it's as though you've created
a pending sync which is completed by revert.)
 
It goes in the other direction too. That is, open revision
1 for editing, sync rev 2, revert and you get rev 2.
 
I would have thought that the "flush" half of sync would
be skipped if sync can't update the file content. Not sure
if this behavior is a bug or useful in some way that's not
immediately apparent.
 
-Wm
 
-----Original Message-----
From: Dave Lewis [mailto:dlewis78731 at gmail.com] 
Sent: Thursday, August 30, 2007 10:49 AM
 
This seems consistent with the way it works when editing an older
revision, then syncing and resolving to the head revision...  the one
part that really surprised me was the output of p4 have.  it makes
sense, but I guess I had never thought about the have list reflecting
the sync so specifically.  I had tended to think it reflected what was
on the client.
 
The other surprise was that the revert reverted you back to the
revision you had synced to, rather than the revision you had opened
for edit.  That makes sense too, but I had not thought about this
case.  it is an unusual scenario, it seems to me.
 
I guess fstat will tell you the details relevant to files open for edit.
 
Thanks for doing that experiment!
 
dave
 
On 8/30/07, Ivey, William <william_ivey at bmc.com>
<mailto:william_ivey at bmc.com>  wrote:
  

	I was watching the modtime thread and tried an experiment,
	 
	the results were interesting:
	 
	 
	 
	    

		p4 have BuildIt.dat
		      

	//depot/main/BuildIt.dat#2 -
/opt/simcity/auto/daily/main/BuildIt.dat
	 
	    

		p4 edit BuildIt.dat
		      

	//depot/main/BuildIt.dat#2 - opened for edit
	 
	    

		p4 sync BuildIt.dat#1
		      

	//depot/main/BuildIt.dat#2 - is opened at a later revision - not
	    

changed
  

		p4 have BuildIt.dat
		      

	//depot/main/BuildIt.dat#1 -
/opt/simcity/auto/daily/main/BuildIt.dat
	 
	    

		p4 revert BuildIt.dat
		      

	//depot/main/BuildIt.dat#1 - was edit, reverted
	 
	    

		p4 edit BuildIt.dat
		      

	//depot/main/BuildIt.dat#1 - opened for edit
	 
	... //depot/main/BuildIt.dat - must sync/resolve #2 before
submitting
	 
	    

		p4 diff BuildIt.dat
		      

	==== //depot/main/BuildIt.dat#1 -
	/opt/simcity/auto/daily/main/BuildIt.dat ====
	 
	    

		p4 revert BuildIt.dat
		      

	//depot/main/BuildIt.dat#1 - was edit, reverted
	 
	 
	 
	Obviously sync doesn't update the file contents, but it does
change
	 
	the revision. -Wm
	 
	 
	 
	_______________________________________________
	perforce-user mailing list  -  perforce-user at perforce.com
	http://maillist.perforce.com/mailman/listinfo/perforce-user
	 
	    

 
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
 
  





-- 
Stephen Vance
www.vance.com



More information about the perforce-user mailing list