[p4] UNIX dot files into Perforce

Chuck Karish chuck.karish at gmail.com
Fri Aug 24 09:58:21 PDT 2007


Bear in mind that  using a Perforce hierarchy that contains symlinks
is an adventure.  Perforce doesn't always choose whether to follow
a symlink or not in the way you want it to.

  Chuck

On 8/22/07, John Hopkins <johnh at ca.sophos.com> wrote:
> > > We are archiving some  2Gb of UNIX directories into a Perforce depot.
> > > There are many directory levels there, many symbolic links and many dot
> > > files (files whose names begin with a dot), as well as dot directories.
> > > The problem is how to p4 add all files including these dot files and
> > > directories  to a changelist while using filespec wildcards, short of
> > > writing complex UNIX shell scripts that locate them and add them one by
> > > one..
> > >
> > >  "p4 add dir/*/*"  and variations thereof do not pick them up.   I suspect
> > > there must be a simple answer to this question, but I just haven't stumbled
> > > upon it.
> > >
> > Some variation on:
> >     DIRS=<your dirs here>
> >     for dir in $DIRS do
> >         find $dir -type f -print
> >     done | p4 -x - add
> >
> > should do the trick reasonably efficiently.  Be sure to check the man
> > page for your version of find(1) -- GNU in particular comes garlanded
> > with options.
>
> A slight modification that will also find symlinks:
>
> # find $dir -type f -print -o -type l -print
>
>
> John
>
> --
> John Hopkins
> Build Engineer, Sophos
> Sophos - security and control
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>


-- 
Chuck Karish   karish at well.com   (415) 317-0182



More information about the perforce-user mailing list