How to get the latest list of Perforce changes in a depot for the current client specification

I want to get the latest list of changes to the depot for my current client specification. This will actually be a change that will be in sync with what I did p4 syncin my workspace.

I tried to do it p4 changes -s submitted -m1 -c [client-name], but this returns the most recent change that was sent through my client.

Execution p4 changes -s submitted -m1 //depot/path/...will work, but I do not want to request a client specification to find out what a depot path is. Plus, if there was more than one comparison, I would not know how to understand this.

There seems to be an easy way to do this that I don't see.

EDIT

I had to request the client specification, but as indicated in the accepted answer, I could use the client spec root as the path to the file and did not need to view the type mappings.

Final solution using P4Python:

# Get client
clientspec = p4.fetch_client()
root = clientspec["Root"]

# Get latest changenum in client mapping
changes = p4.run("changes", "-s", "submitted", "-m1", root + "/...")
changenum = changes[0]['change']
+5
source share
1 answer

I think you will have to request your client specification in order to find its local root. If you do not need to worry about AltRoots, this could be:

p4 changes -s submitted -m 1 "$(p4 client -o | grep "^Root:" | cut -f 2)/..."

in bash. Using the local client root instead of the depot path resolves the issue with multiple mappings.

+1
source

All Articles