How do I get my perforce java application to sync without forcing updates?

StackOverflow https://stackoverflow.com/questions/21429663

  •  04-10-2022
  •  | 
  •  

Pergunta

Basically I have a relatively simple application built with the p4 java api. The code is available here http://pastebin.com/Xq5WHj5e.

It logs onto the p4 server, then creates a client and gives it a root. It can sync perfectly, all the files I'm looking for appear in the correct places in the workspace. The problem is that even though it is not set to force (line 43, the first boolean) it still does.

As can been seen in the code, after the sync there is a simple check afterwards that get every file out of the directory and prints the name and last modified date. The last modified date gets changed every time the program runs which would imply that the file is being overridden.

Any help would be greatly appreciated. Thanks in advance.

Foi útil?

Solução

I think is because you're creating a new client every time. There's no tracking data for perforce to use to tell if a file is new or not, so it acts just like a force.

Try re-using an existing client across multiple invocations.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top