スクリプトを書く目的で、Perforce デポの場所をクライアント ビューの場所に変換する方法を知りたいです。
最初に perforce で編集するためにファイルをチェックアウトしてから、ファイルと対話するスクリプトがあります。デポの場所 (\Projects\Project6) をクライアント ビューの場所に変換する必要があります。(例:\Projects\Project6)。
これは可能ですか?
これには常に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.
p4 fstatコマンドを使用します。その形式は、 p4 haveよりも解析が少し簡単だと思います。さらに、Python でこれをスクリプト化している場合は、-G オプションを使用して、戻り値を Python 辞書としてマーシャリングすることができます。
また、p4 help コマンドを入力すると、コマンドのリストとその機能の簡単な説明が表示されることにも注意してください。
コマンドを確認してくださいp4 have
。デポの場所またはクライアントのファイル名を指定すると、デポの場所、クライアントのファイル名、およびそのファイルのバージョンが表示されます。