Get the changelist number of current workspace dir

2020-05-19 04:53发布

Each time we do a build, we have to record the changelist number of source files for tracking. We have different projects (under different directories) and they are synced at different changelist number. May you please show me how can we get the changelist number of a specific directory?

Any suggestions are appreciated. Thanks and Best Regards

标签: perforce
7条回答
劳资没心,怎么记你
2楼-- · 2020-05-19 05:27

You can also use the short version p4 changes -m1 #have if you don't want to specify the directory.

If you are using a shell for which "#" is a comment character like bash, remember to escape it as follows: p4 changes -m1 \#have

查看更多
闹够了就滚
3楼-- · 2020-05-19 05:30

In my case, I just want to know what changelist number is opened (not syned to) in a specific directory. For that, I do:

p4 opened -s | cut -d' ' -f5 | uniq
查看更多
一纸荒年 Trace。
4楼-- · 2020-05-19 05:36

If your build system always syncs to head on the directory before building, you can use p4 changes -m 1 //path/to/your/project/... to get the head changelist number for that directory.

If you go with this method, I would suggest running the changes command before syncing, and then explicitly syncing to that changelist. That should eliminate the chance of someone checking in between the changes command and the sync command.

查看更多
▲ chillily
5楼-- · 2020-05-19 05:38

In P4V client you can:

  1. Open Submitted tab
  2. Select Files under Filter: dropdown
  3. Select Current depot or workspace tree selection
  4. Sort by Change and the top line will be your answer
查看更多
Anthone
6楼-- · 2020-05-19 05:41

Also, there's p4 changes -m1 //path/to/your/project/...#have which, if run in the client workspace that synced the files for building, will give you the highest changelist number of the files in the workspace.

查看更多
做自己的国王
7楼-- · 2020-05-19 05:41

I use the "lazy manual way" (aka I don't know better) within the P4V client:

Use this in the "Submitted" tab filters: //yourproject/...#>have And it will show you which CLs you haven't synched, note the oldest one. Remove the #>have filter and see what's the CL that came before the one you just noted.

查看更多
登录 后发表回答