335,336c335,345
< with open(hgrc_old.abspath, 'r') as old, \
< open(hgrc.abspath, 'w') as new:
---
> old, new = open(hgrc_old.abspath, 'r'), open(hgrc.abspath, 'w')
> for l in old:
> m_hook = re_style_hook.match(l)
> m_ext = re_style_extension.match(l)
> if m_hook:
> hook, check = m_hook.groups()
> if check != "python:style.check_style":
> print "Warning: %s.style is using a non-default " \
> "checker: %s" % (hook, check)
> if hook not in ("pretxncommit", "pre-qrefresh"):
> print "Warning: Updating unknown style hook: %s" % hook
338,347c347,349
< for l in old:
< m_hook = re_style_hook.match(l)
< m_ext = re_style_extension.match(l)
< if m_hook:
< hook, check = m_hook.groups()
< if check != "python:style.check_style":
< print "Warning: %s.style is using a non-default " \
< "checker: %s" % (hook, check)
< if hook not in ("pretxncommit", "pre-qrefresh"):
< print "Warning: Updating unknown style hook: %s" % hook
---
> l = "%s.style = python:hgstyle.check_style\n" % hook
> elif m_ext and m_ext.group(1) == style_extension:
> l = "hgstyle = %s/util/hgstyle.py\n" % main.root.abspath
349,353c351
< l = "%s.style = python:hgstyle.check_style\n" % hook
< elif m_ext and m_ext.group(1) == style_extension:
< l = "hgstyle = %s/util/hgstyle.py\n" % main.root.abspath
<
< new.write(l)
---
> new.write(l)