D5679: py3: fix missing b prefixes in `hg eval` invocations in test-arbitraryfilectx.t
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Thu Jan 24 16:41:23 UTC 2019
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Test passes on Python 3.
1. skip-blame b prefixes
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5679
AFFECTED FILES
contrib/python3-whitelist
tests/test-arbitraryfilectx.t
CHANGE DETAILS
diff --git a/tests/test-arbitraryfilectx.t b/tests/test-arbitraryfilectx.t
--- a/tests/test-arbitraryfilectx.t
+++ b/tests/test-arbitraryfilectx.t
@@ -72,30 +72,30 @@
These files are different and should return True (different):
(Note that filecmp.cmp's return semantics are inverted from ours, so we invert
for simplicity):
- $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['real_A'])"
+ $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'real_A'])"
True (no-eol)
- $ hg eval "not filecmp.cmp('A', 'real_A')"
+ $ hg eval "not filecmp.cmp(b'A', b'real_A')"
True (no-eol)
These files are identical and should return False (same):
- $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['A'])"
+ $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'A'])"
False (no-eol)
- $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['B'])"
+ $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'B'])"
False (no-eol)
- $ hg eval "not filecmp.cmp('A', 'B')"
+ $ hg eval "not filecmp.cmp(b'A', b'B')"
False (no-eol)
This comparison should also return False, since A and sym_A are substantially
the same in the eyes of ``filectx.cmp``, which looks at data only.
- $ hg eval "context.arbitraryfilectx('real_A', repo).cmp(repo[None]['sym_A'])"
+ $ hg eval "context.arbitraryfilectx(b'real_A', repo).cmp(repo[None][b'sym_A'])"
False (no-eol)
A naive use of filecmp on those two would wrongly return True, since it follows
the symlink to "A", which has different contents.
#if symlink
- $ hg eval "not filecmp.cmp('real_A', 'sym_A')"
+ $ hg eval "not filecmp.cmp(b'real_A', b'sym_A')"
True (no-eol)
#else
- $ hg eval "not filecmp.cmp('real_A', 'sym_A')"
+ $ hg eval "not filecmp.cmp(b'real_A', b'sym_A')"
False (no-eol)
#endif
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -14,6 +14,7 @@
test-ancestor.py
test-annotate.py
test-annotate.t
+test-arbitraryfilectx.t
test-archive-symlinks.t
test-archive.t
test-atomictempfile.py
To: durin42, pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list