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

Unified Diff: gclient.py

Issue 2348793003: Introduce git merge driver for the blink reformatting
Patch Set: Created 4 years, 3 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 | « clang_format_merge_driver.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index 88edbd7af489b3034a16a2c4b3cae426af2f5908..6b8020c1490f591b3384b4b92cad9635b7882cc6 100755
--- a/gclient.py
+++ b/gclient.py
@@ -883,6 +883,28 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
# Always parse the DEPS file.
self.ParseDepsFile()
+
+ # Setup the merge driver for The Great Blink Reformatting. This does just
+ # setup a custom merge-driver in the git config of the Chromium main project
+ # but does not have any effect until somebody changes the .gitattributes
+ # to refer to it. See crbug.com/574611 for more.
+ # TODO(primiano): remove some weeks after the reformatting. ETA: Oct 2016.
+ if parsed_url == CHROMIUM_SRC_URL:
+ CFG_PREFIX = 'merge.clang_format_merge_driver'
+ try:
+ merge_driver = self._used_scm._Capture(
+ ['config', CFG_PREFIX + '.driver']).strip()
+ except subprocess2.CalledProcessError:
+ merge_driver = None
+
+ if not merge_driver:
+ print('Installing clang-format merge driver for crbug/574611')
+ self._used_scm._Capture(['config', CFG_PREFIX + '.name',
+ 'clang-format merge driver (crbug/574611)'])
+ self._used_scm._Capture(['config', CFG_PREFIX + '.driver',
+ 'clang_format_merge_driver %O %A %B %L %P'])
+ self._used_scm._Capture(['config', CFG_PREFIX + '.recursive', 'binary'])
+
self._run_is_done(file_list or [], parsed_url)
if command in ('update', 'revert') and not options.noprehooks:
self.RunPreDepsHooks()
« no previous file with comments | « clang_format_merge_driver.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698