p4 describ需要等效的python命令

2024-04-20 05:47:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要使用p4python中的p4 describe #cl的等价物。在

但是,使用p4python运行相同的命令p4.run_describe("#cl")。我明白了:

[{'client': 'NonDev1408-Dev', 'digest': ['E41FFB100C73F7B443EE8DE7A0DD966C'], 'desc': 'Merging //ATTE/1507_SWP122 to OCX Main (//ATTE/1408-Dev)\n', 'type': ['text'], 'fileSize': ['33067'], 'status': 'submitted', 'rev': ['49'], 'depotFile': ['//ATTE/1408-Dev/cust/oms/bb/cord9src/src/main/java/amdocs/oms/cust/osact/foundation/NegotiateServiceConnection.java'], 'action': ['integrate'], 'user': 'mohitc', 'change': '243446', 'time': '1432731112', 'path': '//ATTE/1408-Dev/cust/oms/bb/cord9src/src/main/java/amdocs/oms/cust/osact/foundation/*', 'changeType': 'public'}]

相反,我希望得到p4 describe 243446给出的输出,也就是说,我希望在受影响的文件之间进行差异更改:

^{pr2}$

有没有其他方法可以使用p4python生成相同的输出?在


Tags: devsrcclmainjavaomsbbdescribe
1条回答
网友
1楼 · 发布于 2024-04-20 05:47:03

试试这个:

import P4

p4 = P4.P4()
try:
    p4.connect()
    info = p4.run("info")
    for key in info[0]:
        print key, "=", info[0][key]
    print
    print


    if 1:
        p4.tagged = 0 

        #This makes the output untagged.
        result = p4.run("describe","5707")
        print result

except P4.P4Exception, ex:
    for w in p4.warnings:
        print w

finally:
    p4.disconnect()

希望这有帮助, 珍。在

相关问题 更多 >