I have files on P4 server under multiple branches e.g.
//depot/branch1/file.txt
//depot/branch2/file.txt
//depot/branch3/file.txt
assume that file.txt is same file but different branches
When i use commandline
p4 -c testWorkspace where somepath\file.txt
i get following result
-//depot/branch1/file.txt {client path depot path}
-//depot/branch2/file.txt {client path depot path}
//depot/branch3/file.txt {client path depot path}
and from that i can tell that file.txt in client testWorkspace should be accessed via branch3 (so from this depot path i will get FileSpec, Metadata, edit, etc
But when i try to do same via P4api.net and use
Client.GetClientFileMappings("somepath\file.txt")
or
P4Command cmd3 = new P4Command(con, "where", true, "somepath\file.txt");
P4CommandResult result3 = cmd3.Run();
i got similar result but without leading minus (dash -) signs
//depot/branch1/file.txt {client path depot path}
//depot/branch2/file.txt {client path depot path}
//depot/branch3/file.txt {client path depot path}
And i dont know what am i doing wrong here.
What i need is to get information to which branch current file for given workspace belongs, or even better get its correct FileSpec so i can use MoveFile, Add and so on. But i only get paths to all branches and can recognize to which branch it belongs for current workspace
So i discused this with P4 team member and they confirmed that GetClientFileMappings realy not returns information about exclusion.
They offered me a "workaround"
which is working for me. In original question, i mentions this not returns leading '-' which is true. But taggedObject instead contains key "unmap" which is enough to determine information.
I didnt notice this for first time, because i passed argument in wrong way. "file1.txt file2.txt" as simple string, not array of strings.
I also figured out one more "workaround" which is much more uglier (use p4 commandline, process.Start() and parse string result)