Discussion:
[p4] How to set the default submit option for new workspaces
Norbert Szabo
2011-06-03 18:55:19 UTC
Permalink
Hi,

I could not find it the option after quite a bit of googling - I know it exists I just do not remember how to set it.

Our current default is "submitunchanged" - I want to change it to "revertunchanged".

Can you guys help me out?

Thanks a lot in advance,
Norbert Szabo
Stephen Vance
2011-06-03 19:24:38 UTC
Permalink
It's in the workspace spec. You should be able to change the default
with the undoc 'p4 spec client'.

Steve
Post by Norbert Szabo
Hi,
I could not find it the option after quite a bit of googling - I know it exists I just do not remember how to set it.
Our current default is "submitunchanged" - I want to change it to "revertunchanged".
Can you guys help me out?
Thanks a lot in advance,
Norbert Szabo
_______________________________________________
http://maillist.perforce.com/mailman/listinfo/perforce-user
--
Stephen Vance
www.vance.com
Norbert Szabo
2011-06-03 20:10:31 UTC
Permalink
Hi Steve,

Thanks a lot for coming back to me!

Hmm - It seems to be more complicated than I remember.
I think we do not have a spec depot yet - do we need to create one?

Also, how the actual syntax of the command should look like?

Just to make sure that we mean the same thing - I am speaking about future workspaces which do not exist yet - in P4V there is a field with a drop down menu defaulting to "submitunchanged" on the new workspace dialog - that should default to "revertunchanged".

It is really for people who do know much (enough) about perforce but still create workspaces to make sure that they accidentally do not create one with the wrong (for us) settings.

Thanks,
Norbert

-----Original Message-----
From: perforce-user-***@perforce.com [mailto:perforce-user-***@perforce.com] On Behalf Of Stephen Vance
Sent: Friday, June 03, 2011 12:25 PM
To: perforce-***@perforce.com
Subject: Re: [p4] How to set the default submit option for new workspaces

It's in the workspace spec. You should be able to change the default with the undoc 'p4 spec client'.

Steve
Post by Norbert Szabo
Hi,
I could not find it the option after quite a bit of googling - I know it exists I just do not remember how to set it.
Our current default is "submitunchanged" - I want to change it to "revertunchanged".
Can you guys help me out?
Thanks a lot in advance,
Norbert Szabo
_______________________________________________
http://maillist.perforce.com/mailman/listinfo/perforce-user
--
Stephen Vance
www.vance.com

_______________________________________________
perforce-user mailing list - perforce-***@perforce.com http://maillist.perforce.com/mailman/listinfo/perforce-user
Stephen Vance
2011-06-03 20:48:20 UTC
Permalink
Hi, Norbert --

No, this is not for people who don't know much about Perforce. Anything
in 'p4 help undoc' is essentially unsupported and some of it is
incomplete. The 'p4 spec' command is only effective for a limited part
of its potential functionality, but it's good enough for what you are
asking. You should read about 'p4 jobspec' and the associated
documentation on fields to understand how to edit the spec.

Another approach if you're workspaces are all from the same part of the
depot is to create a template spec that is only to be used to create
other workspaces with 'p4 client -t template newworkspace'. You can set
any of the attributes, but it's then up to the other developers to
remember to use the template.

Yet another approach, and this is probably what you've seen before, is
to create a form-out trigger (see 'p4 help triggers') that rewrites the
spec before it gets to the user. Details on that can be found in the P4
Admin Guide.

Steve
Post by Norbert Szabo
Hi Steve,
Thanks a lot for coming back to me!
Hmm - It seems to be more complicated than I remember.
I think we do not have a spec depot yet - do we need to create one?
Also, how the actual syntax of the command should look like?
Just to make sure that we mean the same thing - I am speaking about future workspaces which do not exist yet - in P4V there is a field with a drop down menu defaulting to "submitunchanged" on the new workspace dialog - that should default to "revertunchanged".
It is really for people who do know much (enough) about perforce but still create workspaces to make sure that they accidentally do not create one with the wrong (for us) settings.
Thanks,
Norbert
-----Original Message-----
Sent: Friday, June 03, 2011 12:25 PM
Subject: Re: [p4] How to set the default submit option for new workspaces
It's in the workspace spec. You should be able to change the default with the undoc 'p4 spec client'.
Steve
Post by Norbert Szabo
Hi,
I could not find it the option after quite a bit of googling - I know it exists I just do not remember how to set it.
Our current default is "submitunchanged" - I want to change it to "revertunchanged".
Can you guys help me out?
Thanks a lot in advance,
Norbert Szabo
_______________________________________________
http://maillist.perforce.com/mailman/listinfo/perforce-user
--
Stephen Vance
www.vance.com
_______________________________________________
_______________________________________________
http://maillist.perforce.com/mailman/listinfo/perforce-user
--
Stephen Vance
www.vance.com
Scivally
2011-06-07 13:30:01 UTC
Permalink
Posted on behalf of forum user 'Scivally'.

