Changeset 92609 in webkit
- Timestamp:
- Aug 8, 2011 11:02:59 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r92571 r92609 1 2011-08-08 Jochen Eisinger <jochen@chromium.org> 2 3 webkit-patch doesn't get along with renamed files 4 https://bugs.webkit.org/show_bug.cgi?id=48075 5 6 Possibly a bit heavy handed - I removed all instances of -C and 7 changed every instance of -M with '--no-renames' in git.py. This 8 forces git to not try to tell us about renames at all, which is 9 ultimately the behaviour we want. The old file is shown deleted, 10 then the new file is shown added, followed by any changes that 11 occurred. Also gets rid of the problem where deleting one file 12 and adding another file which has similar content would 13 unexpectedly show up as a rename, and fall out of a diff. 14 15 Based on a patch by Wyatt Carss. 16 17 Reviewed by Eric Seidel. 18 19 * Scripts/webkitpy/common/checkout/scm/git.py: 20 1 21 2011-08-07 Sam White <samuel.white@rochester.edu> 2 22 -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py
r92440 r92609 145 145 146 146 def working_directory_is_clean(self): 147 return self.run(['git', 'diff', 'HEAD', '--n ame-only'], cwd=self.checkout_root) == ""147 return self.run(['git', 'diff', 'HEAD', '--no-renames', '--name-only'], cwd=self.checkout_root) == "" 148 148 149 149 def clean_working_directory(self): … … 158 158 # git status returns non-zero when there are changes, so we use git diff name --name-status HEAD instead. 159 159 # No file contents printed, thus utf-8 autodecoding in self.run is fine. 160 return ["git", "diff", "--name-status", " HEAD"]160 return ["git", "diff", "--name-status", "--no-renames", "HEAD"] 161 161 162 162 def _status_regexp(self, expected_types): … … 187 187 def changed_files(self, git_commit=None): 188 188 # FIXME: --diff-filter could be used to avoid the "extract_filenames" step. 189 status_command = ['git', 'diff', '-r', '--name-status', '-C', '-M', "--no-ext-diff", "--full-index", self.merge_base(git_commit)]189 status_command = ['git', 'diff', '-r', '--name-status', "--no-renames", "--no-ext-diff", "--full-index", self.merge_base(git_commit)] 190 190 # FIXME: I'm not sure we're returning the same set of files that SVN.changed_files is. 191 191 # Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R) … … 210 210 # We do not need to pass decode_output for this diff command 211 211 # as we're passing --name-status which does not output any data. 212 status_command = ['git', 'diff', '--name-status', '- C', '-M', '--diff-filter=U']212 status_command = ['git', 'diff', '--name-status', '--no-renames', '--diff-filter=U'] 213 213 return self.run_status_and_extract_filenames(status_command, self._status_regexp("U")) 214 214 … … 245 245 Patch files are effectively binary since they may contain 246 246 files of multiple different encodings.""" 247 command = ['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "- M", self.merge_base(git_commit), "--"]247 command = ['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "--no-renames", self.merge_base(git_commit), "--"] 248 248 if changed_files: 249 249 command += changed_files … … 283 283 284 284 def diff_for_file(self, path, log=None): 285 return self.run(['git', 'diff', 'HEAD', '-- ', path], cwd=self.checkout_root)285 return self.run(['git', 'diff', 'HEAD', '--no-renames', '--', path], cwd=self.checkout_root) 286 286 287 287 def show_head(self, path): … … 463 463 464 464 def files_changed_summary_for_commit(self, commit_id): 465 return self.run(['git', 'diff-tree', '--shortstat', '--no- commit-id', commit_id])465 return self.run(['git', 'diff-tree', '--shortstat', '--no-renames', '--no-commit-id', commit_id]) -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
r91210 r92609 963 963 self.assertEqual(scm.head_svn_revision(), '') 964 964 965 def test_rename_files(self): 966 scm = self.tracking_scm 967 968 run_command(['git', 'mv', 'foo_file', 'bar_file']) 969 scm.commit_locally_with_message('message') 970 971 patch = scm.create_patch() 972 self.assertFalse(re.search(r'rename from ', patch)) 973 self.assertFalse(re.search(r'rename to ', patch)) 974 975 965 976 class GitSVNTest(SCMTest): 966 977
Note: See TracChangeset
for help on using the changeset viewer.