:: Batch file for "Merge-Down-Copy-Up", see
:: http://www.perforce.com/perforce/conferences/eu/2006/presentations/laura_wingerd/ConvergenceVsDivergence.html#ConvergenceVsDivergence.section.22
::
:: $Id: //depot.hugwi.ch/meta/revert_unchanged.bat#1 $
:: $Change: 27476 $
:: $DateTime: 2007/05/23 11:18:35 $
:: $Author: peter.steiner $
:: $Maintainer: peter.steiner $
:: $Created: peter.steiner 2007/05/23 $
:: $Copyright: Hug-Witschi AG, CH-3178 Bsingen, http://www.hugwi.ch $
::
:: According to Laura Wingerds talk the step 4 for "Assuring a correct copy"
:: is "diff -sr | p4 -x - revert". Unfortunately, this does not work when using
:: keywords (text+k). p4 thinks that files differ even if they differ only in
:: keywords).
::
:: The workaround is to use a custom diff script via the P4DIFF environment variable
:: The helper batch diff_no_keywords.bat should be retrieved from the
:: same directory as %0 (this batch here).
:: The parameter modifiers ~d und ~p are supported by Windows XP SP2;
:: I don't know if earlier Windows version support them too. Look it up
:: in the Windows help under "Using batch parameters"
@set P4DIFF=%~d0%~p0diff_no_keywords.bat
:: Can't use "p4 diff -sr" here, because "-sr" doesn't work with P4DIFF
@p4 diff %* | grep -v -E "==== .* - .* ====" | p4 -x - revert