在 Perforce 中,如何在待定更改列表中找到文件的本地路径? [英] In Perforce, how do I find the local path for files in a pending changelist?

查看:57
本文介绍了在 Perforce 中,如何在待定更改列表中找到文件的本地路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个 Perforce 更改列表编号,我想找到该待处理更改列表中所有文件的本地路径.

Given a Perforce changelist number, I want to find the local path of all files in that pending changelist.

  • p4 describe changelist -- 获取变更列表中文件的仓库路径(方法 1)
  • p4 opens -c changelist -- 获取变更列表中文件的仓库路径(方法 2)
  • p4 have -- 为我获取以前提交的所有文件的库路径和本地路径
  • p4 describe changelist -- gets me the depot path for files in the changelist (method 1)
  • p4 opened -c changelist -- gets me the depot path for files in the changelist (method 2)
  • p4 have -- gets me the depot path and local path for all files that have previously been submitted

使用 p4 describep4 have 的组合,我可以找到之前已提交给 Perforce(并已打开)的更改列表中所有文件的本地路径用于删除编辑).

Using a combination of p4 describe and p4 have, I can find the local paths for all files in the changelist that have previously been submitted to Perforce (and are opened for delete or edit).

但是那些为 add 打开的文件呢?p4 have 对为 add 打开的文件一无所知.

But what about files that are opened for add? p4 have does not know anything about files that are opened for add.

给定一个待定的 Perforce 更改列表,我如何找到将要添加到 Perforce 的文件的本地路径?

Given a pending Perforce changelist, how do I find the local path for files that are about to be added to Perforce?

推荐答案

要输出更改列表的所有待添加的本地路径,您可以使用:

To output the local path of all pending adds of a changelist you can use:

p4 opened -c changelist | grep -w add | sed 's/#.*//' \
| p4 -x - where | awk '/^\// {print $3}'

这在没有 grep 的情况下也是一样的,但有点模糊:

This does the same without grep but is a bit more obscure:

p4 opened -c changelist | sed -n 's/\(.*\)#.*- add .*/\1/p' \
| p4 -x - where | awk '/^\// {print $3}'

这篇关于在 Perforce 中,如何在待定更改列表中找到文件的本地路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