[p4] Accidental checkout

Robert Cowham robert at vaccaperna.co.uk
Tue Aug 29 14:57:26 PDT 2006


P4win is executing "revert -an" in order to find files that are opened for
edit and not different. This works by calculating MD5 checksum for all open
files to see if they are really different and comparing with the what the
server expects to be valid. Thus executing the command takes as long as it
takes locally to calculate an MD5 checksum - i.e. not instantaneous,
especially for lots of files.

Having just tested for p4win 2006.1, with a 2006.1 server, it actually
executes the following commands:

Executing p4 fstat -Ol -Ro //bruno_ws/...
Executing p4 fstat -Ru //bruno_ws/...
Executing p4 fstat -Rr //bruno_ws/...
Found 2 opened files with 0 unresolved files and 0 resolved files
Executing p4 change -o

C:\bruno_ws\main\jam>p4 fstat -Ol -Ro //bruno_ws/...
... depotFile //depot/main/jam/jam.c
... clientFile c:\bruno_ws\main\jam\jam.c
... isMapped
... headAction edit
... headType text
... headTime 1005696364
... headRev 35
... headChange 627
... headModTime 1005696364
... haveRev 35
... action edit
... change default
... type text
... actionOwner robert
... fileSize 7042
... digest 58B12B2E2A4F84B61D335CCFED3E621B

... depotFile //depot/main/jam/jam.h
... clientFile c:\bruno_ws\main\jam\jam.h
... isMapped
... headAction edit
... headType text
... headTime 1006024259
... headRev 49
... headChange 633
... headModTime 1006024259
... haveRev 49
... action edit
... change default
... type text
... actionOwner robert
... fileSize 7364
... digest 2E94B379F201AD02CF7E8EE33FB7DA99

Thus it no longer needs to execute a "revert -an", though still calculates
the digest locally.

What version of p4win/server are you using?

Robert

> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Weintraub, David
> Sent: 29 August 2006 19:05
> To: Francis Paulin; Robert Cowham; Jeff Desharnais; 
> perforce-user at perforce.com
> Subject: Re: [p4] Accidental checkout
> 
> Doesn't the "-n" parameter mean that the command only 
> displays the affected file, but doesn't operate on them? If 
> you ran that command from the command line, no files would be 
> reverted.
> 
> 
>     revert -- Discard changes from an opened file
> 
>     p4 revert [ -a -n -k -c changelist# ] file ...
> 
> [...]
>         The -a flag tells 'p4 revert' to revert only those files which
>         are opened for edit or integrate and are unchanged or missing.
>         Files with pending integration records are left open. 
>  With the
>         -a flag, the file arguments are optional.
> 
>         The -n flag displays what files would be affected but does not
>         actually revert them.
> 
> 
> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Francis Paulin
> Sent: Tuesday, August 29, 2006 10:36 AM
> To: Robert Cowham; Jeff Desharnais; perforce-user at perforce.com
> Subject: Re: [p4] Accidental checkout
> 
> Hi,
> 
> I'm aware of that option and it's not checked and the p4 
> revert -an is done anyway
> 
> Thanks
> Francis


More information about the perforce-user mailing list