Subject: Re: [PATCH v2] git-p4: Ask "p4" to interpret View setting

From: Pete Wyckoff <[email-masked]>
Date: Sat, 10 Aug 2013 16:11:23 -0400

[email-masked] wrote on Tue, 06 Aug 2013 15:45 +0900:
> In Perforce, View setting of p4 client can describe
>   -//depot/project/files/*.xls //client/project/files/*.xls
> to exclude Excel files.
> But "git p4 --use-client-spec" cannot support '*'.
> 
> In git-p4.py, "map_in_client" method analyzes View setting and return
> client file path.
> So I modify the method to just ask p4.
> 
> 
> > Let me play with this for a bit.  I wonder about the performance
> > aspects of doing a "p4 fstat" for every file.  Would it be
> > possible to do one or a few batch queries higher up somewhere?
> To reduce p4 access, it cache result of asking "client path".
> And addition, "fstat" depends on sync status, so modify to use "p4
> where" instead of "fstat".

I played around with your patch a bit, ending up with this
teensy series.

I redid the code to use clientFile, not path, as that
will work better with AltRoots.  Also I simplified your
test and added a couple more for the now-supported wildcards.
And deleted a bunch of newly dead code.

My only concern is in the commit message, about performance.  A
change that has lots of files in it will cause many roundtrips to
p4d to do "p4 where" on each.  When the files don't have much
edited content, this new approach will make the import take twice
as long, I'll guess.  Do you have a big repository where you
could test that?

Tell me what you think.

		-- Pete