SConstruct (11408:cb18b6551499) | SConstruct (11450:98e5204d0a52) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2013, 2015, 2016 ARM Limited 4# All rights reserved. 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 318 unchanged lines hidden (view full) --- 327 try: 328 raw_input() 329 except: 330 print "Input exception, exiting scons.\n" 331 sys.exit(1) 332 shutil.copyfile(hgrc.abspath, hgrc_old.abspath) 333 re_style_hook = re.compile(r"^([^=#]+)\.style\s*=\s*([^#\s]+).*") 334 re_style_extension = re.compile("style\s*=\s*([^#\s]+).*") | 1# -*- mode:python -*- 2 3# Copyright (c) 2013, 2015, 2016 ARM Limited 4# All rights reserved. 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 318 unchanged lines hidden (view full) --- 327 try: 328 raw_input() 329 except: 330 print "Input exception, exiting scons.\n" 331 sys.exit(1) 332 shutil.copyfile(hgrc.abspath, hgrc_old.abspath) 333 re_style_hook = re.compile(r"^([^=#]+)\.style\s*=\s*([^#\s]+).*") 334 re_style_extension = re.compile("style\s*=\s*([^#\s]+).*") |
335 with open(hgrc_old.abspath, 'r') as old, \ 336 open(hgrc.abspath, 'w') as new: | 335 old, new = open(hgrc_old.abspath, 'r'), open(hgrc.abspath, 'w') 336 for l in old: 337 m_hook = re_style_hook.match(l) 338 m_ext = re_style_extension.match(l) 339 if m_hook: 340 hook, check = m_hook.groups() 341 if check != "python:style.check_style": 342 print "Warning: %s.style is using a non-default " \ 343 "checker: %s" % (hook, check) 344 if hook not in ("pretxncommit", "pre-qrefresh"): 345 print "Warning: Updating unknown style hook: %s" % hook |
337 | 346 |
338 for l in old: 339 m_hook = re_style_hook.match(l) 340 m_ext = re_style_extension.match(l) 341 if m_hook: 342 hook, check = m_hook.groups() 343 if check != "python:style.check_style": 344 print "Warning: %s.style is using a non-default " \ 345 "checker: %s" % (hook, check) 346 if hook not in ("pretxncommit", "pre-qrefresh"): 347 print "Warning: Updating unknown style hook: %s" % hook | 347 l = "%s.style = python:hgstyle.check_style\n" % hook 348 elif m_ext and m_ext.group(1) == style_extension: 349 l = "hgstyle = %s/util/hgstyle.py\n" % main.root.abspath |
348 | 350 |
349 l = "%s.style = python:hgstyle.check_style\n" % hook 350 elif m_ext and m_ext.group(1) == style_extension: 351 l = "hgstyle = %s/util/hgstyle.py\n" % main.root.abspath 352 353 new.write(l) | 351 new.write(l) |
354 elif not style_hook: 355 print mercurial_style_message, 356 # continue unless user does ctrl-c/ctrl-d etc. 357 try: 358 raw_input() 359 except: 360 print "Input exception, exiting scons.\n" 361 sys.exit(1) --- 1169 unchanged lines hidden --- | 352 elif not style_hook: 353 print mercurial_style_message, 354 # continue unless user does ctrl-c/ctrl-d etc. 355 try: 356 raw_input() 357 except: 358 print "Input exception, exiting scons.\n" 359 sys.exit(1) --- 1169 unchanged lines hidden --- |