summaryrefslogtreecommitdiffstats
path: root/tools/git
Commit message (Collapse)AuthorAgeFilesLines
* Make move_source_file.py work in blink again.dgrogan2016-01-212-5/+12
| | | | | | | | | | | | | It got busted after the repository merge. You still have to run it from third_party/WebKit. It doesn't work if you run it from src/. Also update comment to note that it now does reorder gyp(i) entries. Tested locally by doing a dummy move in each of chromium and blink. Review URL: https://codereview.chromium.org/1614633002 Cr-Commit-Position: refs/heads/master@{#370778}
* Fix bug in mass_renamesky2015-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where moving a file, but not renaming it resulted in an exception: Traceback (most recent call last): File "/secondary/builds/build2/src/tools/git/move_source_file.py", line 259, in <module> sys.exit(main()) File "/secondary/builds/build2/src/tools/git/move_source_file.py", line 254, in main UpdatePostMove(from_path, to_path, in_blink) File "/secondary/builds/build2/src/tools/git/move_source_file.py", line 172, in UpdatePostMove os.path.join(visiting_directory, '*.gyp*')]) File "/secondary/builds/build2/src/tools/git/mffr.py", line 69, in MultiFileFindReplace referee) Exception: No change in file mojo/common/BUILD.gn although matched in grep Traceback (most recent call last): File "/secondary/builds/build2/src/tools/git/mass-rename.py", line 50, in <module> sys.exit(main()) File "/secondary/builds/build2/src/tools/git/mass-rename.py", line 43, in main fro, to]) File "/usr/lib/python2.7/subprocess.py", line 540, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/usr/bin/python', '/secondary/builds/build2/src/tools/git/move_source_file.py', '--already_moved', '--no_error_for_non_so\ urce_file', 'mojo/common/handle_watcher.h', 'mojo/message_pump/handle_watcher.h']' returned non-zero exit status 1 BUG=none TEST=none R=mgiuca@chromium.org, satorux@chromium.org Review URL: https://codereview.chromium.org/1265313002 Cr-Commit-Position: refs/heads/master@{#342030}
* Allow move_source_file.py and sort-headers.py to work on blink.benwells2015-07-151-5/+29
| | | | | | | | BUG=507539 Review URL: https://codereview.chromium.org/1213613011 Cr-Commit-Position: refs/heads/master@{#338824}
* move_source_file.py: Sort sources in build filessatorux2015-02-181-1/+4
| | | | | | | | | | | | | | In addition to #includes, move_source_file.py should sort sources in build files. This is per suggestion from sdefresne@. Thanks! BUG=456014 TEST=move a C++ file with move_source_file.py and confirm that both GYP and GN files are updated. Review URL: https://codereview.chromium.org/924403003 Cr-Commit-Position: refs/heads/master@{#316795}
* move_source_file.py: Handle GYP files in deeper directories.satorux2015-02-181-23/+15
| | | | | | | | | | | | | | | | | Previously, the script assumed that GYP files are located under the first level directory (ex. chrome/chrome_browser.gypi), but there are GYP files located in directories at a deeper level (ex. extensions/shell/app_shell.gypi). The change is to handle these GYP files correctly. BUG=404616 TEST=1) rename files under extensions/shell with git mv 2) run tools/git/mass-rename.sh 3) confirm that extensions/shell/app_shell.gypi is updated Review URL: https://codereview.chromium.org/935483002 Cr-Commit-Position: refs/heads/master@{#316720}
* Add -g/--build option to for-all-touched-files.pysatorux2015-02-161-1/+13
| | | | | | | | | | | | | | This option will be useful for updating build files with tools/sort_sources.py, like: tools/git/for-all-touched-files.py -g "tools/sort_sources.py [[FILENAME]]" BUG=456014 TEST=modify some files, confirm the new option worked as expected Review URL: https://codereview.chromium.org/934473003 Cr-Commit-Position: refs/heads/master@{#316512}
* move_source_file.py: Update GN files in addition to GYP filessatorux2015-02-061-0/+42
| | | | | | | | | | | | | | | The change only handles files moved/renamed withing the same BUILD.gn file. If files are moved beyond the same BUILD.gn file, the affected BUILD.gn files should be fixed manually. BUG=404616 TEST=1) rename files with git mv 2) run tools/git/mass-rename.sh 3) confirm that BUILD.gn is updated as expected Review URL: https://codereview.chromium.org/894973002 Cr-Commit-Position: refs/heads/master@{#314945}
* Normalize destination paths in move_source_file.py.derat2015-01-101-0/+4
| | | | | | | | | | | | Update move_source_file.py to call os.path.normpath() on destination paths to ensure that components like '.' and '..' don't end up in #include paths. BUG=446960 Review URL: https://codereview.chromium.org/838073002 Cr-Commit-Position: refs/heads/master@{#310906}
* Update move_source_file to support Blink and GNeseidel2014-12-021-3/+3
| | | | | | | | | | | | | | Blink uses .cpp files and gn has .gni and .gn build files. This doesn't actually help much for gn since we don't have a giant global list of our build files like this script seems to expect but it still seemed like the right change to make. BUG=435361, 435243 Review URL: https://codereview.chromium.org/771873003 Cr-Commit-Position: refs/heads/master@{#306428}
* Update move_source_file.py to not require trailing slashes.derat@chromium.org2013-10-311-20/+23
| | | | | | | | | | | Make the destination directory not require a trailing slash. BUG=none R=joi@chromium.org Review URL: https://codereview.chromium.org/52363003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232118 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes to mass-rename and sort-headers scripts.scottmg@chromium.org2013-07-151-2/+6
| | | | | | | | | | | | | | Error checking for non-moves having been staged (rather than erroring out), and make sure that intshcut.h goes after ole2.h in Windows files. (As broken repeatedly in https://codereview.chromium.org/18501013 and https://codereview.chromium.org/18977003/) R=jamesr@chromium.org Review URL: https://chromiumcodereview.appspot.com/19228002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211690 0039d316-1c4b-4281-b951-d872f2087c98
* Add svn:executable propmichaeln@google.com2013-07-111-0/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211223 0039d316-1c4b-4281-b951-d872f2087c98
* Add move_source_file.bat file for use in a windows cmd prompt.michaeln@chromium.org2013-07-111-0/+6
| | | | | | Review URL: https://chromiumcodereview.appspot.com/17351014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211208 0039d316-1c4b-4281-b951-d872f2087c98
* Augment mffr.py to be able to take arguments from a file.blundell@chromium.org2013-06-211-24/+77
| | | | | | | | | | | Example use case is iterating on follow-up changes to a file changing namespaces, impacting all the symbols within that file. R=joi Review URL: https://chromiumcodereview.appspot.com/17527004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207883 0039d316-1c4b-4281-b951-d872f2087c98
* Miscellaneous fixup for mass-rename.py and friends.blundell@chromium.org2013-06-182-11/+26
| | | | | | | | | | | | | | | | - move_source_file.py now has the option to print out a message rather than raise an exception when given a file that is not a source file. mass-rename.py uses this option to avoid dying when a directory is moved that includes a non-source file (e.g., DEPS). - sort-headers.py now has an option to avoid reordering headers in *message_generator.cc files; changing the include orders in these files can break compilation - sort-headers.py now handles the case where the last line of a file is an include; previously it would die in this case. Review URL: https://chromiumcodereview.appspot.com/17389002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206991 0039d316-1c4b-4281-b951-d872f2087c98
* Make mass-rename.py work on Unix.blundell@chromium.org2013-06-131-1/+1
| | | | | | | | | | | | | | | | | | Per 17.1.1.2 on http://docs.python.org/2/library/subprocess.html, passing shell=True on Unix and having the command to run be specified as a sequence means that "the first item specifies the command string, and any additional items will be treated as additional arguments to the shell itself." This results in incorrect behavior (and in particular, the popen.communicate() fails with a return code of 1). This CL switches to the recommended behavior of passing the command to run as a string when specifying shell=True. R=scottmg Review URL: https://chromiumcodereview.appspot.com/16849002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206064 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing executable bits for mass-rename.pyhashimoto@chromium.org2013-06-121-0/+0
| | | | | | | | | | | | To fix check_perms failures on builders. http://build.chromium.org/p/chromium/builders/Linux/builds/39938/steps/check_perms BUG=None TEST=tools/git/mass-rename.py TBR=scottmg@chromium.org Review URL: https://codereview.chromium.org/16132014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205737 0039d316-1c4b-4281-b951-d872f2087c98
* mass-rename.py for windows and fix mffr.py on windowsscottmg@chromium.org2013-06-123-12/+48
| | | | | | | | | R=jamesr@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/16787006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205731 0039d316-1c4b-4281-b951-d872f2087c98
* Rename content/common_child to content/childscottmg@chromium.org2013-06-041-3/+4
| | | | | | | | | | | | As prerequiste for linked bug. TBR=palmer@chromium.org R=jam@chromium.org,jamesr@chromium.org BUG=246357 Review URL: https://chromiumcodereview.appspot.com/16325022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203945 0039d316-1c4b-4281-b951-d872f2087c98
* Allow move_source_file to take multiple files.samarth@chromium.org2013-03-121-14/+19
| | | | | | | | | | | | For example, you can do: $ tools/git/move_source_file.py chrome/browser/instant/instant_[bcelnoptu]* chrome/browser/ui/search/ R=joi@chromium.org Review URL: https://chromiumcodereview.appspot.com/12543024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187665 0039d316-1c4b-4281-b951-d872f2087c98
* Make move_source_file.py more generous in handling include guard update.blundell@chromium.org2013-02-271-5/+8
| | | | | | | | | | | | | | Two changes: (1) Don't raise an error in the case where the user had already updated the include guard before running move_source_file.py. (2) Rather than having a failure to find the include guard stop the script, print out a warning instead and let the rest of the operation of the script continue. Review URL: https://chromiumcodereview.appspot.com/12335126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184948 0039d316-1c4b-4281-b951-d872f2087c98
* Extract multi-file find and replace into a separate tool.joi@chromium.org2013-02-112-46/+119
| | | | | | | | BUG=none Review URL: https://codereview.chromium.org/12149005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181693 0039d316-1c4b-4281-b951-d872f2087c98
* Change move_source_file.py to use Posix ERE syntax for git grep.blundell@chromium.org2013-02-071-1/+5
| | | | | | | | | | | Posix ERE does not reliably support the "\s" shorthand (cf. the character class chart on http://www.regular-expressions.info/refflavors.html as well as my own experience using git grep on OS X 10.7). Review URL: https://chromiumcodereview.appspot.com/12225048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181314 0039d316-1c4b-4281-b951-d872f2087c98
* Update tools/git/update-copyrights.sh.xiyuan@chromium.org2013-01-171-11/+2
| | | | | | | | | | | | | | Print out that updating copyright year is no longer necessary now. See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/8p4JKV76kig/OiFYFjuZ6nAJ BUG=none TEST=none R=thakis@chromium.org Review URL: https://codereview.chromium.org/11886101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177472 0039d316-1c4b-4281-b951-d872f2087c98
* Automatically sort headers in files affected by move_source_file.py, and ↵joi@chromium.org2012-11-221-41/+54
| | | | | | | | | | | | | update full-path references in // comments. Sorting headers does not seem to affect timing appreciably in my test case, but searching for full-path references in comments does increase the time taken by around 20%. If the speed ever becomes a problem, this latter feature could be made optional, but for now it is probably simplest to leave it on all the time. BUG=None Review URL: https://chromiumcodereview.appspot.com/11412006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169252 0039d316-1c4b-4281-b951-d872f2087c98
* Consolidate mass-rename.sh and move_source_file.pyjoi@chromium.org2012-11-212-31/+194
| | | | | | | | | BUG=none Review URL: https://chromiumcodereview.appspot.com/11358216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168926 0039d316-1c4b-4281-b951-d872f2087c98
* Set svn:executable bit on scripts that are executable.maruel@chromium.org2012-04-251-1/+1
| | | | | | | | | | | | | Add a PRESUBMIT.py to run checkperms.py when it is modified and to run pylint on it. R=thestig@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/10134019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133835 0039d316-1c4b-4281-b951-d872f2087c98
* Add git diff python tool that outputs file:line in front of diff output.jbates@chromium.org2012-03-011-0/+93
| | | | | | Review URL: https://chromiumcodereview.appspot.com/9562011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124499 0039d316-1c4b-4281-b951-d872f2087c98
* Update tools/git/update-copyrights.sh with the current year.thakis@chromium.org2012-01-111-2/+2
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/9148027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117237 0039d316-1c4b-4281-b951-d872f2087c98
* Fix python scripts in src/tools/maruel@chromium.org2011-11-291-1/+1
| | | | | | | | | | | | | | | | | | Make sure that: - shebang is only present for executable files - shebang is #!/usr/bin/env python - __main__ is only present for executable files - file's executable bit is coherent Also fix EOF LF to be only one. TBR=timurrrr@chromium.org BUG=105108 TEST= Review URL: http://codereview.chromium.org/8678023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111960 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a tool that lets you run a command for each modified file on your git ↵joi@chromium.org2011-11-011-0/+114
| | | | | | | | | | | | | branch or in your workspace. Also, add a flag to sort-headers.py to make it more useful when used in conjunction with that tool, that suppresses the y/N prompt after each diff (as vetting a bulk change may be easier once it's in your working directory, using your favorite diff tool). Refactor the script slightly while I'm in there. BUG=none TEST=none Review URL: http://codereview.chromium.org/8390055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108097 0039d316-1c4b-4281-b951-d872f2087c98
* Add a comment to mass-rename.sh that points to sort-headers.pythakis@chromium.org2011-05-191-1/+3
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/7050018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85952 0039d316-1c4b-4281-b951-d872f2087c98
* Make update-copyrights.sh to work on both Linux and BSD (such as OS X)thakis@chromium.org2011-04-251-1/+1
| | | | | | | | | | | | Linux mktemp: http://linux.die.net/man/1/mktemp BSD mktemp: http://www.manpagez.com/man/1/mktemp/ BUG=none TEST=Run tools/git/update-copyrights.sh, it should work on both OS X and Linux Review URL: http://codereview.chromium.org/6900040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82905 0039d316-1c4b-4281-b951-d872f2087c98
* git: Check in a script to auto-update copyright headers.evan@chromium.org2011-04-181-0/+16
| | | | | | Review URL: http://codereview.chromium.org/6878018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81964 0039d316-1c4b-4281-b951-d872f2087c98
* Explicitly give mktemp parameters, as required by FreeBSD's version (used by ↵avi@chromium.org2011-03-101-1/+1
| | | | | | | | | | | Mac OS X). BUG=n/a TEST=n/a Review URL: http://codereview.chromium.org/6612073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77690 0039d316-1c4b-4281-b951-d872f2087c98
* Check in a quick git-specific hack for doing mass renames.evan@chromium.org2010-09-231-0/+55
| | | | | | Review URL: http://codereview.chromium.org/3440022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60323 0039d316-1c4b-4281-b951-d872f2087c98
* Check in a little toy that graphs history of words in the source.evan@chromium.org2010-08-052-2/+52
| | | | | | | | Useful for tracking progress on projects like wstring removal. Review URL: http://codereview.chromium.org/3017058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55107 0039d316-1c4b-4281-b951-d872f2087c98
* Discard error message from which if tput is not found.jochen@chromium.org2010-03-291-1/+1
| | | | | | | | | BUG=none TEST=run on cygwin Review URL: http://codereview.chromium.org/1553001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42944 0039d316-1c4b-4281-b951-d872f2087c98
* git: add some hooks under tools/gitevan@chromium.org2010-02-194-0/+59
These hooks will warn you if DEPS changes when you switch branches. Review URL: http://codereview.chromium.org/650030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39469 0039d316-1c4b-4281-b951-d872f2087c98