Patchwork [2,of,9] py3: add tests to show `hg branches` and `hg bookmarks` work on Python 3

login
register
mail settings
Submitter Pulkit Goyal
Date June 23, 2017, 7:54 p.m.
Message ID <2ed2c527b9ff174c7a67.1498247696@workspace>
Download mbox | patch
Permalink /patch/21645/
State Accepted
Headers show

Comments

Pulkit Goyal - June 23, 2017, 7:54 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498078888 -19800
#      Thu Jun 22 02:31:28 2017 +0530
# Node ID 2ed2c527b9ff174c7a67ee7051c2968ea1ce4f7d
# Parent  8dce5f597161758063af4d58068f484f633afb85
py3: add tests to show `hg branches` and `hg bookmarks` work on Python 3
Yuya Nishihara - June 24, 2017, 3:42 a.m.
On Sat, 24 Jun 2017 01:24:56 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1498078888 -19800
> #      Thu Jun 22 02:31:28 2017 +0530
> # Node ID 2ed2c527b9ff174c7a67ee7051c2968ea1ce4f7d
> # Parent  8dce5f597161758063af4d58068f484f633afb85
> py3: add tests to show `hg branches` and `hg bookmarks` work on Python 3
> 
> diff --git a/tests/test-py3-commands.t b/tests/test-py3-commands.t
> --- a/tests/test-py3-commands.t
> +++ b/tests/test-py3-commands.t
> @@ -229,3 +229,11 @@
>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>    $ $PYTHON3 $HGBIN identify
>    71c96e924262
> +
> +branches and bookmarks also works.
> +
> +  $ $PYTHON3 $HGBIN branches
> +  default                        1:e1e9167203d4
> +  $ $PYTHON3 $HGBIN bookmark book
> +  $ $PYTHON3 $HGBIN bookmarks
> +   * book                      0:71c96e924262

Still "hg bookmarks" fails (because of bookmarks refactoring?), so dropped
this for now.

+  Traceback (most recent call last):
+    File "/tmp/hgtests.ps_P_1/install/bin/hg", line 45, in <module>
+      mercurial.dispatch.run()
+    File "mercurial/dispatch.py", line 86, in run
+      status = (dispatch(req) or 0) & 255
+    File "mercurial/dispatch.py", line 167, in dispatch
+      ret = _runcatch(req)
+    File "mercurial/dispatch.py", line 307, in _runcatch
+      return _callcatch(ui, _runcatchfunc)
+    File "mercurial/dispatch.py", line 315, in _callcatch
+      return scmutil.callcatch(ui, func)
+    File "mercurial/scmutil.py", line 145, in callcatch
+      return func()
+    File "mercurial/dispatch.py", line 297, in _runcatchfunc
+      return _dispatch(req)
+    File "mercurial/dispatch.py", line 927, in _dispatch
+      cmdpats, cmdoptions)
+    File "mercurial/dispatch.py", line 663, in runcommand
+      ret = _runcommand(ui, options, cmd, d)
+    File "mercurial/dispatch.py", line 935, in _runcommand
+      return cmdfunc()
+    File "mercurial/dispatch.py", line 924, in <lambda>
+      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
+    File "mercurial/util.py", line 1056, in check
+      return func(*args, **kwargs)
+    File "mercurial/commands.py", line 983, in bookmark
+      bookmarks.printbookmarks(ui, repo, **opts)
+  TypeError: printbookmarks() keywords must be strings
+  [1]

Patch

diff --git a/tests/test-py3-commands.t b/tests/test-py3-commands.t
--- a/tests/test-py3-commands.t
+++ b/tests/test-py3-commands.t
@@ -229,3 +229,11 @@ 
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ $PYTHON3 $HGBIN identify
   71c96e924262
+
+branches and bookmarks also works.
+
+  $ $PYTHON3 $HGBIN branches
+  default                        1:e1e9167203d4
+  $ $PYTHON3 $HGBIN bookmark book
+  $ $PYTHON3 $HGBIN bookmarks
+   * book                      0:71c96e924262