Perforce - 在分支中查找最近更新的文件
Perforce - find the most recently updated files in a branch
如何在 Perforce 中按“最近修改”排序文件或获取最近修改文件的列表?
解决此问题的一种方法是从 p4 changes
开始(按最新排序输出)并将结果通过管道传输到 p4 files
:
C:\Perforce\test>p4 -ztag -F @=%change% changes -m10 -ssubmitted | p4 -x - files
//stream/main/move/bar#1 - move/add change 276 (text)
//stream/main/move/foo#2 - move/delete change 276 (text)
//stream/main/move/foo#1 - add change 275 (text)
//stream/main/seongchan-test/B/01.txt#3 - move/add change 274 (text)
//stream/main/seongchan-test/B/02.txt#2 - move/delete change 274 (text)
//stream/main/seongchan-test/B/01.txt#2 - move/delete change 273 (text)
//stream/main/seongchan-test/B/legacy_01.txt#1 - move/add change 273 (text)
//stream/main/seongchan-test/main/01.txt#3 - move/add change 272 (text)
//stream/main/seongchan-test/main/02.txt#2 - move/delete change 272 (text)
//stream/main/seongchan-test/main/01.txt#2 - move/delete change 271 (text)
//stream/main/seongchan-test/main/legacy_01.txt#1 - move/add change 271 (text)
//stream/main/seongchan-test/A/01.txt#3 - move/add change 269 (text)
//stream/main/seongchan-test/A/02.txt#2 - move/delete change 269 (text)
//stream/main/seongchan-test/A/01.txt#2 - move/delete change 268 (text)
//stream/main/seongchan-test/A/legacy_01.txt#1 - move/add change 268 (text)
//stream/main/seongchan-test/A/01.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/A/02.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/B/01.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/B/02.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/main/01.txt#1 - add change 266 (text)
//stream/main/seongchan-test/main/02.txt#1 - add change 266 (text)
请注意,文件修订按更改降序排列,因为我们通过 p4 files @=CHANGE
命令获取了每个批次。
如果您只想为“最近”的某个任意值“最近更新的文件”,另一种方法是执行一个带有修订范围的简单 p4 files
命令,例如日期范围:
C:\Perforce\test>p4 files @2021/07/30,now
//stream/main/main/A/01.txt#3 - move/add change 265 (text)
//stream/main/main/A/02.txt#2 - move/delete change 265 (text)
//stream/main/main/A/legacy_01.txt#1 - move/add change 264 (text)
//stream/main/main/B/01.txt#1 - branch change 263 (text)
//stream/main/main/B/02.txt#1 - branch change 263 (text)
//stream/main/move/bar#1 - move/add change 276 (text)
//stream/main/move/foo#2 - move/delete change 276 (text)
//stream/main/seongchan-test/A/01.txt#3 - move/add change 269 (text)
//stream/main/seongchan-test/A/02.txt#2 - move/delete change 269 (text)
//stream/main/seongchan-test/A/legacy_01.txt#1 - move/add change 268 (text)
//stream/main/seongchan-test/B/01.txt#3 - move/add change 274 (text)
//stream/main/seongchan-test/B/02.txt#2 - move/delete change 274 (text)
//stream/main/seongchan-test/B/legacy_01.txt#1 - move/add change 273 (text)
//stream/main/seongchan-test/main/01.txt#3 - move/add change 272 (text)
//stream/main/seongchan-test/main/02.txt#2 - move/delete change 272 (text)
//stream/main/seongchan-test/main/legacy_01.txt#1 - move/add change 271 (text)
在这两种情况下,您都可以包含一个文件规范以将结果限制到特定分支(例如,将 //depot/my_branch/...
添加到 p4 changes
命令,或将其包含在 @date,now
对于 p4 files
命令)。
如何在 Perforce 中按“最近修改”排序文件或获取最近修改文件的列表?
解决此问题的一种方法是从 p4 changes
开始(按最新排序输出)并将结果通过管道传输到 p4 files
:
C:\Perforce\test>p4 -ztag -F @=%change% changes -m10 -ssubmitted | p4 -x - files
//stream/main/move/bar#1 - move/add change 276 (text)
//stream/main/move/foo#2 - move/delete change 276 (text)
//stream/main/move/foo#1 - add change 275 (text)
//stream/main/seongchan-test/B/01.txt#3 - move/add change 274 (text)
//stream/main/seongchan-test/B/02.txt#2 - move/delete change 274 (text)
//stream/main/seongchan-test/B/01.txt#2 - move/delete change 273 (text)
//stream/main/seongchan-test/B/legacy_01.txt#1 - move/add change 273 (text)
//stream/main/seongchan-test/main/01.txt#3 - move/add change 272 (text)
//stream/main/seongchan-test/main/02.txt#2 - move/delete change 272 (text)
//stream/main/seongchan-test/main/01.txt#2 - move/delete change 271 (text)
//stream/main/seongchan-test/main/legacy_01.txt#1 - move/add change 271 (text)
//stream/main/seongchan-test/A/01.txt#3 - move/add change 269 (text)
//stream/main/seongchan-test/A/02.txt#2 - move/delete change 269 (text)
//stream/main/seongchan-test/A/01.txt#2 - move/delete change 268 (text)
//stream/main/seongchan-test/A/legacy_01.txt#1 - move/add change 268 (text)
//stream/main/seongchan-test/A/01.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/A/02.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/B/01.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/B/02.txt#1 - branch change 267 (text)
//stream/main/seongchan-test/main/01.txt#1 - add change 266 (text)
//stream/main/seongchan-test/main/02.txt#1 - add change 266 (text)
请注意,文件修订按更改降序排列,因为我们通过 p4 files @=CHANGE
命令获取了每个批次。
如果您只想为“最近”的某个任意值“最近更新的文件”,另一种方法是执行一个带有修订范围的简单 p4 files
命令,例如日期范围:
C:\Perforce\test>p4 files @2021/07/30,now
//stream/main/main/A/01.txt#3 - move/add change 265 (text)
//stream/main/main/A/02.txt#2 - move/delete change 265 (text)
//stream/main/main/A/legacy_01.txt#1 - move/add change 264 (text)
//stream/main/main/B/01.txt#1 - branch change 263 (text)
//stream/main/main/B/02.txt#1 - branch change 263 (text)
//stream/main/move/bar#1 - move/add change 276 (text)
//stream/main/move/foo#2 - move/delete change 276 (text)
//stream/main/seongchan-test/A/01.txt#3 - move/add change 269 (text)
//stream/main/seongchan-test/A/02.txt#2 - move/delete change 269 (text)
//stream/main/seongchan-test/A/legacy_01.txt#1 - move/add change 268 (text)
//stream/main/seongchan-test/B/01.txt#3 - move/add change 274 (text)
//stream/main/seongchan-test/B/02.txt#2 - move/delete change 274 (text)
//stream/main/seongchan-test/B/legacy_01.txt#1 - move/add change 273 (text)
//stream/main/seongchan-test/main/01.txt#3 - move/add change 272 (text)
//stream/main/seongchan-test/main/02.txt#2 - move/delete change 272 (text)
//stream/main/seongchan-test/main/legacy_01.txt#1 - move/add change 271 (text)
在这两种情况下,您都可以包含一个文件规范以将结果限制到特定分支(例如,将 //depot/my_branch/...
添加到 p4 changes
命令,或将其包含在 @date,now
对于 p4 files
命令)。