Patchwork [RESEND] tests: make doctest py3-compatible again

login
register
mail settings
Submitter Yuya Nishihara
Date Feb. 2, 2018, 11:46 a.m.
Message ID <522864fae7f6de76a49f.1517572019@mimosa>
Download mbox | patch
Permalink /patch/27224/
State Accepted
Headers show

Comments

Yuya Nishihara - Feb. 2, 2018, 11:46 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1517030246 -32400
#      Sat Jan 27 14:17:26 2018 +0900
# Node ID 522864fae7f6de76a49f80baf267d455a9a480dd
# Parent  fe731c4b62ea05def7ed74a30d23a36a3adaefbd
tests: make doctest py3-compatible again

A parsed tree is replaced with parse(expr) because it sucks to add b'' to
every string literal.
Augie Fackler - Feb. 2, 2018, 1:33 p.m.
> On Feb 2, 2018, at 6:46 AM, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1517030246 -32400
> #      Sat Jan 27 14:17:26 2018 +0900
> # Node ID 522864fae7f6de76a49f80baf267d455a9a480dd
> # Parent  fe731c4b62ea05def7ed74a30d23a36a3adaefbd
> tests: make doctest py3-compatible again

queued, thanks

Patch

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -717,13 +717,13 @@  def _ishashlikesymbol(symbol):
 def gethashlikesymbols(tree):
     """returns the list of symbols of the tree that look like hashes
 
-    >>> gethashlikesymbols(('dagrange', ('symbol', '3'), ('symbol', 'abe3ff')))
+    >>> gethashlikesymbols(parse(b'3::abe3ff'))
     ['3', 'abe3ff']
-    >>> gethashlikesymbols(('func', ('symbol', 'precursors'), ('symbol', '.')))
+    >>> gethashlikesymbols(parse(b'precursors(.)'))
     []
-    >>> gethashlikesymbols(('func', ('symbol', 'precursors'), ('symbol', '34')))
+    >>> gethashlikesymbols(parse(b'precursors(34)'))
     ['34']
-    >>> gethashlikesymbols(('symbol', 'abe3ffZ'))
+    >>> gethashlikesymbols(parse(b'abe3ffZ'))
     []
     """
     if not tree: