[PATCH 3 of 3] remove: add progress support

timeless timeless at gmail.com
Mon Mar 21 16:19:34 EDT 2016


In case people are curious, check-code can't easily check for this
because it replaces the contents of strings with 'x's and thus you
can't check that side of things. And while we could add an assert or a
validator, that'd be fairly painful for not much benefit. *sigh*.
(It is possible to teach check-code to rescan a range against the
original string to see if it's a match, but even that is fairly heavy
for not much benefit...

On Mon, Mar 21, 2016 at 1:01 AM, Anton Shestakov <engored at ya.ru> wrote:
> 21.03.2016, 12:25, "timeless" <timeless at mozdev.org>:
>> # HG changeset patch
>> # User timeless <timeless at mozdev.org>
>> # Date 1458248602 0
>> # Thu Mar 17 21:03:22 2016 +0000
>> # Node ID 1d7704a6d5dfd1a1a09cc337fe57cd4c41e3a27d
>> # Parent 47a0e2e459081990c948408b268bd3d01e077290
>> remove: add progress support
>>
>> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
>> --- a/mercurial/cmdutil.py
>> +++ b/mercurial/cmdutil.py
>> @@ -2407,7 +2407,10 @@
>>      else:
>>          warn = False
>>
>> - for subpath in sorted(wctx.substate):
>> + subs = sorted(wctx.substate)
>> + total = len(subs)
>> + count = 0
>> + for subpath in subs:
>>          def matchessubrepo(matcher, subpath):
>>              if matcher.exact(subpath):
>>                  return True
>> @@ -2416,7 +2419,10 @@
>>                      return True
>>              return False
>>
>> + count += 1
>>          if subrepos or matchessubrepo(m, subpath):
>> + ui.progress(_('searching'), count, total=total, unit=_('subrepos'))
>> +
>>              sub = wctx.sub(subpath)
>>              try:
>>                  submatch = matchmod.subdirmatcher(subpath, m)
>> @@ -2426,16 +2432,22 @@
>>              except error.LookupError:
>>                  warnings.append(_("skipping missing subrepository: %s\n")
>>                                 % join(subpath))
>> + ui.progress(_('searching'), None)
>>
>>      # warn about failure to delete explicit files/dirs
>>      deleteddirs = util.dirs(deleted)
>> - for f in m.files():
>> + files = m.files()
>> + total = len(files)
>> + count = 0
>> + for f in files:
>>          def insubrepo():
>>              for subpath in wctx.substate:
>>                  if f.startswith(subpath):
>>                      return True
>>              return False
>>
>> + count += 1
>> + ui.progress(_('deleting'), count, total=total, unit=_('file'))
>
> This one unit is still singular.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list