Deleted Added
sdiff udiff text old ( 8122:159c07f22c8e ) new ( 8126:5138d1e453f1 )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2011 Advanced Micro Devices, Inc.
4# Copyright (c) 2009 The Hewlett-Packard Development Company
5# Copyright (c) 2004-2005 The Regents of The University of Michigan
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without

--- 213 unchanged lines hidden (view full) ---

222"""
223
224mercurial_lib_not_found = """
225Mercurial libraries cannot be found, ignoring style hook
226If you are actually a M5 developer, please fix this and
227run the style hook. It is important.
228"""
229
230hg_info = "Unknown"
231if hgdir.exists():
232 # 1) Grab repository revision if we know it.
233 cmd = "hg id -n -i -t -b"
234 try:
235 hg_info = readCommand(cmd, cwd=main.root.abspath).strip()
236 except OSError:
237 print mercurial_bin_not_found
238
239 # 2) Ensure that the style hook is in place.
240 try:
241 ui = None
242 if not GetOption('ignore_style'):
243 from mercurial import ui
244 ui = ui.ui()
245 except ImportError:
246 print mercurial_lib_not_found
247
248 if ui is not None:
249 ui.readconfig(hgdir.File('hgrc').abspath)
250 style_hook = ui.config('hooks', 'pretxncommit.style', None)
251
252 if not style_hook:
253 print mercurial_style_message
254 sys.exit(1)
255else:
256 print ".hg directory not found"
257
258main['HG_INFO'] = hg_info
259
260###################################################
261#
262# Figure out which configurations to set up based on the path(s) of
263# the target(s).
264#
265###################################################
266
267# Find default configuration & binary.

--- 787 unchanged lines hidden ---