Re: [PATCH 2 of 2] histedit: report planning progress from initialization

2016-08-28 Thread Yuya Nishihara
On Wed, 24 Aug 2016 17:31:19 +, timeless wrote:
> # HG changeset patch
> # User timeless 
> # Date 1472058857 0
> #  Wed Aug 24 17:14:17 2016 +
> # Node ID d0ec531c3307561e18bb76b7178371e1ababcf5d
> # Parent  7b0afc5eacdc0662ed0fcde8eb58c8e599a7f695
> # Available At https://bitbucket.org/timeless/mercurial-crew
> #  hg pull https://bitbucket.org/timeless/mercurial-crew -r 
> d0ec531c3307
> histedit: report planning progress from initialization
> 
> This hasn't actually shown up as slow, but it could...

I don't think parsing rule lines is slow enough to show progress.

> diff -r 7b0afc5eacdc -r d0ec531c3307 hgext/histedit.py
> --- a/hgext/histedit.py   Wed Aug 24 17:13:48 2016 +
> +++ b/hgext/histedit.py   Wed Aug 24 17:14:17 2016 +
> @@ -347,29 +347,36 @@
>  
>  keep = lines[index] == 'True'
>  index += 1
> +ui = self.repo.ui
>  
>  # Rules
>  rules = []
>  rulelen = int(lines[index])
>  index += 1
>  for i in xrange(rulelen):
> +ui.progress(_("planning"), i, 'task',
> +_('changes'), rulelen)
>  ruleaction = lines[index]
>  index += 1
>  rule = lines[index]
>  index += 1
>  rules.append((ruleaction, rule))

Looks like two lines per rule. pos and total would be doubled.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] histedit: report planning progress from initialization

2016-08-25 Thread timeless
I've now hit this:

planning [  ]
19/1184 8m45s

So yes, this is a real thing. And yes, it's really as slow as progress
predicts :/

On Wed, Aug 24, 2016 at 1:31 PM, timeless  wrote:
> # HG changeset patch
> # User timeless 
> # Date 1472058857 0
> #  Wed Aug 24 17:14:17 2016 +
> # Node ID d0ec531c3307561e18bb76b7178371e1ababcf5d
> # Parent  7b0afc5eacdc0662ed0fcde8eb58c8e599a7f695
> # Available At https://bitbucket.org/timeless/mercurial-crew
> #  hg pull https://bitbucket.org/timeless/mercurial-crew -r 
> d0ec531c3307
> histedit: report planning progress from initialization
>
> This hasn't actually shown up as slow, but it could...
>
> diff -r 7b0afc5eacdc -r d0ec531c3307 hgext/histedit.py
> --- a/hgext/histedit.py Wed Aug 24 17:13:48 2016 +
> +++ b/hgext/histedit.py Wed Aug 24 17:14:17 2016 +
> @@ -347,29 +347,36 @@
>
>  keep = lines[index] == 'True'
>  index += 1
> +ui = self.repo.ui
>
>  # Rules
>  rules = []
>  rulelen = int(lines[index])
>  index += 1
>  for i in xrange(rulelen):
> +ui.progress(_("planning"), i, 'task',
> +_('changes'), rulelen)
>  ruleaction = lines[index]
>  index += 1
>  rule = lines[index]
>  index += 1
>  rules.append((ruleaction, rule))
> +ui.progress(_("planning"), None)
>
>  # Replacements
>  replacements = []
>  replacementlen = int(lines[index])
>  index += 1
>  for i in xrange(replacementlen):
> +ui.progress(_("planning"), i, 'task',
> +_('changes'), replacementlen)
>  replacement = lines[index]
>  original = node.bin(replacement[:40])
>  succ = [node.bin(replacement[i:i + 40]) for i in
>  range(40, len(replacement), 40)]
>  replacements.append((original, succ))
>  index += 1
> +ui.progress(_("planning"), None)
>
>  backupfile = lines[index]
>  index += 1
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel