mayank
mayank

Reputation: 33

P4 changes on a specific folder/file

I am trying to get the last checkin on a particular folder structure on perforce, I know "p4 changes -m1 'filepath" does the job, but the problem is the filepath has to be the depot file-path. What I have on the other hand is the local filepath something like "C:\Android\Version10.2\MyApp\" and not "//depot/Andoid/Version10.2/MyApp".

I tried using commands like "p4 fstat", "p4 where" and "p4 files", but for all of them it works fine with the depot file path, if I give the local file path, it keeps complaining file(s) not on client/no such file(s).

The other issue is I dont have rights to change the p4client on the machine. How do I get this to work?

Basic question then to sum up is being able to get the last change on a folder/file for which I have the local filepath.

Regards

Upvotes: 3

Views: 5818

Answers (3)

aflat
aflat

Reputation: 4329

If you're going to run any commands on files those files have to be in the workspace. The problem is probably that p4 on Windows defaults to the machine name as the workspace name if you don't supply one.

So you either have to run set P4CLIENT=<clientname> then run p4 changes -m1 <filename>, or p4 -c <clientname> changes -m1 <filepath> where <filepath> can be the file on your local file system, so C:\Android\Version10.2\MyApp\ would be acceptable.

Upvotes: 7

user100766
user100766

Reputation:

If you have a local file (as opposed to the depot-path), then you also should have a client-spec. You need to specify this with the -c option:

p4 -c <name-of-client-spec> changes -m1 <filepath>

Upvotes: 0

Graeme Perrow
Graeme Perrow

Reputation: 57258

Does p4 filelog -m 1 <filename> give you what you want? You can add the -l (lowercase L, not one) switch to get more information.

Upvotes: 0

Related Questions