Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: tests/patches_data.py

Issue 7847021: Move sample patches to its own file so it can be reused by rietveld_test.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/patch_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Samples patches to test patch.py."""
6
7
8 class RAW(object):
9 PATCH = (
10 'Index: chrome/file.cc\n'
11 '===================================================================\n'
12 '--- chrome/file.cc\t(revision 74690)\n'
13 '+++ chrome/file.cc\t(working copy)\n'
14 '@@ -80,10 +80,13 @@\n'
15 ' // Foo\n'
16 ' // Bar\n'
17 ' void foo() {\n'
18 '- return bar;\n'
19 '+ return foo;\n'
20 ' }\n'
21 ' \n'
22 ' \n')
23
24 NEW = (
25 '--- /dev/null\n'
26 '+++ foo\n'
27 '@@ -0,0 +1 @@\n'
28 '+bar\n')
29
30 NEW_NOT_NULL = (
31 '--- file_a\n'
32 '+++ file_a\n'
33 '@@ -0,0 +1 @@\n'
34 '+foo\n')
35
36 MINIMAL_NEW = (
37 '--- /dev/null\t2\n'
38 '+++ chrome/file.cc\tfoo\n')
39
40 MINIMAL = (
41 '--- file_a\n'
42 '+++ file_a\n')
43
44 MINIMAL_RENAME = (
45 '--- file_a\n'
46 '+++ file_b\n')
47
48 DELETE = (
49 '--- tools/clang_check/README.chromium\n'
50 '+++ /dev/null\n'
51 '@@ -1,1 +0,0 @@\n'
52 '-bar\n')
53
54 MINIMAL_DELETE = (
55 '--- chrome/file.cc\tbar\n'
56 '+++ /dev/null\tfoo\n')
57
58
59 class GIT(object):
60 """Sample patches generated by git diff."""
61 PATCH = (
62 'diff --git a/chrome/file.cc b/chrome/file.cc\n'
63 'index 0e4de76..8320059 100644\n'
64 '--- a/chrome/file.cc\n'
65 '+++ b/chrome/file.cc\n'
66 '@@ -3,6 +3,7 @@ bb\n'
67 ' ccc\n'
68 ' dd\n'
69 ' e\n'
70 '+FOO!\n'
71 ' ff\n'
72 ' ggg\n'
73 ' hh\n')
74
75 # http://codereview.chromium.org/download/issue6368055_22_29.diff
76 DELETE = (
77 'Index: tools/clang_check/README.chromium\n'
78 'diff --git a/tools/clang_check/README.chromium '
79 'b/tools/clang_check/README.chromium\n'
80 'deleted file mode 100644\n'
81 'index fcaa7e0e94bb604a026c4f478fecb1c5796f5413..'
82 '0000000000000000000000000000000000000000\n'
83 '--- a/tools/clang_check/README.chromium\n'
84 '+++ /dev/null\n'
85 '@@ -1,9 +0,0 @@\n'
86 '-These are terrible, terrible hacks.\n'
87 '-\n'
88 '-They are meant \n'
89 '-AND doing the normal \n'
90 '-run during normal \n'
91 '-build system to do a syntax check.\n'
92 '-\n'
93 '-Also see\n'
94 '\n')
95
96 # http://codereview.chromium.org/download/issue6250123_3013_6010.diff
97 RENAME_PARTIAL = (
98 'Index: chromeos/views/webui_menu_widget.h\n'
99 'diff --git a/chromeos/views/DOMui_menu_widget.h '
100 'b/chromeos/views/webui_menu_widget.h\n'
101 'similarity index 79%\n'
102 'rename from chromeos/views/DOMui_menu_widget.h\n'
103 'rename to chromeos/views/webui_menu_widget.h\n'
104 'index 095d4c474fd9718f5aebfa41a1ccb2d951356d41..'
105 '157925075434b590e8acaaf605a64f24978ba08b 100644\n'
106 '--- a/chromeos/views/DOMui_menu_widget.h\n'
107 '+++ b/chromeos/views/webui_menu_widget.h\n'
108 '@@ -1,9 +1,9 @@\n'
109 '-// Copyright (c) 2010\n'
110 '+// Copyright (c) 2011\n'
111 ' // Use of this source code\n'
112 ' // found in the LICENSE file.\n'
113 ' \n'
114 '-#ifndef DOM\n'
115 '-#define DOM\n'
116 '+#ifndef WEB\n'
117 '+#define WEB\n'
118 ' #pragma once\n'
119 ' \n'
120 ' #include <string>\n')
121
122 # http://codereview.chromium.org/download/issue6287022_3001_4010.diff
123 RENAME = (
124 'Index: tools/run_local_server.sh\n'
125 'diff --git a/tools/run_local_server.PY b/tools/run_local_server.sh\n'
126 'similarity index 100%\n'
127 'rename from tools/run_local_server.PY\n'
128 'rename to tools/run_local_server.sh\n')
129
130 COPY = (
131 'diff --git a/PRESUBMIT.py b/pp\n'
132 'similarity index 100%\n'
133 'copy from PRESUBMIT.py\n'
134 'copy to pp\n')
135
136 COPY_PARTIAL = (
137 'diff --git a/wtf b/wtf2\n'
138 'similarity index 98%\n'
139 'copy from wtf\n'
140 'copy to wtf2\n'
141 'index 79fbaf3..3560689 100755\n'
142 '--- a/wtf\n'
143 '+++ b/wtf2\n'
144 '@@ -1,4 +1,4 @@\n'
145 '-#!/usr/bin/env python\n'
146 '+#!/usr/bin/env python1.3\n'
147 ' # Copyright (c) 2010 The Chromium Authors. All rights reserved.\n'
148 ' # blah blah blah as\n'
149 ' # found in the LICENSE file.\n')
150
151 NEW = (
152 'diff --git a/foo b/foo\n'
153 'new file mode 100644\n'
154 'index 0000000..5716ca5\n'
155 '--- /dev/null\n'
156 '+++ b/foo\n'
157 '@@ -0,0 +1 @@\n'
158 '+bar\n')
159
160 NEW_EXE = (
161 'diff --git a/natsort_test.py b/natsort_test.py\n'
162 'new file mode 100755\n'
163 '--- /dev/null\n'
164 '+++ b/natsort_test.py\n'
165 '@@ -0,0 +1,1 @@\n'
166 '+#!/usr/bin/env python\n')
167
168 NEW_MODE = (
169 'diff --git a/natsort_test.py b/natsort_test.py\n'
170 'new file mode 100644\n'
171 '--- /dev/null\n'
172 '+++ b/natsort_test.py\n'
173 '@@ -0,0 +1,1 @@\n'
174 '+#!/usr/bin/env python\n')
175
176 MODE_EXE = (
177 'diff --git a/git_cl/git-cl b/git_cl/git-cl\n'
178 'old mode 100644\n'
179 'new mode 100755\n')
180
181 MODE_EXE_JUNK = (
182 'Index: Junk\n'
183 'diff --git a/git_cl/git-cl b/git_cl/git-cl\n'
184 'old mode 100644\n'
185 'new mode 100755\n')
OLDNEW
« no previous file with comments | « tests/patch_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698