summaryrefslogtreecommitdiff
path: root/site_scons/site_tools/mercurial.py
diff options
context:
space:
mode:
Diffstat (limited to 'site_scons/site_tools/mercurial.py')
-rw-r--r--site_scons/site_tools/mercurial.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/site_scons/site_tools/mercurial.py b/site_scons/site_tools/mercurial.py
index a38449f43..3c91b3834 100644
--- a/site_scons/site_tools/mercurial.py
+++ b/site_scons/site_tools/mercurial.py
@@ -38,6 +38,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from __future__ import print_function
import re
import sys
@@ -90,16 +91,16 @@ def install_style_hooks(env):
style_hook = all(style_hooks)
style_extension = ui.config('extensions', 'style', None)
except ImportError:
- print mercurial_lib_not_found
+ print(mercurial_lib_not_found)
if "python:style.check_style" in style_hooks:
# Try to upgrade the style hooks
- print mercurial_style_upgrade_message
+ print(mercurial_style_upgrade_message)
# continue unless user does ctrl-c/ctrl-d etc.
try:
raw_input()
except:
- print "Input exception, exiting scons.\n"
+ print("Input exception, exiting scons.\n")
sys.exit(1)
shutil.copyfile(hgrc.abspath, hgrc_old.abspath)
re_style_hook = re.compile(r"^([^=#]+)\.style\s*=\s*([^#\s]+).*")
@@ -111,10 +112,10 @@ def install_style_hooks(env):
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)
+ 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
+ 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:
@@ -122,20 +123,20 @@ def install_style_hooks(env):
new.write(l)
elif not style_hook:
- print mercurial_style_message,
+ print(mercurial_style_message, end=' ')
# continue unless user does ctrl-c/ctrl-d etc.
try:
raw_input()
except:
- print "Input exception, exiting scons.\n"
+ print("Input exception, exiting scons.\n")
sys.exit(1)
hgrc_path = '%s/.hg/hgrc' % env.root.abspath
- print "Adding style hook to", hgrc_path, "\n"
+ print("Adding style hook to", hgrc_path, "\n")
try:
with open(hgrc_path, 'a') as f:
f.write(mercurial_style_hook_template % env.root.abspath)
except:
- print "Error updating", hgrc_path
+ print("Error updating", hgrc_path)
sys.exit(1)
def generate(env):