Jump to content


Miles O'Neal

Member Since 28 Oct 2014
Offline Last Active Apr 19 2019 09:08 PM
-----

Topics I've Started

trigger on close review

19 April 2019 - 07:41 PM

Is there a way to define a trigger that occurs when a review is closed?

file spec: show dirs at a specific level

16 April 2019 - 08:09 PM

I need to be able to get a list of "subdirs" within a file spec, typically just under the depot level. Using spec as an example, I cannot get a list of most of what is in //spec . (This applies to other depots as well; spec simply shows it a little better.)
I want to see something like:
//spec/client
//spec/label
etc. I'm basically looking for the "ls -d" equivalent.
I cannot seem to get those except by using "p4 files //spec/..." and parsing it, which takes a long time because we have a LOT of data (spec and otherwise).
What I see:
% p4 files //spec
//spec - must refer to client 'p4restore'.
% p4 files //spec/
//spec/ - no such file(s).
% p4 files //spec/\*
//spec/license.p4s#2 - edit default change (text+CS8)
//spec/protect.p4s#2153 - edit default change (text+C)
//spec/triggers.p4s#285 - edit default change (text+C)
//spec/typemap.p4s#10 - edit default change (text+C)
% p4 files //spec/\*/
//spec/*/ - no such file(s).


Is there a way to quickly get this list? (the same would be true with //project_depot/*/*/).

protect table: regex capture strings?

14 December 2018 - 10:15 PM

A good bit of our protects table is of the form:

read  group read-fred  * //fred/...
write group fred       * //fred/...

. We create these two groups (<depotname> and read-<depotname>) for every project.

Is there a way to do something like perl's capture strings? If so, we could reduce over a thousand lines to two:

read  group read-(.*)  * //$1/...
write group (.*)       * //$1/...

Thanks,
Miles

brokers: filter runs on one, fails on another

30 October 2018 - 05:24 PM

We have two, essentially identical[1] forwarding replicas that are remote from the master. Call them E and M.
On each of these hosts, we have a broker that handles various things, including enhanced commands (using filters).
Some of the enhanced commands are there to let non-super users run specific things that require super access. These work fine on server E but fail on server M with "Perforce password (P4PASSWD) invalid or unset."
I can run the filter line (as it appears in the broker config file) manually on host M, both as myself and as the p4 user (which the broker runs as). The p4 user is a UNIX-only user; we have no Helix user named p4. In both cases the filter runs fine from the command line with no password errors. This tells me the tickets file is good and that the super user is logged in. I can also run the straight Helix command the filter ends up running (p4 -u foo -p host command)- again as myself or p4- and it works.
What could cause this to fail when run from the broker on host M, but wrok on the command line on M, and work in all cases on E?

Thanks for any insights.

[1] The only configuration differences are things like serverid, ldap configs, tcpsize tweaks, etc.

cmooand line: adding control characters to descriptions

04 October 2018 - 03:39 PM

A user wants to generate a client or modify a client from the command line with a multi-line description field. Ideally this could be done with

% p4 --field "Description=new\n\tline" client -o newline_test |  p4 client -i

For now we have a workaround of:

%  p4 --field "Description=fred" client -o newline_test | sed -e 's/fred/new\n\tline/' |  p4 client -i

I'm assuming there's a way to do this without the intermediate sed step, but haven't been able to find it online or through experimentation.

Thanks!