Patchwork test-pathencode.py: use absolute_import and print_function

login
register
mail settings
Submitter roby roby
Date March 25, 2016, 4:41 a.m.
Message ID <CAJYcaSPfwD-hGHM0Wm=8rxsUX-VzZ0xFAZXN5N-bw_PU=UBFnA@mail.gmail.com>
Download mbox | patch
Permalink /patch/14066/
State Changes Requested
Headers show

Comments

roby roby - March 25, 2016, 4:41 a.m.
# HG changeset patch
# User Robert Stanca <robert.stanca7@gmail.com>
# Date 1458880702 -7200
#      Fri Mar 25 06:38:22 2016 +0200
# Node ID 74f05a74d05659132bf4c0000bd3e0bb0ad57e8e
# Parent  1a1e4350b560cf2f49fe235d2e5168471877462d
test-pathencode.py: use absolute_import and print_function

     return nerrs
Sean Farley - March 25, 2016, 5:22 p.m.
roby roby <robert.stanca7@gmail.com> writes:

> # HG changeset patch
> # User Robert Stanca <robert.stanca7@gmail.com>
> # Date 1458880702 -7200
> #      Fri Mar 25 06:38:22 2016 +0200
> # Node ID 74f05a74d05659132bf4c0000bd3e0bb0ad57e8e
> # Parent  1a1e4350b560cf2f49fe235d2e5168471877462d
> test-pathencode.py: use absolute_import and print_function

This patch is whitespace damaged. It looks like you just copy and pasted
the patch into your email client?

Could I have you review the following page before sending more patches?

https://www.mercurial-scm.org/wiki/ContributingChanges

Patch

diff -r 1a1e4350b560 -r 74f05a74d056 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t    Thu Mar 24 00:09:58 2016 -0700
+++ b/tests/test-check-py3-compat.t    Fri Mar 25 06:38:22 2016 +0200
@@ -94,8 +94,6 @@ 
   tests/test-minirst.py requires print_function
   tests/test-parseindex2.py not using absolute_import
   tests/test-parseindex2.py requires print_function
-  tests/test-pathencode.py not using absolute_import
-  tests/test-pathencode.py requires print_function
   tests/test-propertycache.py not using absolute_import
   tests/test-propertycache.py requires print_function
   tests/test-revlog-ancestry.py not using absolute_import
diff -r 1a1e4350b560 -r 74f05a74d056 tests/test-pathencode.py
--- a/tests/test-pathencode.py    Thu Mar 24 00:09:58 2016 -0700
+++ b/tests/test-pathencode.py    Fri Mar 25 06:38:22 2016 +0200
@@ -5,9 +5,17 @@ 
 # that have proven likely to expose bugs and divergent behavior in
 # different encoding implementations.

+from __future__ import absolute_import
 from mercurial import store
-import binascii, itertools, math, os, random, sys, time
+import binascii
 import collections
+import itertools
+import math
+import os
+import random
+import sys
+import time
+

 validchars = set(map(chr, range(0, 256)))
 alphanum = range(ord('A'), ord('Z'))
@@ -154,10 +162,10 @@ 
         r = store._hybridencode(p, True) # reference implementation in
Python
         if h != r:
             if nerrs == 0:
-                print >> sys.stderr, 'seed:', hex(seed)[:-1]
-            print >> sys.stderr, "\np: '%s'" % p.encode("string_escape")
-            print >> sys.stderr, "h: '%s'" % h.encode("string_escape")
-            print >> sys.stderr, "r: '%s'" % r.encode("string_escape")
+                print ('seed:', hex(seed)[:-1], file=sys.stderr)
+            print ("\np: '%s'" % p.encode("string_escape"),
file=sys.stderr)
+            print ("h: '%s'" % h.encode("string_escape"), file=sys.stderr)
+            print ("r: '%s'" % r.encode("string_escape"), file=sys.stderr)
             nerrs += 1