I would second the 'easier' approach of using a very simple form-out
trigger that either sets the defaults or overrides what the user sets for things
like SubmitOptions, Root, and rmDir.



[http://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=2698]
Post by Stephen Vance
Hi, Norbert --
No, this is not for people who don't know much about Perforce. Anything
in 'p4 help undoc' is essentially unsupported and some of it is
incomplete. The 'p4 spec' command is only effective for a limited part
of its potential functionality, but it's good enough for what you are
asking. You should read about 'p4 jobspec' and the associated
documentation on fields to understand how to edit the spec.
Another approach if you're workspaces are all from the same part of the
depot is to create a template spec that is only to be used to create
other workspaces with 'p4 client -t template newworkspace'. You can set
any of the attributes, but it's then up to the other developers to
remember to use the template.
Yet another approach, and this is probably what you've seen before, is
to create a form-out trigger (see 'p4 help triggers') that rewrites the
spec before it gets to the user. Details on that can be found in the P4
Admin Guide.
Steve
--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/948-how-to-set-the-default-submit-option-for-new-workspaces
Ivey, William
2011-06-07 14:30:06 UTC
Permalink
I would avoid overriding the user's explicit actions - you can't anticipate
every possible need.

In some cases where we might have overridden something like that, instead,
we bounce it back to the user warning them and with instructions to insert
a specific comment verifying the unusual change, something like:
# YesIReallyMeanIt

When the trigger sees that it passes the form (or submit) along without
further verification.

-Wm


-----Original Message-----
From: perforce-user-***@perforce.com [mailto:perforce-user-***@perforce.com] On Behalf Of Scivally
Sent: Tuesday, June 07, 2011 8:30 AM
To: perforce-***@perforce.com
Subject: Re: [p4] How to set the default submit option for new workspaces


Posted on behalf of forum user 'Scivally'.

I would second the 'easier' approach of using a very simple form-out
trigger that either sets the defaults or overrides what the user sets for things
like SubmitOptions, Root, and rmDir.
Sven Erik Knop
2017-03-29 13:45:29 UTC
Permalink
Hi Sean

it would be 'p4 configure set spec.custom=1', but this would not help you - you cannot change built-in fields.

Instead, use a simple form-out trigger to set the default. Much easier, supported and maintainable.

Cheers,

Sven Erik

--

Sven Erik Knop | Principal Solutions Engineer
Perforce Software<http://www.perforce.com>
T: +44 1189 771020<tel:+441189771020> | M: +44 7974 351514<tel:+447974351514>
Visit us on: Twitter<https://twitter.com/perforce> | LinkedIn<https://www.linkedin.com/company/perforce-software> | Facebook<https://www.facebook.com/Perforce>



On 29 Mar 2017, at 14:40, SeanT <perforce-user-***@forums.perforce.com<mailto:perforce-user-***@forums.perforce.com>> wrote:

Posted on behalf of forum user 'SeanT'.

I am also after a solution to this problem, i find it odd that the default
behaviour is to check in unchanged files.

I tried the solution described above but it doesn't seem to work :-

P4 spec client

this come up with
Custom spec of type 'client' is not allowed. Set spec.custom=1 to
override.

so i tried

P4 set spec.custom=1

and also
set spec.custom=1


but i still get the error message after both.

Can anyone suggest what i need to do to get this working?



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/948-how-to-set-the-default-submit-option-for-new-workspaces
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com<mailto:perforce-***@perforce.com>
http://maillist.perforce.com/mailman/listinfo/perforce-user

_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perfo
Sven Erik Knop
2017-03-29 14:16:47 UTC
Permalink
Hi Sean,

sorry I did not realise - 'p4 spec' is very advanced command.

Do you speak a scripting language such as (preferably) Python? I can show you some examples of simple triggers that should make your life easier I hope.

Cheers,

Sven Erik

--

Sven Erik Knop | Principal Solutions Engineer
Perforce Software<http://www.perforce.com>
T: +44 1189 771020<tel:+441189771020> | M: +44 7974 351514<tel:+447974351514>
Visit us on: Twitter<https://twitter.com/perforce> | LinkedIn<https://www.linkedin.com/company/perforce-software> | Facebook<https://www.facebook.com/Perforce>



On 29 Mar 2017, at 15:05, SeanT <perforce-user-***@forums.perforce.com<mailto:perforce-user-***@forums.perforce.com>> wrote:

Posted on behalf of forum user 'SeanT'.

Hi Sven.

thanks for the prompt reply, you say " use a simple form-out trigger to
set the default. Much easier, supported and maintainable."

This may be much easier when you are familiar with P4 triggers but for the
uninitiated such as myself, i haven't got a clue. I will have to read up on
their usage and see if i can get it to work trial and error style.




--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/948-how-to-set-the-default-submit-option-for-new-workspaces
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com<mailto:perforce-***@perforce.com>
http://maillist.perforce.com/mailman/listinfo/perforce-user

_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http:/
Sven Erik Knop
2017-03-29 14:42:16 UTC
Permalink
Indeed :-)

