Patchwork [4,of,4] py3: convert log opts to bytes-key dict

login
register
mail settings
Submitter Yuya Nishihara
Date March 17, 2017, 3:25 p.m.
Message ID <d32b1cfe597ebe2093c4.1489764350@mimosa>
Download mbox | patch
Permalink /patch/19423/
State Accepted
Headers show

Comments

Yuya Nishihara - March 17, 2017, 3:25 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1489483439 -32400
#      Tue Mar 14 18:23:59 2017 +0900
# Node ID d32b1cfe597ebe2093c42b67e85143190eda0e8b
# Parent  9a758c848fe08e97386fca95d2428aa003939b4d
py3: convert log opts to bytes-key dict

Now simple log command works.
Augie Fackler - March 19, 2017, 6:21 a.m.
On Sat, Mar 18, 2017 at 12:25:50AM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1489483439 -32400
> #      Tue Mar 14 18:23:59 2017 +0900
> # Node ID d32b1cfe597ebe2093c42b67e85143190eda0e8b
> # Parent  9a758c848fe08e97386fca95d2428aa003939b4d
> py3: convert log opts to bytes-key dict

Queued, very nice.

>
> Now simple log command works.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -3393,6 +3393,7 @@ def log(ui, repo, *pats, **opts):
>      Returns 0 on success.
>
>      """
> +    opts = pycompat.byteskwargs(opts)
>      if opts.get('follow') and opts.get('rev'):
>          opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))]
>          del opts['follow']
> diff --git a/tests/test-check-py3-commands.t b/tests/test-check-py3-commands.t
> --- a/tests/test-check-py3-commands.t
> +++ b/tests/test-check-py3-commands.t
> @@ -52,7 +52,7 @@ out some potential warnings that come fr
>    $ $PYTHON3 $HGBIN files | wc -l
>    \s*15 (re)
>
> -Test if `hg tip` works:
> +Test if log-like commands work:
>
>    $ $PYTHON3 $HGBIN tip
>    changeset:   10:e76ed1e480ef
> @@ -62,6 +62,13 @@ Test if `hg tip` works:
>    summary:     Fix linking of changeset revs when merging
>
>
> +  $ $PYTHON3 $HGBIN log -r0
> +  changeset:   0:9117c6561b0b
> +  user:        mpm@selenic.com
> +  date:        Tue May 03 13:16:10 2005 -0800
> +  summary:     Add back links from file revisions to changeset revisions
> +
> +
>    $ cd ..
>  #endif
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3393,6 +3393,7 @@  def log(ui, repo, *pats, **opts):
     Returns 0 on success.
 
     """
+    opts = pycompat.byteskwargs(opts)
     if opts.get('follow') and opts.get('rev'):
         opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))]
         del opts['follow']
diff --git a/tests/test-check-py3-commands.t b/tests/test-check-py3-commands.t
--- a/tests/test-check-py3-commands.t
+++ b/tests/test-check-py3-commands.t
@@ -52,7 +52,7 @@  out some potential warnings that come fr
   $ $PYTHON3 $HGBIN files | wc -l
   \s*15 (re)
 
-Test if `hg tip` works:
+Test if log-like commands work:
 
   $ $PYTHON3 $HGBIN tip
   changeset:   10:e76ed1e480ef
@@ -62,6 +62,13 @@  Test if `hg tip` works:
   summary:     Fix linking of changeset revs when merging
   
 
+  $ $PYTHON3 $HGBIN log -r0
+  changeset:   0:9117c6561b0b
+  user:        mpm@selenic.com
+  date:        Tue May 03 13:16:10 2005 -0800
+  summary:     Add back links from file revisions to changeset revisions
+  
+
   $ cd ..
 #endif