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 submitting the change. Not sure what's wrong, but the trigger doesnt take my new change description.. Has anyone tried doing this using the p4python? Any hints highly appreciated
describe = p4.run('describe', changeList)
print describe
description = describe[0].get('desc')
print description
description = description.replace('[', '')
description = description.replace(']', '')
print description
First describe prints
[{'status': 'pending', 'changeType': 'public', 'rev': ['21'], 'client': 'workspace1', 'user': 'username', 'time': '1432010818', 'action': ['edit'], 'type': ['text'], 'depotFile': ['//depot/repo/Vagrantfile'], 'change': '12345', 'desc': '[ABC-789] testfile commit'}]
First description prints
[ABC-789] testfile commit
Second description removes the square brackets
ABC-789 testfile commit