Patchwork [remotenames] discovery: consolidate and fix topic check

login
register
mail settings
Submitter Sean Farley
Date April 29, 2016, 9:13 p.m.
Message ID <8b03e1764da8bed44b38.1461964419@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/14844/
State Accepted
Headers show

Comments

Sean Farley - April 29, 2016, 9:13 p.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1461964151 25200
#      Fri Apr 29 14:09:11 2016 -0700
# Node ID 8b03e1764da8bed44b38d0a591e8e868a5ae403b
# Parent  f67362d0cfcc228005014efc456c8bf42f8f330b
discovery: consolidate and fix topic check
Ryan McElroy - May 1, 2016, 4:25 p.m.
On 4/29/2016 10:13 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean@farley.io>
> # Date 1461964151 25200
> #      Fri Apr 29 14:09:11 2016 -0700
> # Node ID 8b03e1764da8bed44b38d0a591e8e868a5ae403b
> # Parent  f67362d0cfcc228005014efc456c8bf42f8f330b
> discovery: consolidate and fix topic check
>
> diff --git a/remotenames.py b/remotenames.py
> --- a/remotenames.py
> +++ b/remotenames.py
> @@ -649,14 +649,15 @@ def expushdiscoverybookmarks(pushop):
>               # aborting error causing the connection to close
>               anonheads = []
>               knownlist = pushop.remote.known(revs)
>               for node, known in zip(revs, knownlist):
>                   ctx = repo[node]
> -                obs = ctx.obsolete()
> -                closes = ctx.closesbranch()
> -                # if there is a topic, let's just skip it for now
> -                if known or obs or closes or 'topic' in ctx.extra():
> +                if (known or
> +                    ctx.obsolete() or
> +                    ctx.closesbranch() or
> +                    # if there is a topic, let's just skip it for now
> +                    (ctx.mutable() and 'topic' in ctx.extra())):

This looks good to me

>                       continue
>                   anonheads.append(short(node))
>   
>               if anonheads:
>                   msg = _("push would create new anonymous heads (%s)")
>
Sean Farley - May 1, 2016, 5:52 p.m.
Ryan McElroy <rm@fb.com> writes:

> On 4/29/2016 10:13 PM, Sean Farley wrote:
>> # HG changeset patch
>> # User Sean Farley <sean@farley.io>
>> # Date 1461964151 25200
>> #      Fri Apr 29 14:09:11 2016 -0700
>> # Node ID 8b03e1764da8bed44b38d0a591e8e868a5ae403b
>> # Parent  f67362d0cfcc228005014efc456c8bf42f8f330b
>> discovery: consolidate and fix topic check
>>
>> diff --git a/remotenames.py b/remotenames.py
>> --- a/remotenames.py
>> +++ b/remotenames.py
>> @@ -649,14 +649,15 @@ def expushdiscoverybookmarks(pushop):
>>               # aborting error causing the connection to close
>>               anonheads = []
>>               knownlist = pushop.remote.known(revs)
>>               for node, known in zip(revs, knownlist):
>>                   ctx = repo[node]
>> -                obs = ctx.obsolete()
>> -                closes = ctx.closesbranch()
>> -                # if there is a topic, let's just skip it for now
>> -                if known or obs or closes or 'topic' in ctx.extra():
>> +                if (known or
>> +                    ctx.obsolete() or
>> +                    ctx.closesbranch() or
>> +                    # if there is a topic, let's just skip it for now
>> +                    (ctx.mutable() and 'topic' in ctx.extra())):
>
> This looks good to me

Cool, I'll push to the repo then.

Patch

diff --git a/remotenames.py b/remotenames.py
--- a/remotenames.py
+++ b/remotenames.py
@@ -649,14 +649,15 @@  def expushdiscoverybookmarks(pushop):
             # aborting error causing the connection to close
             anonheads = []
             knownlist = pushop.remote.known(revs)
             for node, known in zip(revs, knownlist):
                 ctx = repo[node]
-                obs = ctx.obsolete()
-                closes = ctx.closesbranch()
-                # if there is a topic, let's just skip it for now
-                if known or obs or closes or 'topic' in ctx.extra():
+                if (known or
+                    ctx.obsolete() or
+                    ctx.closesbranch() or
+                    # if there is a topic, let's just skip it for now
+                    (ctx.mutable() and 'topic' in ctx.extra())):
                     continue
                 anonheads.append(short(node))
 
             if anonheads:
                 msg = _("push would create new anonymous heads (%s)")