【问题标题】:How to convert Perforce depot locations to client view locations如何将 Perforce 仓库位置转换为客户端视图位置
【发布时间】:2023-04-08 20:12:01
【问题描述】:

我想知道如何将 Perforce 库位置转换为客户端视图位置以用于编写脚本。

我有一个脚本,它首先检查一个文件以在 perforce 中进行编辑,然后与该文件进行交互。我需要将仓库位置(即 \Projects\Project6)转换为客户端视图位置。 (即 d:\Projects\Project6)。

这可能吗?

【问题讨论】:

  • perforce 是最差的。

标签: view mapping client perforce


【解决方案1】:

我一直为此使用 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.

【讨论】:

【解决方案2】:

我会使用 p4 fstat 命令。我发现它的格式比 p4 更容易解析。此外,如果您在 python 中编写脚本,您可以使用-G option 将返回值编组为 python 字典。

还需要注意的是,您可以键入 p4 帮助命令 来查看命令列表以及它们的作用的简短说明。

【讨论】:

    【解决方案3】:

    查看p4 have 命令。你给它或者一个仓库位置一个客户端文件名,它给你仓库位置,客户端文件名,你那个文件的版本有。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-13
      • 2011-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多