OLD | NEW |
| 1 # coding: utf-8 |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 4 # found in the LICENSE file. |
4 | 5 |
5 """Samples patches to test patch.py.""" | 6 """Samples patches to test patch.py.""" |
6 | 7 |
7 | 8 |
8 class RAW(object): | 9 class RAW(object): |
9 PATCH = ( | 10 PATCH = ( |
10 'Index: chrome/file.cc\n' | 11 'Index: chrome/file.cc\n' |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 # http://codereview.chromium.org/download/issue9091003_9005_8009.diff | 116 # http://codereview.chromium.org/download/issue9091003_9005_8009.diff |
116 DIFFERENT = ( | 117 DIFFERENT = ( |
117 'Index: master/unittests/data/processes-summary.dat\n' | 118 'Index: master/unittests/data/processes-summary.dat\n' |
118 '===================================================================\n' | 119 '===================================================================\n' |
119 '--- master/unittests/data/processes-summary.dat\t(revision 116240)\n' | 120 '--- master/unittests/data/processes-summary.dat\t(revision 116240)\n' |
120 '+++ master/unittests/data/processes-summary.dat\t(working copy)\n' | 121 '+++ master/unittests/data/processes-summary.dat\t(working copy)\n' |
121 '@@ -1 +1 @@\n' | 122 '@@ -1 +1 @@\n' |
122 '-{"traces": {"1t_proc": ["2.0", "0.0"], "1t_proc_ref": ["1.0", ...\n' | 123 '-{"traces": {"1t_proc": ["2.0", "0.0"], "1t_proc_ref": ["1.0", ...\n' |
123 '+{"traces": {"1t_proc": ["2.0", "0.0"], "1t_proc_ref": ["1.0", ...\n') | 124 '+{"traces": {"1t_proc": ["2.0", "0.0"], "1t_proc_ref": ["1.0", ...\n') |
124 | 125 |
| 126 RENAME_UTF8 = ( |
| 127 u'--- file_à\n' |
| 128 u'+++ filé_b\n' |
| 129 u'@@ -3,6 +3,7 @@ bb\n' |
| 130 u' ccc\n' |
| 131 u' ddé\n' |
| 132 u' e\n' |
| 133 u'+FÔÒ!\n' |
| 134 u' ff\n' |
| 135 u' ggg\n' |
| 136 u' hh\n').encode('utf-8') |
| 137 |
125 | 138 |
126 class GIT(object): | 139 class GIT(object): |
127 """Sample patches generated by git diff.""" | 140 """Sample patches generated by git diff.""" |
128 PATCH = ( | 141 PATCH = ( |
129 'diff --git a/chrome/file.cc b/chrome/file.cc\n' | 142 'diff --git a/chrome/file.cc b/chrome/file.cc\n' |
130 'index 0e4de76..8320059 100644\n' | 143 'index 0e4de76..8320059 100644\n' |
131 '--- a/chrome/file.cc\n' | 144 '--- a/chrome/file.cc\n' |
132 '+++ b/chrome/file.cc\n' | 145 '+++ b/chrome/file.cc\n' |
133 '@@ -3,6 +3,7 @@ bb\n' | 146 '@@ -3,6 +3,7 @@ bb\n' |
134 ' ccc\n' | 147 ' ccc\n' |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 ' \n' | 322 ' \n' |
310 ' def GenerateScmDiff(self):\n' | 323 ' def GenerateScmDiff(self):\n' |
311 '- return scm.GIT.GenerateDiff(self._local_root, files=[self.Lo...\n' | 324 '- return scm.GIT.GenerateDiff(self._local_root, files=[self.Lo...\n' |
312 '+ if self._diff is None:\n' | 325 '+ if self._diff is None:\n' |
313 '+ self._diff = scm.GIT.GenerateDiff(\n' | 326 '+ self._diff = scm.GIT.GenerateDiff(\n' |
314 '+ self._local_root, files=[self.LocalPath(),])\n' | 327 '+ self._local_root, files=[self.LocalPath(),])\n' |
315 '+ return self._diff\n' | 328 '+ return self._diff\n' |
316 ' \n' | 329 ' \n' |
317 ' \n' | 330 ' \n' |
318 ' class Change(object):\n') | 331 ' class Change(object):\n') |
OLD | NEW |