[p4] Tools menu question
Stephen Vance
steve at vance.com
Fri Oct 12 16:07:27 PDT 2007
At least on Unix, it's very easy to strip the "..." with the dirname
command. There are similar and cross-platform versions in most scripting
languages. I would guess that the rationale is that most uses of
directories in Perforce act on some subset of things under the
directory, typically everything. Also, Perforce is flexible about
whether you specify things in depot syntax (//depot/someDir/...), client
syntax (//myClient/someDir/...), or local file system syntax
(/home/me/someDir/...). I would guess that you may get different paths
depending on whether you are in the depot view or the client view, also.
To resolve a non-depot path name to a depot path name, use 'p4 where'.
Just be careful. It will give you a very literal mapping of just that
name. Why is this important? If you have a complex client mapping under
that directory, it won't resolve the single local path to multiple depot
paths. If you use local or client syntax to specify your files, you will
deal with that case cleanly.
Steve
Gross, Steve wrote:
> I am learning a bit about how to set up custom tools in p4v. I wrote a
> pretty simple tool that just echos the parameters it is given. The
> command itself is "echo", and then I've tried a variety of different
> parameters to see what happens.
>
> I'm most interested in understanding the behavior of the %D parameter.
> If I have a workspace directory (such as "/home/me/someDir") selected,
> the tool output reads:
>
> /home/me/someDir/...
>
> (1) This strikes me as pretty weird syntax. It mixes together a
> workspace path (/home/me/someDir) with a p4-specific convention (the
> "/..." suffix). Can someone explain a bit about the rationale for this
> behavior?
>
> (2) What I really want is for the tool output to read:
> "//depot/someDir/..." Assuming the workspace directory corresponds to a
> real location in the depot, is there a way to make that work?
>
> Thanks,
> --Steve
>
> _______________________________________________
> 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