Discussion:
[p4] Setting writable flag for an entire folder
Sven Erik Knop
2017-05-12 11:07:33 UTC
Permalink
Yes this is valid use case.

I think you are best of using +w for the files in that directory and the type map for any new files you generate in that directory, then use 'p4 reconcile' in that directory to pick up anything changed.

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 12 May 2017, at 12:05, edwinjomathew <perforce-user-***@forums.perforce.com<mailto:perforce-user-***@forums.perforce.com>> wrote:

Posted on behalf of forum user 'edwinjomathew'.



[https://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=21794]
P4Reg, on 2017/05/11 10:12:32 UTC, said:
You can set the "Allwrite" option for an entire workspace so that all files sync'd will be writable (P4V->Edit workspace->Advanced tab, check the Allwrite option. I'm not aware of a way to restrict this to just a workspace subfolder

That's little risky for me because reconciling entire workspace will take a
long time and I want to prevent accidental editing. The reason why I want to set
a particular directory is because that directory contains some files which are
generated as part of the build process. Build process won't overwrite the
files if they are not writable.



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/5332-setting-writable-flag-for-an-entire-folder
_______________________________________________
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/listinf
Sven Erik Knop
2017-05-12 11:25:58 UTC
Permalink
So there are two questions here:

- how do I set +w to all files within all files and subfolders below a certain root?

p4 edit -t +w //depot/path/to/artefacts/...
p4 submit -d "Changed filetype to +w"

- how do I make sure that all files I add below //depot/path/to/artefacts/... have +w set automatically?

p4 typemap # opens editor

TypeMap:
+w //depot/path/to/artefacts/...

If you have existing entries in the type map (for example to identify binary files by their name or extension), you will have to add another line to the type map for the +w line - entries do not stack up.

https://www.perforce.com/perforce/r16.2/manuals/cmdref/p4_typemap.html

You will have to run

p4 reconcile //depot/path/to/artefacts/...

to pick up any changes and added files. This will also delete any files originally checked in and not present anymore in your directory.

You might want to use

p4 reconcile -e -a //depot/path/to/artefacts/...

to avoid deleting files if you like.

===========

Side question: do you really want to check in all build artefacts? You can ignore the directory via P4IGNORE or exclude it from your workspace view. Just thinking out loud here.


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 12 May 2017, at 12:10, edwinjomathew <perforce-user-***@forums.perforce.com<mailto:perforce-user-***@forums.perforce.com>> wrote:

Posted on behalf of forum user 'edwinjomathew'.



[https://forums.perforce.com/index.php?app=forums&module=forums&section=findpost&pid=21795]
P4Sven, on 2017/05/11 10:42:38 UTC, said:
You can set +w for individual files and then use the typemap to specify that you always want to use +w for files in that folder:
+w //depot/path/to/folder/...

I have a folder with multiple subfolders. There are more than 200 files in all
of them combines. Setting +w individually is possible but very tedious, plus I
have to keep track of new files that are getting added to these
folders. What exactly is a typemap?



--
Please click here to see the post in its original format:
http://forums.perforce.com/index.php?/topic/5332-setting-writable-flag-for-an-entire-folder
_______________________________________________
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

Loading...