Patchwork [4,of,5,in,crew] repoview: remove unreachable code

login
register
mail settings
Submitter Bryan O'Sullivan
Date April 13, 2013, 12:20 a.m.
Message ID <fafe9ca2a749822128ea.1365812445@australite.local>
Download mbox | patch
Permalink /patch/1292/
State Accepted
Commit fafe9ca2a749822128ea25c721a610b51713d826
Headers show

Comments

Bryan O'Sullivan - April 13, 2013, 12:20 a.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@fb.com>
# Date 1365812332 25200
#      Fri Apr 12 17:18:52 2013 -0700
# Node ID fafe9ca2a749822128ea25c721a610b51713d826
# Parent  6edb0e18b83c441dcdee7146f40f49c79a2c69e1
repoview: remove unreachable code

Found using Cython.
Pierre-Yves David - April 13, 2013, 12:31 a.m.
On 13 avr. 2013, at 02:20, Bryan O'Sullivan wrote:

> # HG changeset patch
> # User Bryan O'Sullivan <bryano@fb.com>
> # Date 1365812332 25200
> #      Fri Apr 12 17:18:52 2013 -0700
> # Node ID fafe9ca2a749822128ea25c721a610b51713d826
> # Parent  6edb0e18b83c441dcdee7146f40f49c79a2c69e1
> repoview: remove unreachable code
> 
> Found using Cython.

Unreachable? ¿Oô? I doubt that dear sir!

> 
> diff --git a/mercurial/repoview.py b/mercurial/repoview.py
> --- a/mercurial/repoview.py
> +++ b/mercurial/repoview.py
> @@ -36,7 +36,6 @@ def computehidden(repo):
>             blockers.append(repo[bm].rev())
>         blocked = cl.ancestors(blockers, inclusive=True)
>         return frozenset(r for r in hideable if r not in blocked)
> -    return frozenset()
> 
> def computeunserved(repo):
>     """compute the set of revision that should be filtered when used a server
Bryan O'Sullivan - April 13, 2013, 12:39 a.m.
On Fri, Apr 12, 2013 at 5:31 PM, Pierre-Yves David <
pierre-yves.david@ens-lyon.org> wrote:

> Unreachable? ¿Oô? I doubt that dear sir!
>

Oops, I fat-fingered that one.
Augie Fackler - April 13, 2013, 12:39 a.m.
On Apr 12, 2013, at 8:31 PM, Pierre-Yves David <pierre-yves.david@ens-lyon.org> wrote:

> On 13 avr. 2013, at 02:20, Bryan O'Sullivan wrote:
> 
>> # HG changeset patch
>> # User Bryan O'Sullivan <bryano@fb.com>
>> # Date 1365812332 25200
>> #      Fri Apr 12 17:18:52 2013 -0700
>> # Node ID fafe9ca2a749822128ea25c721a610b51713d826
>> # Parent  6edb0e18b83c441dcdee7146f40f49c79a2c69e1
>> repoview: remove unreachable code
>> 
>> Found using Cython.
> 
> Unreachable? ¿Oô? I doubt that dear sir!

By inspection, I agree with Pierre-Yves, this code should be reachable.
Bryan O'Sullivan - April 13, 2013, 12:46 a.m.
On Fri, Apr 12, 2013 at 5:39 PM, Augie Fackler <raf@durin42.com> wrote:

> By inspection, I agree with Pierre-Yves, this code should be reachable.


I deleted the wrong line of the file - there really is unreachable code on
line 57.

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -36,7 +36,6 @@  def computehidden(repo):
             blockers.append(repo[bm].rev())
         blocked = cl.ancestors(blockers, inclusive=True)
         return frozenset(r for r in hideable if r not in blocked)
-    return frozenset()
 
 def computeunserved(repo):
     """compute the set of revision that should be filtered when used a server