Questions tagged [p4python]

p4python is a Python interface to Perforce, a source-code control system.

P4Python: Perforce's API for Python allows you to write Python scripts that directly execute Perforce commands. Documentation can be found here: Helix Core P4Python Developer Guide.

98 questions
2
votes
1 answer

Connection Timing out while install p4python using pip

There seems to be a connection time out when trying to install p4python on a ubuntu system. I am trying install this using pip on an ubuntu install on a vm. Here is the stack trace: ~$ pip install p4python Downloading/unpacking p4python Downloading…
Rijo Simon
  • 777
  • 3
  • 15
  • 35
2
votes
0 answers

datetime in 'changes' and 'info'

I've been using P4Python for getting changelist from Perforce. Since I need the submitted changes of last 5 minutes, I'm getting time from the server itself & reducing 5 minutes from it. This is what I used: info = p4.run("info") This returns…
Alok
  • 2,629
  • 4
  • 28
  • 40
2
votes
1 answer

p4python fetch_, run_ and save_ command

The fetch_spec, run_spec and save_spec commands look useful, but they omit the -f option in the command, which means you can only run it on your own specs. If you're managing a DB for a large group and need to add/delete users,groups,clients,etc.,…
Paul Nelson
  • 1,291
  • 4
  • 13
  • 20
2
votes
2 answers

p4python modify changelist description

The snippet of this p4python code gets the perforce description and removes the square brackets mentioned in the description. I am planning to make this script called during the change-commit trigger to replace the CL description before even…
thunderbird
  • 121
  • 2
  • 10
2
votes
1 answer

Cannot connect to a ssl-enabled perforce server using p4python

Python version: 2.7.8 P4Python version: P4PYTHON/NTX86/2014.1/807760 (2014.1/807760 API) (2014/03/18) Client OS: Win2k8 Server Python script: from P4 import P4, P4Exception p4agent = P4() p4agent.port = "ssl:my-perforce-server.com:1666" p4agent.user…
user756825
  • 41
  • 3
2
votes
3 answers

How do I build and install P4Python for Mac OS X?

I've been unable to build P4Python for an Intel Mac OS X 10.5.5. These are my steps: I downloaded p4python.tgz (from http://filehost.perforce.com/perforce/r07.3/tools/) and expanded it into "P4Python-2007.3". I downloaded p4api.tar…
Daryl Spitzer
  • 143,156
  • 76
  • 154
  • 173
2
votes
1 answer

How to get the type of change in P4Python

I'm trying to work with P4Python, and hoping to find a way to be able to check what's the type of change of each file in the changelist. I mean, I'd like to know if it's a modification, or whether this file has Marked for Add or Marked for…
fashasha
  • 481
  • 2
  • 7
  • 19
2
votes
1 answer

Error when installing p4python on osx-MountainLion

I have Python version: Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin downloaded p4python from http://www.perforce.com/product/components/apis#p4python tar -zxvf…
1
vote
1 answer

P4Python create label without tmp file from getting opened

I have a requirement to create multiple perforce labels from my test script. Following snippet creates a perforce label. But it happens to open a .tmp file for me to edit the description and the process waits until I close the .tmp file. Is there a…
1
vote
0 answers

Perforce command timeout doesn't seem to work

I am trying to set timeout to the perforce commands using the net.maxwait configurable as per this document: https://community.perforce.com/s/article/3751 user@test:~/perforce/sandbox$ date; p4 -v net.maxwait=1 sync -f; date Wed Dec 30 05:38:19 EST…
Safwan
  • 29
  • 6
1
vote
2 answers

How to open a checked out file P4 Python

I am currently writing a script in Python with the P4Python API which automates the process of checking out a file in Perforce and making some changes to it. I'm currently trying to figure out how to open the file which has been checked out so I can…
RayH99
  • 39
  • 7
1
vote
1 answer

P4Python: AttributeError: type object 'P4' has no attribute 'MergeData'

I am trying to create a P4.MergeData object to use with a resolver. I get this error (in title) when I do: import P4 md = P4.MergeData() How do I create this object? Or if I don't need to, how do I merge two files in general?
jlw8299
  • 11
  • 1
1
vote
2 answers

How to get the changelist number of perforce?

I managed to create an empty changelist in my perforce client workspace following the steps below : >>> from P4 import P4,P4Exception >>> p4 = P4() >>> p4.connect() P4 [ciastro@ciastromac perforce:1666] connected >>> change = p4.fetch_change() >>>…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
1
vote
1 answer

Copy comman in p4python with Perforce

For branching I from a certain CL and have it as a changelist I realized that Perforce uses the copy keyword. I'm tryin to use the same keyword but getting an error saying that the options are invalid. Following is my code: result =…
Payam30
  • 689
  • 1
  • 5
  • 20
1
vote
1 answer

branching when ther has been a a branch with the same name that doesn't exist anymore p4python

While testing my application using p4python I came across an intressting issue. I branch a while ago from a main stream directory to a testing directory, I did a revert on that branching since something was wrong with it so the testing branch…
Payam30
  • 689
  • 1
  • 5
  • 20