p4.connect() # Connect to the Perforce Server
info = p4.run("info") # Run "p4 info" (returns a dict)
changes_results = p4.run('changes','-s','submitted', '//components/rel/...@2017/11/01,@2017/12/31')
changes_lists = []
for change_result in changes_results:
change_list = change_result['change']
changes_lists.append(change_list)
print('Total Change list found ', len(changes_lists))
for idx_main, change_id in enumerate(changes_lists):
print('\n\n\n', change_id, idx_main)
result = p4.run('describe', change_id)
print(result)
depotfiles = result[0]["depotFile"]
filesrevision = result[0]["rev"]
一部の変更リストでは、これは完全に正常に機能しており、p4.run はリストを返し、変更リスト ファイルとそのリビジョン番号を抽出できます。
ただし、p4.run が適切なリストを返さず、代わりに文字列を返す場合があり、チェンジリスト ファイルとそのリビジョン番号を抽出できず、以下のエラーが発生します。
depotfiles = result[0]["depotFile"] TypeError: 文字列インデックスは整数でなければなりません
P4 または私のコードに問題がありますか。