SConstruct (5952:c1ee8282291d) | SConstruct (5990:886da6fa6d4a) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2009 The Hewlett-Packard Development Company 4# Copyright (c) 2004-2005 The Regents of The University of Michigan 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions are --- 197 unchanged lines hidden (view full) --- 206""" 207 208mercurial_lib_not_found = """ 209Mercurial libraries cannot be found, ignoring style hook 210If you are actually a M5 developer, please fix this and 211run the style hook. It is important. 212""" 213 | 1# -*- mode:python -*- 2 3# Copyright (c) 2009 The Hewlett-Packard Development Company 4# Copyright (c) 2004-2005 The Regents of The University of Michigan 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions are --- 197 unchanged lines hidden (view full) --- 206""" 207 208mercurial_lib_not_found = """ 209Mercurial libraries cannot be found, ignoring style hook 210If you are actually a M5 developer, please fix this and 211run the style hook. It is important. 212""" 213 |
214hg_info = "Unknown" |
|
214if hgdir.exists(): 215 # 1) Grab repository revision if we know it. 216 cmd = "hg id -n -i -t -b" 217 try: 218 hg_info = read_command(cmd, cwd=env.root.abspath).strip() 219 except OSError: | 215if hgdir.exists(): 216 # 1) Grab repository revision if we know it. 217 cmd = "hg id -n -i -t -b" 218 try: 219 hg_info = read_command(cmd, cwd=env.root.abspath).strip() 220 except OSError: |
220 hg_info = "Unknown" | |
221 print mercurial_bin_not_found 222 | 221 print mercurial_bin_not_found 222 |
223 env['HG_INFO'] = hg_info 224 | |
225 # 2) Ensure that the style hook is in place. 226 try: 227 ui = None 228 if ARGUMENTS.get('IGNORE_STYLE') != 'True': 229 from mercurial import ui 230 ui = ui.ui() 231 except ImportError: 232 print mercurial_lib_not_found 233 234 if ui is not None: 235 ui.readconfig(hgdir.File('hgrc').abspath) 236 style_hook = ui.config('hooks', 'pretxncommit.style', None) 237 238 if not style_hook: 239 print mercurial_style_message 240 sys.exit(1) 241else: 242 print ".hg directory not found" | 223 # 2) Ensure that the style hook is in place. 224 try: 225 ui = None 226 if ARGUMENTS.get('IGNORE_STYLE') != 'True': 227 from mercurial import ui 228 ui = ui.ui() 229 except ImportError: 230 print mercurial_lib_not_found 231 232 if ui is not None: 233 ui.readconfig(hgdir.File('hgrc').abspath) 234 style_hook = ui.config('hooks', 'pretxncommit.style', None) 235 236 if not style_hook: 237 print mercurial_style_message 238 sys.exit(1) 239else: 240 print ".hg directory not found" |
241env['HG_INFO'] = hg_info |
|
243 244################################################### 245# 246# Figure out which configurations to set up based on the path(s) of 247# the target(s). 248# 249################################################### 250 --- 651 unchanged lines hidden --- | 242 243################################################### 244# 245# Figure out which configurations to set up based on the path(s) of 246# the target(s). 247# 248################################################### 249 --- 651 unchanged lines hidden --- |