PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 21, 2022

[FIXED] How can I override configuration in .p4config?

 August 21, 2022     environment-variables, perforce     No comments   

Issue

P4EDITOR is set to "vim" in .p4config and I want to use a a different editor inside my Python script. If I change the environment variable P4EDITOR="custom_editor", it has no effect. Seems like perforce looks for .p4config file first and then loooks for environment variables. OS : freeBSD


Solution

Th best approach would be to upgrade the p4 version and do p4 -E P4EDITOR="custom editor" as suggested by @Bryan.

If upgrading P4 is not an option then copy the the existing .p4config file to a temp file and add P4EDITOR=custom editor to the temporary config file. If the P4EDITOR is already set, then modify it in the temporary config file. Also do export P4CONFIG=temp_config to make the temporary file as the config file.

p4 looks for the config file in the current directory and all it's parents. So the best way to find which config file should be copied and modified is by executing the command p4 set P4CONFIG. This is very useful if there are multiple config files on the machine.

$ p4 set P4CONFIG 
P4CONFIG=.p4config (config '/<path>/.p4config')


Answered By - gaganso
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing