| OLD | NEW |
| (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 '@@ -3,6 +3,7 @@ bb\n' | |
| 15 ' ccc\n' | |
| 16 ' dd\n' | |
| 17 ' e\n' | |
| 18 '+FOO!\n' | |
| 19 ' ff\n' | |
| 20 ' ggg\n' | |
| 21 ' hh\n') | |
| 22 | |
| 23 NEW = ( | |
| 24 '--- /dev/null\n' | |
| 25 '+++ foo\n' | |
| 26 '@@ -0,0 +1 @@\n' | |
| 27 '+bar\n') | |
| 28 | |
| 29 NEW_NOT_NULL = ( | |
| 30 '--- file_a\n' | |
| 31 '+++ file_a\n' | |
| 32 '@@ -0,0 +1 @@\n' | |
| 33 '+foo\n') | |
| 34 | |
| 35 MINIMAL_NEW = ( | |
| 36 '--- /dev/null\t2\n' | |
| 37 '+++ chrome/file.cc\tfoo\n') | |
| 38 | |
| 39 MINIMAL = ( | |
| 40 '--- file_a\n' | |
| 41 '+++ file_a\n') | |
| 42 | |
| 43 MINIMAL_RENAME = ( | |
| 44 '--- file_a\n' | |
| 45 '+++ file_b\n') | |
| 46 | |
| 47 DELETE = ( | |
| 48 '--- tools/clang_check/README.chromium\n' | |
| 49 '+++ /dev/null\n' | |
| 50 '@@ -1,1 +0,0 @@\n' | |
| 51 '-bar\n') | |
| 52 | |
| 53 MINIMAL_DELETE = ( | |
| 54 '--- chrome/file.cc\tbar\n' | |
| 55 '+++ /dev/null\tfoo\n') | |
| 56 | |
| 57 # http://codereview.chromium.org/api/7530007/5001 | |
| 58 # http://codereview.chromium.org/download/issue7530007_5001_4011.diff | |
| 59 CRAP_ONLY = ( | |
| 60 'Index: scripts/master/factory/skia/__init__.py\n' | |
| 61 '===================================================================\n') | |
| 62 | |
| 63 | |
| 64 class GIT(object): | |
| 65 """Sample patches generated by git diff.""" | |
| 66 PATCH = ( | |
| 67 'diff --git a/chrome/file.cc b/chrome/file.cc\n' | |
| 68 'index 0e4de76..8320059 100644\n' | |
| 69 '--- a/chrome/file.cc\n' | |
| 70 '+++ b/chrome/file.cc\n' | |
| 71 '@@ -3,6 +3,7 @@ bb\n' | |
| 72 ' ccc\n' | |
| 73 ' dd\n' | |
| 74 ' e\n' | |
| 75 '+FOO!\n' | |
| 76 ' ff\n' | |
| 77 ' ggg\n' | |
| 78 ' hh\n') | |
| 79 | |
| 80 # http://codereview.chromium.org/download/issue6368055_22_29.diff | |
| 81 DELETE = ( | |
| 82 'Index: tools/clang_check/README.chromium\n' | |
| 83 'diff --git a/tools/clang_check/README.chromium ' | |
| 84 'b/tools/clang_check/README.chromium\n' | |
| 85 'deleted file mode 100644\n' | |
| 86 'index fcaa7e0e94bb604a026c4f478fecb1c5796f5413..' | |
| 87 '0000000000000000000000000000000000000000\n' | |
| 88 '--- a/tools/clang_check/README.chromium\n' | |
| 89 '+++ /dev/null\n' | |
| 90 '@@ -1,9 +0,0 @@\n' | |
| 91 '-These are terrible, terrible hacks.\n' | |
| 92 '-\n' | |
| 93 '-They are meant \n' | |
| 94 '-AND doing the normal \n' | |
| 95 '-run during normal \n' | |
| 96 '-build system to do a syntax check.\n' | |
| 97 '-\n' | |
| 98 '-Also see\n' | |
| 99 '\n') | |
| 100 | |
| 101 # http://codereview.chromium.org/download/issue6250123_3013_6010.diff | |
| 102 RENAME_PARTIAL = ( | |
| 103 'Index: chromeos/views/webui_menu_widget.h\n' | |
| 104 'diff --git a/chromeos/views/DOMui_menu_widget.h ' | |
| 105 'b/chromeos/views/webui_menu_widget.h\n' | |
| 106 'similarity index 79%\n' | |
| 107 'rename from chromeos/views/DOMui_menu_widget.h\n' | |
| 108 'rename to chromeos/views/webui_menu_widget.h\n' | |
| 109 'index 095d4c474fd9718f5aebfa41a1ccb2d951356d41..' | |
| 110 '157925075434b590e8acaaf605a64f24978ba08b 100644\n' | |
| 111 '--- a/chromeos/views/DOMui_menu_widget.h\n' | |
| 112 '+++ b/chromeos/views/webui_menu_widget.h\n' | |
| 113 '@@ -1,9 +1,9 @@\n' | |
| 114 '-// Copyright (c) 2010\n' | |
| 115 '+// Copyright (c) 2011\n' | |
| 116 ' // Use of this source code\n' | |
| 117 ' // found in the LICENSE file.\n' | |
| 118 ' \n' | |
| 119 '-#ifndef DOM\n' | |
| 120 '-#define DOM\n' | |
| 121 '+#ifndef WEB\n' | |
| 122 '+#define WEB\n' | |
| 123 ' #pragma once\n' | |
| 124 ' \n' | |
| 125 ' #include <string>\n') | |
| 126 | |
| 127 # http://codereview.chromium.org/download/issue6287022_3001_4010.diff | |
| 128 RENAME = ( | |
| 129 'Index: tools/run_local_server.sh\n' | |
| 130 'diff --git a/tools/run_local_server.PY b/tools/run_local_server.sh\n' | |
| 131 'similarity index 100%\n' | |
| 132 'rename from tools/run_local_server.PY\n' | |
| 133 'rename to tools/run_local_server.sh\n') | |
| 134 | |
| 135 COPY = ( | |
| 136 'diff --git a/PRESUBMIT.py b/pp\n' | |
| 137 'similarity index 100%\n' | |
| 138 'copy from PRESUBMIT.py\n' | |
| 139 'copy to pp\n') | |
| 140 | |
| 141 COPY_PARTIAL = ( | |
| 142 'diff --git a/wtf b/wtf2\n' | |
| 143 'similarity index 98%\n' | |
| 144 'copy from wtf\n' | |
| 145 'copy to wtf2\n' | |
| 146 'index 79fbaf3..3560689 100755\n' | |
| 147 '--- a/wtf\n' | |
| 148 '+++ b/wtf2\n' | |
| 149 '@@ -1,4 +1,4 @@\n' | |
| 150 '-#!/usr/bin/env python\n' | |
| 151 '+#!/usr/bin/env python1.3\n' | |
| 152 ' # Copyright (c) 2010 The Chromium Authors. All rights reserved.\n' | |
| 153 ' # blah blah blah as\n' | |
| 154 ' # found in the LICENSE file.\n') | |
| 155 | |
| 156 NEW = ( | |
| 157 'diff --git a/foo b/foo\n' | |
| 158 'new file mode 100644\n' | |
| 159 'index 0000000..5716ca5\n' | |
| 160 '--- /dev/null\n' | |
| 161 '+++ b/foo\n' | |
| 162 '@@ -0,0 +1 @@\n' | |
| 163 '+bar\n') | |
| 164 | |
| 165 NEW_EXE = ( | |
| 166 'diff --git a/natsort_test.py b/natsort_test.py\n' | |
| 167 'new file mode 100755\n' | |
| 168 '--- /dev/null\n' | |
| 169 '+++ b/natsort_test.py\n' | |
| 170 '@@ -0,0 +1,1 @@\n' | |
| 171 '+#!/usr/bin/env python\n') | |
| 172 | |
| 173 # To make sure the subdirectory was created as needed. | |
| 174 NEW_SUBDIR = ( | |
| 175 'diff --git a/new_dir/subdir/new_file b/new_dir/subdir/new_file\n' | |
| 176 'new file mode 100644\n' | |
| 177 '--- /dev/null\n' | |
| 178 '+++ b/new_dir/subdir/new_file\n' | |
| 179 '@@ -0,0 +1,2 @@\n' | |
| 180 '+A new file\n' | |
| 181 '+should exist.\n') | |
| 182 | |
| 183 NEW_MODE = ( | |
| 184 'diff --git a/natsort_test.py b/natsort_test.py\n' | |
| 185 'new file mode 100644\n' | |
| 186 '--- /dev/null\n' | |
| 187 '+++ b/natsort_test.py\n' | |
| 188 '@@ -0,0 +1,1 @@\n' | |
| 189 '+#!/usr/bin/env python\n') | |
| 190 | |
| 191 MODE_EXE = ( | |
| 192 'diff --git a/git_cl/git-cl b/git_cl/git-cl\n' | |
| 193 'old mode 100644\n' | |
| 194 'new mode 100755\n') | |
| 195 | |
| 196 MODE_EXE_JUNK = ( | |
| 197 'Index: Junk\n' | |
| 198 'diff --git a/git_cl/git-cl b/git_cl/git-cl\n' | |
| 199 'old mode 100644\n' | |
| 200 'new mode 100755\n') | |
| OLD | NEW |