Jump to content

Custom tool to get latest revision from depot and resolve files

  • Please log in to reply
2 replies to this topic

#1 Elad



  • Members
  • Pip
  • 2 posts

Posted 23 July 2019 - 06:09 AM

I'm working on files that are being changed frequently in the depot, so I'm trying to add a custom tool that will let me select multiple checked out files in a changelist and for each one will automticaly:
1. get latest revision from deopt
2. resolve it with merging (skip if there is conflict)

For that I created the file 'GetLatestAndResolve.bat' with these commands:

p4 sync %1#head
p4 resolve -a %1

Then I added a custom tool that calls to the above file and passes %d as argument.

I have 2 questions:

1. If I select multiple files and use the custom tool I created, only one file is being processed, what I'm missing?

2. What's the different between
resolve -a
resolve -am
both should resolve with merging and skip if there is conflict.

#2 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 894 posts

Posted 24 July 2019 - 03:34 PM

1. The script SHOULD get called once per selected file if you're passing it %d (lowercase).  If it doesn't that might be a bug in P4V.  You don't want to use %D because your script isn't set up to handle multiple arguments.
2. "resolve -a" isn't actually documented as valid syntax, but IIRC there's a bug/feature where if there's no flag after the "a" then it defaults to "m".  Just use "resolve -am" unless it's important to you for your script to be smaller by one byte.  :P

#3 Elad



  • Members
  • Pip
  • 2 posts

Posted 01 August 2019 - 12:52 PM

Thanks @Sambwise !
Base on your input I have changed the argument to be %D +changed the script to be:
@echo off
FOR %%A IN (%*) DO (
p4 sync %%A#head
p4 resolve -a %%A

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users