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

Unified Diff: tools/git/move_source_file.py

Issue 1614633002: Make move_source_file.py work in blink again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/git/move_source_file.py
diff --git a/tools/git/move_source_file.py b/tools/git/move_source_file.py
index f1dde3b3e11ff39023dba95e6b9b6ec50b9fd889..4df87322335ccbccd0a4fa8659d4aa0bcc713bbc 100755
--- a/tools/git/move_source_file.py
+++ b/tools/git/move_source_file.py
@@ -8,8 +8,7 @@ to them, and re-ordering headers as needed. If multiple source files are
specified, the destination must be a directory. Updates include guards in
moved header files. Assumes Chromium coding style.
-Attempts to update paths used in .gyp(i) files, but does not reorder
-or restructure .gyp(i) files in any way.
+Attempts to update and reorder paths used in .gyp(i) files.
Updates full-path references to files in // comments in source files.
@@ -213,8 +212,10 @@ def UpdateIncludeGuard(old_path, new_path):
f.write(new_contents)
def main():
- if not os.path.isdir('.git'):
- print 'Fatal: You must run from the root of a git checkout.'
+ # git rev-parse returns 0 even when run in the .git directory. We don't want
satorux1 2016/01/21 05:52:07 how about commenting that we use 'git rev-parse' t
dgrogan 2016/01/21 19:50:53 Done.
+ # people running this in the .git directory.
+ if not os.system('git rev-parse') == 0 or os.getcwd().endswith(".git"):
satorux1 2016/01/21 05:52:07 This probably matches "foo/bar.git". how about o
dgrogan 2016/01/21 19:50:53 Good point. Fixed.
+ print 'Fatal: You must run in a git checkout.'
return 1
in_blink = os.getcwd().endswith("third_party/WebKit")
satorux1 2016/01/21 05:52:07 '/' may not match on Windows? while you are at it,
dgrogan 2016/01/21 19:50:53 Done.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698