Patchwork [hggit] help: accept a ui parameter to the help function

login
register
mail settings
Submitter Eric Sumner
Date Oct. 14, 2015, 7:40 p.m.
Message ID <710a67ccff472d5f613c.1444851632@dev911.ash4.facebook.com>
Download mbox | patch
Permalink /patch/11074/
State Deferred
Headers show

Comments

Eric Sumner - Oct. 14, 2015, 7:40 p.m.
# HG changeset patch
# User Eric Sumner <ericsumner@fb.com>
# Date 1444851328 25200
#      Wed Oct 14 12:35:28 2015 -0700
# Node ID 710a67ccff472d5f613c57cf2ebbf5fe3db13a41
# Parent  ee587dc3e295d642d1919f6e7b73dc2c4747c9f3
help: accept a ui parameter to the help function

The latest version of Mercurial passes a ui argument to the functions stored
in the helptable; this patch accepts and ignores this parameter so that asking
for help doesn't abort.
Augie Fackler - Oct. 15, 2015, 7:17 p.m.
(+sid0 so this doesn't get lost in noise)

On Wed, Oct 14, 2015 at 3:40 PM, Eric Sumner <ericsumner@fb.com> wrote:
> # HG changeset patch
> # User Eric Sumner <ericsumner@fb.com>
> # Date 1444851328 25200
> #      Wed Oct 14 12:35:28 2015 -0700
> # Node ID 710a67ccff472d5f613c57cf2ebbf5fe3db13a41
> # Parent  ee587dc3e295d642d1919f6e7b73dc2c4747c9f3
> help: accept a ui parameter to the help function
>
> The latest version of Mercurial passes a ui argument to the functions stored
> in the helptable; this patch accepts and ignores this parameter so that asking
> for help doesn't abort.
>
> diff --git a/hggit/__init__.py b/hggit/__init__.py
> --- a/hggit/__init__.py
> +++ b/hggit/__init__.py
> @@ -169,7 +169,7 @@
>      })
>      helpdir = os.path.join(os.path.dirname(__file__), 'help')
>      entry = (['git'], _("Working with Git Repositories"),
> -             lambda: open(os.path.join(helpdir, 'git.rst')).read())
> +             lambda ui=None: open(os.path.join(helpdir, 'git.rst')).read())
>      insort(help.helptable, entry)
>
>  def reposetup(ui, repo):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Siddharth Agarwal - Oct. 20, 2015, 10:31 p.m.
On 10/14/15 20:40, Eric Sumner wrote:
> # HG changeset patch
> # User Eric Sumner <ericsumner@fb.com>
> # Date 1444851328 25200
> #      Wed Oct 14 12:35:28 2015 -0700
> # Node ID 710a67ccff472d5f613c57cf2ebbf5fe3db13a41
> # Parent  ee587dc3e295d642d1919f6e7b73dc2c4747c9f3
> help: accept a ui parameter to the help function

Looks like this was already fixed with an earlier patch by Yuya.

>
> The latest version of Mercurial passes a ui argument to the functions stored
> in the helptable; this patch accepts and ignores this parameter so that asking
> for help doesn't abort.
>
> diff --git a/hggit/__init__.py b/hggit/__init__.py
> --- a/hggit/__init__.py
> +++ b/hggit/__init__.py
> @@ -169,7 +169,7 @@
>       })
>       helpdir = os.path.join(os.path.dirname(__file__), 'help')
>       entry = (['git'], _("Working with Git Repositories"),
> -             lambda: open(os.path.join(helpdir, 'git.rst')).read())
> +             lambda ui=None: open(os.path.join(helpdir, 'git.rst')).read())
>       insort(help.helptable, entry)
>   
>   def reposetup(ui, repo):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hggit/__init__.py b/hggit/__init__.py
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -169,7 +169,7 @@ 
     })
     helpdir = os.path.join(os.path.dirname(__file__), 'help')
     entry = (['git'], _("Working with Git Repositories"),
-             lambda: open(os.path.join(helpdir, 'git.rst')).read())
+             lambda ui=None: open(os.path.join(helpdir, 'git.rst')).read())
     insort(help.helptable, entry)
 
 def reposetup(ui, repo):