[p4] Recursive add on windows problems

Bennett, Patrick Patrick.Bennett at inin.com
Thu Aug 24 09:52:22 PDT 2006


P4Win does this as well.  You can drag and drop directories into it, so
if you're view is set to 'Local view of client tree' you can drag a
directory from the left pane to the pending changelist pane.

> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Smith, Jeff
> Sent: Thursday, August 24, 2006 12:21 PM
> To: Weintraub, David; Brad Holt; Perforce Users
> Subject: Re: [p4] Recursive add on windows problems
> 
> Another solution would be to simply use P4V which allows you 
> to do a recursive add of a directory.  You right click on the 
> directory and it will add everything in the entire structure. 
>  Just one of the features I have come to like about P4V! 
> 
> Jeff
> 
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Weintraub, David
> Sent: Thursday, August 24, 2006 8:28 AM
> To: Brad Holt; Perforce Users
> Subject: Re: [p4] Recursive add on windows problems
> 
> 
> Just curious, shouldn't the command be:
> 
>     C:\> dir /s /b /a-d | p4 -x - add
>  
> And not:
> 
>     C:\> dir /s /b /a-d | p4 -x add
> 
> The extra dash after the "-x" tells p4 to use STDIN as the 
> list for files to push to the "add" command. Could this be 
> the problem? Doesn't sound like it since the "add" seems to 
> be working.
> 
> What are the files that Perforce is complaining about? What 
> is their name via the "dir" command? What name is in the 
> changelist? What name is being shown if you do use p4win in 
> both the file tree and the changelist? What is the resulting 
> command shown in the p4win log?
> 
> You might have better luck with the "for" command if you have 
> "command extensions" turned on (Are you using Windows XP?)
> 
> For more info on command extensions, see:
> <http://www.microsoft.com/resources/documentation/windows/xp/a
> ll/proddoc
> s/en-us/cmd.mspx?mfr=true> or try <http://snipurl.com/vdyv>.
> 
> Anyway try this command:
> 
>    C:\> for /r %i in (*) do p4 add %i
> 
> This will use the "for" command to go through the file tree.
> 
> You might also try this too:
> 
>    C:\> for /r %i in (*) do p4 add %~fi
> 
> See if you get the same result as you would if you used "dir".
> 
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Brad Holt
> Sent: Wednesday, August 23, 2006 6:04 PM
> To: Perforce Users
> Subject: [p4] Recursive add on windows problems
> 
> This one will probably sound basic, but it is giving me problems.
> 
> I have a pile of about 500,000 files that need to be added to 
> a new server.  Many of these have special characters, and 
> when I try to add them with "dir /s /b /a-d | p4 -x add", 
> they happily get added to a pending changelist.  However, 
> upon trying to submit, I get a "File Cannot be found" error 
> and the submission fails.  I believe this could be happening 
> because the special characters get dereferenced into an ASCII 
> approximation in the "dir" call, and so upon adding, the 
> file/folder names in the 'pending changelist' = 'the 
> filenames in the dir call' <> 'what's actually on the machine'.
> 
> So does anyone know of a scriptable way to do this.  I reckon 
> something that would let me add files without having to list 
> them would work.
> However, I can not think of a way to do this recursively in 
> Windows batch.  "p4 add //..." would be nice but "..." only 
> works to reference files already in the depot.  "p4 ad * */* 
> */*/* etc. did not work past the first folder as far as I could tell.
> 
> The P4Win would ddo the job, but I'd rather script something 
> up as using the UI with that many files is painful.
> 
> Thanks all.
> 
> -brad
> 
> _______________________________________________
> 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
> 
> _______________________________________________
> 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