1

p4 describe #clp4 python では、 に相当するものが必要です。

ただし、p4.run_describe("#cl")p4python を使用して同じコマンドを実行します。私はdictを取得します:

[{'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。つまり、影響を受けるファイル間の diff の変更が必要です。

Change 243446 by mohitc@NonDev1408-Dev on 2015/05/27 15:51:52

        Merging //ATTE/1507_SWP122 to OCX Main (//ATTE/1408-Dev)

Affected files ...

... //ATTE/1408-Dev/cust/oms/bb/cord9src/src/main/java/amdocs/oms/cust/osact/foundation/NegotiateServiceConnection.java#49 integrate

Differences ...

==== //ATTE/1408-Dev/cust/oms/bb/cord9src/src/main/java/amdocs/oms/cust/osact/foundation/NegotiateServiceConnection.java#49 (text) ====

p4python を使用して同じ出力を生成する他の方法はありますか?

4

1 に答える 1

5

これを試して:

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()

これがお役に立てば幸いです、ジェン。

于 2015-07-01T15:20:59.317 に答える