[PATCH 4 of 5] branchmap: simply update code

Simon Heimberg simohe at besonet.ch
Thu Jan 9 09:50:44 CST 2014


Two general comments below, I can not say anything about the
functionality.

On Monday 06.01.2014, 17:38 -0800 pierre-yves.david at ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1389047209 28800
> #      Mon Jan 06 14:26:49 2014 -0800
> # Node ID 5edde891b488a474c9b677d0cd52569f79c44c7e
> # Parent  30aff651beece3d31ab3eb70b6cb40bd6b8bdf88
> branchmap: simply update code
> 
> We drop iterrevs which are not needed anymore. The know head are never a
> descendant of the updated set. It was possible with the old strip code. This
> simplification make the code easier to read an update.
> 
> diff --git a/contrib/perf.py b/contrib/perf.py
> --- a/contrib/perf.py
> +++ b/contrib/perf.py
> @@ -21,11 +21,11 @@ def timer(func, title=None):
>          count += 1
>          a, b = ostart, ostop
>          results.append((cstop - cstart, b[0] - a[0], b[1]-a[1]))
>          if cstop - begin > 3 and count >= 100:
>              break
> -        if cstop - begin > 10 and count >= 3:
> +        if cstop - begin > 10 and count >= 25:

I do not see how this change is related to the topic. It looks like this
is used for all perf measurements.

>              break
>      if title:
>          sys.stderr.write("! %s\n" % title)
>      if r:
>          sys.stderr.write("! result: %s\n" % r)
> @@ -394,10 +394,11 @@ def perfbranchmap(ui, repo, full=False):
>              view.branchmap()
>          return d
>      # add filter in smaller subset to bigger subset
>      possiblefilters = set(repoview.filtertable)
>      allfilters = []
> +    possiblefilters = ['base']

Why is possiblefilters defined two lines above and overwritten here? Is
the first one unnecessary?

>      while possiblefilters:
>          for name in possiblefilters:
>              subset = branchmap.subsettable.get(name)
>              if subset not in possiblefilters:
>                  break
> diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
> --- a/mercurial/branchmap.py
> +++ b/mercurial/branchmap.py
> @@ -214,11 +214,11 @@ class branchcache(dict):
>              # Abort may be raise by read only opener
>              pass
<snip>


More information about the Mercurial-devel mailing list