style.py (7827:49b7d40ee88a) style.py (7828:817c662677d1)
1#! /usr/bin/env python
2# Copyright (c) 2006 The Regents of The University of Michigan
3# Copyright (c) 2007 The Hewlett-Packard Development Company
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

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

336def check_hook(hooktype):
337 if hooktype not in ('pretxncommit', 'pre-qrefresh'):
338 raise AttributeError, \
339 "This hook is not meant for %s" % hooktype
340
341def check_style(ui, repo, hooktype, **kwargs):
342 check_hook(hooktype)
343 args = {}
1#! /usr/bin/env python
2# Copyright (c) 2006 The Regents of The University of Michigan
3# Copyright (c) 2007 The Hewlett-Packard Development Company
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

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

336def check_hook(hooktype):
337 if hooktype not in ('pretxncommit', 'pre-qrefresh'):
338 raise AttributeError, \
339 "This hook is not meant for %s" % hooktype
340
341def check_style(ui, repo, hooktype, **kwargs):
342 check_hook(hooktype)
343 args = {}
344 return do_check_style(ui, repo, **args)
345
344
345 try:
346 return do_check_style(ui, repo, **args)
347 except Exception, e:
348 import traceback
349 traceback.print_exc()
350 return True
351
346def check_format(ui, repo, hooktype, **kwargs):
347 check_hook(hooktype)
348 args = {}
352def check_format(ui, repo, hooktype, **kwargs):
353 check_hook(hooktype)
354 args = {}
349 return do_check_format(ui, repo, **args)
350
355
356 try:
357 return do_check_format(ui, repo, **args)
358 except Exception, e:
359 import traceback
360 traceback.print_exc()
361 return True
362
351try:
352 from mercurial.i18n import _
353except ImportError:
354 def _(arg):
355 return arg
356
357cmdtable = {
358 '^m5style' :

--- 63 unchanged lines hidden ---
363try:
364 from mercurial.i18n import _
365except ImportError:
366 def _(arg):
367 return arg
368
369cmdtable = {
370 '^m5style' :

--- 63 unchanged lines hidden ---