Patchwork progress: move API help in the 'mercurial.progress' module

login
register
mail settings
Submitter Augie Fackler
Date June 10, 2015, 5:13 p.m.
Message ID <646f536cc8b7d8e34040.1433956399@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/9582/
State Changes Requested
Headers show

Comments

Augie Fackler - June 10, 2015, 5:13 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1433725258 25200
#      Sun Jun 07 18:00:58 2015 -0700
# Node ID 646f536cc8b7d8e340404946f4afc0e156652d6c
# Parent  77f0602ad7dff0527152685b455508d44751bce6
progress: move API help in the 'mercurial.progress' module

The help should have been on the class in the first place, but the class now
live elsewhere.
Augie Fackler - June 10, 2015, 5:15 p.m.
On Wed, Jun 10, 2015 at 1:13 PM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1433725258 25200
> #      Sun Jun 07 18:00:58 2015 -0700
> # Node ID 646f536cc8b7d8e340404946f4afc0e156652d6c
> # Parent  77f0602ad7dff0527152685b455508d44751bce6
> progress: move API help in the 'mercurial.progress' module
>
> The help should have been on the class in the first place, but the class now
> live elsewhere.

No, this patch is wrong, because this documentation needs to be user
visible in 'hg help progress'.

>
> diff --git a/hgext/progress.py b/hgext/progress.py
> --- a/hgext/progress.py
> +++ b/hgext/progress.py
> @@ -27,12 +27,6 @@ The following settings are available::
>    disable = False # if true, don't show a progress bar
>    assume-tty = False # if true, ALWAYS show a progress bar, unless
>                       # disable is given
> -
> -Valid entries for the format field are topic, bar, number, unit,
> -estimate, speed, and item. item defaults to the last 20 characters of
> -the item, but this can be changed by adding either ``-<num>`` which
> -would take the last num characters, or ``+<num>`` for the first num
> -characters.
>  """
>
>  def uisetup(ui):
> diff --git a/mercurial/progress.py b/mercurial/progress.py
> --- a/mercurial/progress.py
> +++ b/mercurial/progress.py
> @@ -61,6 +61,14 @@ def fmtremaining(seconds):
>      return _("%dy%02dw") % (years, weeks)
>
>  class progbar(object):
> +    """A object capable of handling multiple progress bars
> +
> +    Valid entries for the format field are topic, bar, number, unit, estimate,
> +    speed, and item. item defaults to the last 20 characters of the item, but
> +    this can be changed by adding either ``-<num>`` which would take the last
> +    num characters, or ``+<num>`` for the first num characters.
> +    """
> +
>      def __init__(self, ui):
>          self.ui = ui
>          self._refreshlock = threading.Lock()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/progress.py b/hgext/progress.py
--- a/hgext/progress.py
+++ b/hgext/progress.py
@@ -27,12 +27,6 @@  The following settings are available::
   disable = False # if true, don't show a progress bar
   assume-tty = False # if true, ALWAYS show a progress bar, unless
                      # disable is given
-
-Valid entries for the format field are topic, bar, number, unit,
-estimate, speed, and item. item defaults to the last 20 characters of
-the item, but this can be changed by adding either ``-<num>`` which
-would take the last num characters, or ``+<num>`` for the first num
-characters.
 """
 
 def uisetup(ui):
diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -61,6 +61,14 @@  def fmtremaining(seconds):
     return _("%dy%02dw") % (years, weeks)
 
 class progbar(object):
+    """A object capable of handling multiple progress bars
+
+    Valid entries for the format field are topic, bar, number, unit, estimate,
+    speed, and item. item defaults to the last 20 characters of the item, but
+    this can be changed by adding either ``-<num>`` which would take the last
+    num characters, or ``+<num>`` for the first num characters.
+    """
+
     def __init__(self, ui):
         self.ui = ui
         self._refreshlock = threading.Lock()