2623: CVS Keywords break review requests

lamo*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 19, 2014
What version are you running?
1.6.6

What's the URL of the page containing the problem?
http://.../r/1/diff/

What steps will reproduce the problem?
1. Check in file to CVS with keyword expanded or unexpanded
2. Create review request against file with opposite state (unexpanded or expanded)
3. patch fails to apply with conflicts due to $Id$ and $Id: ... $ not matching either in diff or in context of diff

What is the expected output? What do you see instead?
Diffs that I can review, but instead a patch error traceback.

What operating system are you using? What browser?
N/A

Please provide any additional information below.

I've attached a patch I've used to fix our internal production deployment.
From 299a1705b554e8d54dded3bc606c38cf8a5750c6 Mon Sep 17 00:00:00 2001
From: Dan LaMotte <lamotte85@gmail.com>
Date: Mon, 4 Jun 2012 09:54:56 -0500
Subject: [PATCH] cvs: unexpand all cvs keywords so patch succeeds
CVS Keywords notoriously break diffs/patching.  This patch attempts to
unexpand all known keywords so that when a sandbox has an expanded keyword
and/or the server has a differing expanded keyword, that the patch process
doesn't break.
---
 reviewboard/diffviewer/parser.py |    5 ++++-
 reviewboard/scmtools/cvs.py      |   23 ++++++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/reviewboard/diffviewer/parser.py b/reviewboard/diffviewer/parser.py
index 8a25cc6..cdc3115 100644
--- a/reviewboard/diffviewer/parser.py
+++ b/reviewboard/diffviewer/parser.py
@@ -32,6 +32,9 @@ class DiffParser(object):
         self.data = data
         self.lines = data.splitlines()
 
+    def modify_line_hook(self, line):
+        return line
+
     def parse(sel
david
#1 david
  • +PendingReview
  • +Component-SCMTools
david
#2 david
  • -PendingReview
    +WontFix