[PATCH] localrepo: provide progress updates during commit

Matt Mackall mpm at selenic.com
Thu Nov 17 16:56:46 CST 2011


On Sun, 2011-11-13 at 11:19 -0500, David Golub wrote:
> # HG changeset patch
> # User David Golub <golubdr at gmail.com>
> # Date 1321151484 18000
> # Branch stable
> # Node ID ea3de4de1f99d7038d2116c81f849b4e1136e35b
> # Parent  f8a0c79254965fd34eb9cbe82387115c5d7d7a59
> localrepo: provide progress updates during commit

This breaks a ton of tests.

> diff -r f8a0c7925496 -r ea3de4de1f99 mercurial/localrepo.py
> --- a/mercurial/localrepo.py	Thu Nov 10 17:06:12 2011 -0600
> +++ b/mercurial/localrepo.py	Sat Nov 12 21:31:24 2011 -0500
> @@ -1168,7 +1168,9 @@
>                  new = {}
>                  changed = []
>                  linkrev = len(self)
> -                for f in sorted(ctx.modified() + ctx.added()):
> +                total = len(ctx.modified() + ctx.added())
> +                for i, f in enumerate(sorted(ctx.modified() + ctx.added())):
> +                    self.ui.progress(_('committing'), i, total=total, unit=_('files'))
>                      self.ui.note(f + "\n")
>                      try:
>                          fctx = ctx[f]
> @@ -1185,6 +1187,7 @@
>                              raise
>                          else:
>                              removed.append(f)
> +                self.ui.progress(_('committing'), None)
>  
>                  # update manifest
>                  m1.update(new)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list