-1

Is it possible to automatically revert a file in Perforce if there are only keyword changes? "p4 revert -a" will revert only those file that do not have any diff, but is it actually possible to revert if diff is similar to:

< @version $Id: //mydepo/myfile#1 $
> @version $Id: //mydepo/myfile#2 $
Charles
  • 50,943
  • 13
  • 104
  • 142
mishik
  • 9,973
  • 9
  • 45
  • 67

2 Answers2

0

What does 'p4 filelog //mydepo/myfile' say?

It sounds like you submitted a second revision with no changes (other than the $Id$ expansion is different since it's a new revision). Are you saying that 'revert -a' didn't revert this otherwise-empty change?

You might want to look into the "revertunchanged" option on the workspace definition to avoid this in the future.

Bryan Pendleton
  • 16,128
  • 3
  • 32
  • 56
  • p4 filelog returns expected history: //mydepo/myfile ... #2 change ... edit ... #1 change ... add Tried to reproduce: 1) updated workspace to "revert unchanged files" 2) opened myfile for edit and changed $Id $ 3) p4 revert -a (not reverting) 4) p4 submit (submitted) – mishik Jun 06 '13 at 13:54
  • Why did you change the $Id$ in step (2)? The $Id$ is managed by the Perforce server, not by you. – Bryan Pendleton Jun 06 '13 at 21:38
  • That was a test. I was trying to reproduce scenario from the question. Here it where the question came from: I don't edit "myfile" file directly, instead it's being generated (.js file from .coffee one) and the "$Id $" line is always updated from ".coffee" file. Then Perforce, of course, changes it back, but only after the file is submitted, even when Id change is the only change – mishik Jun 07 '13 at 04:49
0

Well, I think I found a solution in a custom diff: http://pesche.schlau.ch/2007/07/03/merge-down-copy-up/

mishik
  • 9,973
  • 9
  • 45
  • 67