Cheers,

Sven Erik
--
Sven Erik Knop | Principal Solutions Engineer
Perforce Software<http://www.perforce.com>
T: +44 1189 771020<tel:+441189771020> | M: +44 7974 351514<tel:+447974351514>
Visit us on: Twitter<https://twitter.com/perforce> | LinkedIn<https://www.linkedin.com/company/perforce-software> | Facebook<https://www.facebook.com/Perforce>



On 29 Mar 2017, at 15:40, SeanT <perforce-user-***@forums.perforce.com<mailto:perforce-user-***@forums.perforce.com>> wrote:

Posted on behalf of forum user 'SeanT'.

Hi Sven,

i haven't done much scripting at all, it's mainly all C/C++, i can just
about get by with bash but am open to any assistance in any scripting language.

i am currently looking at https://www.perforce.com/blog/160826/advanced-form-triggers-p4python which
seems to give some good examples of form out triggers, in fact looking at
author��i guess it was written by yourself.
--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/948-how-to-set-the-default-submit-option-for-new-workspaces
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com<mailto:perforce-***@perforce.com>
http://maillist.perforce.com/mailman/listinfo/perforce-user

_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/listi
Sven Erik Knop
2017-03-29 14:47:19 UTC
Permalink
Here is a simple example:

https://swarm.workshop.perforce.com/projects/p4pythonlib/files/p4pythonlib/triggers/clienttrigger.py

This code is quite old - and it relies on P4Python, but you should get the idea.

Cheers,

Sven Erik
--
Sven Erik Knop | Principal Solutions Engineer
Perforce Software<http://www.perforce.com>
T: +44 1189 771020<tel:+441189771020> | M: +44 7974 351514<tel:+447974351514>
Visit us on: Twitter<https://twitter.com/perforce> | LinkedIn<https://www.linkedin.com/company/perforce-software> | Facebook<https://www.facebook.com/Perforce>



On 29 Mar 2017, at 15:42, Sven Erik Knop <***@perforce.com<mailto:***@perforce.com>> wrote:

Indeed :-)

Cheers,

Sven Erik
--
Sven Erik Knop | Principal Solutions Engineer
Perforce Software<http://www.perforce.com>
T: +44 1189 771020<tel:+441189771020> | M: +44 7974 351514<tel:+447974351514>
Visit us on: Twitter<https://twitter.com/perforce> | LinkedIn<https://www.linkedin.com/company/perforce-software> | Facebook<https://www.facebook.com/Perforce>



On 29 Mar 2017, at 15:40, SeanT <perforce-user-***@forums.perforce.com<mailto:perforce-user-***@forums.perforce.com><mailto:perforce-user-***@forums.perforce.com>> wrote:

Posted on behalf of forum user 'SeanT'.

Hi Sven,

i haven't done much scripting at all, it's mainly all C/C++, i can just
about get by with bash but am open to any assistance in any scripting language.

i am currently looking at https://www.perforce.com/blog/160826/advanced-form-triggers-p4python which
seems to give some good examples of form out triggers, in fact looking at
author��i guess it was written by yourself.
--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/948-how-to-set-the-default-submit-option-for-new-workspaces
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com<mailto:perforce-***@perforce.com>
http://maillist.perforce.com/mailman/listinfo/perforce-user

_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user

_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/listinfo/perfor
Loading...