Martin, Linus said "Just for fun". Are You think resending simple patch eight times funny? If my contribution worth somesing, you can fix it yourself, otherwise throw it away. But bear in mind, "graph" visualisation in hgweb completely broken: try to compare high-branched tree with tortoisehg's version.<br>
<br><div class="gmail_quote">2012/2/2 Martin Geisler <span dir="ltr"><<a href="mailto:mg@aragost.com">mg@aragost.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">Constantine Linnick <<a href="mailto:theaspect@gmail.com">theaspect@gmail.com</a>> writes:<br>
<br>
> # HG changeset patch<br>
> # User Constantine Linnick <<a href="mailto:theaspect@gmail.com">theaspect@gmail.com</a>><br>
> # Date 1327235726 -25200<br>
> # Node ID 537733973603cb4f974f01aecd51923da17e314f<br>
> # Parent  878bc4a62a735a1624e9b69c672d5fb5074d4855<br>
> graph: in hgrc specify line width for main branch<br>
><br>
> You can specify width to visually distinguish main branch (trunk)<br>
> on hgweb's graph page. Settings format is branch_name.width = value,<br>
> where width in px e.g.:<br>
> [graph]<br>
> default.width = 3<br>
><br>
> diff -r 878bc4a62a73 -r 537733973603 mercurial/graphmod.py<br>
> --- a/mercurial/graphmod.py   Thu Jan 19 14:31:05 2012 -0600<br>
> +++ b/mercurial/graphmod.py   Sun Jan 22 19:35:26 2012 +0700<br>
> @@ -18,6 +18,7 @@<br>
>  """<br>
><br>
>  from mercurial.node import nullrev<br>
> +import re<br>
><br>
>  CHANGESET = 'C'<br>
><br>
> @@ -67,7 +68,7 @@<br>
>          parents = set([p.rev() for p in ctx.parents() if p.node() in include])<br>
>          yield (ctx.rev(), CHANGESET, ctx, sorted(parents))<br>
><br>
> -def colored(dag):<br>
> +def colored(dag, repo):<br>
>      """annotates a DAG with colored edge information<br>
><br>
>      For each DAG node this function emits tuples::<br>
> @@ -83,6 +84,21 @@<br>
>      seen = []<br>
>      colors = {}<br>
>      newcolor = 1<br>
> +    config = dict()<br>
<br>
</div></div>There is another empty dict just above and it uses {}. I'm not sure<br>
which I prefer myself, but it's important to be consistent. You should<br>
therefore use {} here too so that you keep the coding style consistent.<br>
<div class="im"><br></div></blockquote><div><br>Here: <a href="http://www.selenic.com/pipermail/mercurial-devel/2012-January/036816.html">http://www.selenic.com/pipermail/mercurial-devel/2012-January/036816.html</a><br>Mark said "No bug fixes, no
spelling fixes, no coding style fixes, no whitespace fiddling, nothing."<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">

> +    for key, val in repo.ui.configitems('graph'):<br>
> +        if '.' not in key:<br>
> +            continue<br>
> +        branch, setting = key.rsplit('.',1)<br>
<br>
</div>We use PEP 8 formatting in Mercurial. Please remember to run the full<br>
test suite before submitting patches -- test-check-code-hg.t should have<br>
caught the missing spaces around ','.<br>
<div class="im"><br></div></blockquote><div>I've run All tests. Your particular test case:<br><br>~/workspace/mercurial-repo/tests$ ./run-tests.py test-check-code-hg.t<br>.<br># Ran 1 tests, 0 skipped, 0 failed.<br> <br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
> +        gdict = config.setdefault(branch, dict())<br>
> +<br>
> +        # Validation<br>
> +        if ((setting not in ('width',)) or<br>
<br>
</div>I believe this is the same as<br></blockquote><div> </div><div>look at second part, I manually splitted functional in two patches, as Mark said.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

 </blockquote><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  if (setting != 'width'<br>
<br>
right?<br>
<div class="im"><br>
> +                (setting == "width" and not re.match('[0-9]{1,2}', val))):<br>
<br>
</div>Please don't use regular expressions for something that can be checked<br>
with simpler string functions:<br>
<br></blockquote><div><br>I test not digit, I test digit between 0 and 99. Small regexp simplier then two tests<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  <a href="http://docs.python.org/library/stdtypes.html#str.isdigit" target="_blank">http://docs.python.org/library/stdtypes.html#str.isdigit</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Martin Geisler<br>
<br>
aragost Trifork<br>
Professional Mercurial support<br>
<a href="http://www.aragost.com/mercurial/customer-projects/" target="_blank">http://www.aragost.com/mercurial/customer-projects/</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>With Best Regards,<br>Constantine<br>