9

スクリプトを書く目的で、Perforce デポの場所をクライアント ビューの場所に変換する方法を知りたいです。

最初に perforce で編集するためにファイルをチェックアウトしてから、ファイルと対話するスクリプトがあります。デポの場所 (\Projects\Project6) をクライアント ビューの場所に変換する必要があります。(例:\Projects\Project6)。

これは可能ですか?

4

3 に答える 3

11

これには常にp4 whereコマンドを使用してきました。組み込みのヘルプからの説明は次のとおりです。

where -- Show how file names map through the client view

p4 where [ file ... ]

    Where shows how the named files map through the client view.
    For each argument, three names are produced: the name in the
    depot, the name on the client in Perforce syntax, and the name
    on the client in local syntax.

    If no file is given, the mapping for '...' (all files in the
    current directory and below) is shown.

    Note that 'p4 where' does not determine where any real files are.
    It only computes where they should be according to the client view.
于 2008-11-19T01:41:47.370 に答える
4

p4 fstatコマンドを使用します。その形式は、 p4 haveよりも解析が少し簡単だと思います。さらに、Python でこれをスクリプト化している場合は、-G オプションを使用して、戻り値を Python 辞書としてマーシャリングすることができます。

また、p4 help コマンドを入力すると、コマンドのリストとその機能の簡単な説明が表示されることにも注意してください。

于 2008-11-19T01:34:28.290 に答える
2

コマンドを確認してくださいp4 have。デポの場所またはクライアントのファイル名を指定するとデポの場所、クライアントのファイル名、およびそのファイルのバージョンが表示されます。

于 2008-11-19T00:49:48.847 に答える