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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

Issue 1918993003: Git patches created by webkitpy now always have filename prefixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.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
1 # Copyright (C) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2009 Google Inc. All rights reserved.
2 # Copyright (C) 2009 Apple Inc. All rights reserved. 2 # Copyright (C) 2009 Apple Inc. All rights reserved.
3 # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved. 3 # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 def test_create_patch(self): 190 def test_create_patch(self):
191 self._write_text_file('test_file_commit1', 'contents') 191 self._write_text_file('test_file_commit1', 'contents')
192 self._run(['git', 'add', 'test_file_commit1']) 192 self._run(['git', 'add', 'test_file_commit1'])
193 scm = self.tracking_scm 193 scm = self.tracking_scm
194 scm.commit_locally_with_message('message') 194 scm.commit_locally_with_message('message')
195 195
196 patch = scm.create_patch() 196 patch = scm.create_patch()
197 self.assertNotRegexpMatches(patch, r'Subversion Revision:') 197 self.assertNotRegexpMatches(patch, r'Subversion Revision:')
198 198
199 def test_patches_have_filenames_with_prefixes(self):
200 self._write_text_file('test_file_commit1', 'contents')
201 self._run(['git', 'add', 'test_file_commit1'])
202 scm = self.tracking_scm
203 scm.commit_locally_with_message('message')
204
205 # Even if diff.noprefix is enabled, create_patch() produces diffs with p refixes.
206 self._run(['git', 'config', 'diff.noprefix', 'true'])
207 patch = scm.create_patch()
208 self.assertRegexpMatches(patch, r'^diff --git a/test_file_commit1 b/test _file_commit1')
209
199 def test_exists(self): 210 def test_exists(self):
200 scm = self.untracking_scm 211 scm = self.untracking_scm
201 self._shared_test_exists(scm, scm.commit_locally_with_message) 212 self._shared_test_exists(scm, scm.commit_locally_with_message)
202 213
203 def test_rename_files(self): 214 def test_rename_files(self):
204 scm = self.tracking_scm 215 scm = self.tracking_scm
205 scm.move('foo_file', 'bar_file') 216 scm.move('foo_file', 'bar_file')
206 scm.commit_locally_with_message('message') 217 scm.commit_locally_with_message('message')
207 218
208 def test_commit_position_from_git_log(self): 219 def test_commit_position_from_git_log(self):
(...skipping 29 matching lines...) Expand all
238 scm = self.make_scm() 249 scm = self.make_scm()
239 scm.find_checkout_root = lambda path: '' 250 scm.find_checkout_root = lambda path: ''
240 scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000' 251 scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000'
241 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013- 02-08T08:05:49Z') 252 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013- 02-08T08:05:49Z')
242 253
243 scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130' 254 scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130'
244 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013- 02-07T23:32:03Z') 255 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013- 02-07T23:32:03Z')
245 256
246 scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800' 257 scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800'
247 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013- 02-08T09:55:21Z') 258 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013- 02-08T09:55:21Z')
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698