Patchwork outgoing: run on filtered repo

login
register
mail settings
Submitter via Mercurial-devel
Date May 5, 2017, 5:10 p.m.
Message ID <992b37360cb54124e871.1494004217@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20462/
State Accepted
Headers show

Comments

via Mercurial-devel - May 5, 2017, 5:10 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1494004116 25200
#      Fri May 05 10:08:36 2017 -0700
# Node ID 992b37360cb54124e8718f70cfccc1ee3a3f8d44
# Parent  2cfdf5241096f6c0c2d45d32b2f1a41575835025
outgoing: run on filtered repo

outgoing has been using a filtered repo since fe67107094fd (discovery:
outgoing pass unfiltered repo to findcommonincoming (issue3776),
2013-01-28). If I'm reading code and history correctly, it should be
safe to run _outgoing() on a filtered repo since c5456b64eb07
(discovery: run discovery on filtered repository, 2015-01-07). By
running _outgoing() on a filtered repo, we can also remove the
workaround there for ignoring filtered revisions.
Augie Fackler - May 5, 2017, 10:45 p.m.
On Fri, May 05, 2017 at 10:10:17AM -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1494004116 25200
> #      Fri May 05 10:08:36 2017 -0700
> # Node ID 992b37360cb54124e8718f70cfccc1ee3a3f8d44
> # Parent  2cfdf5241096f6c0c2d45d32b2f1a41575835025
> outgoing: run on filtered repo
>
> outgoing has been using a filtered repo since fe67107094fd (discovery:

should this instance of filtered be unfiltered?

> outgoing pass unfiltered repo to findcommonincoming (issue3776),
> 2013-01-28). If I'm reading code and history correctly, it should be
> safe to run _outgoing() on a filtered repo since c5456b64eb07
> (discovery: run discovery on filtered repository, 2015-01-07). By
> running _outgoing() on a filtered repo, we can also remove the
> workaround there for ignoring filtered revisions.
>
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -869,7 +869,7 @@
>          revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
>
>      other = peer(repo, opts, dest)
> -    outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs,
> +    outgoing = discovery.findcommonoutgoing(repo, other, revs,
>                                              force=opts.get('force'))
>      o = outgoing.missing
>      if not o:
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -120,10 +120,6 @@
>      secretlist = []
>      if excluded:
>          for n in excluded:
> -            if n not in repo:
> -                # discovery should not have included the filtered revision,
> -                # we have to explicitly exclude it until discovery is cleanup.
> -                continue
>              ctx = repo[n]
>              if ctx.phase() >= phases.secret and not ctx.extinct():
>                  secretlist.append(n)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
via Mercurial-devel - May 5, 2017, 11:12 p.m.
On May 5, 2017 15:45, "Augie Fackler" <raf@durin42.com> wrote:

On Fri, May 05, 2017 at 10:10:17AM -0700, Martin von Zweigbergk via
Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1494004116 25200
> #      Fri May 05 10:08:36 2017 -0700
> # Node ID 992b37360cb54124e8718f70cfccc1ee3a3f8d44
> # Parent  2cfdf5241096f6c0c2d45d32b2f1a41575835025
> outgoing: run on filtered repo
>
> outgoing has been using a filtered repo since fe67107094fd (discovery:

should this instance of filtered be unfiltered?


Indeed it should. Thanks for reading carefully. Please fix in flight if you
don't mind.


> outgoing pass unfiltered repo to findcommonincoming (issue3776),
> 2013-01-28). If I'm reading code and history correctly, it should be
> safe to run _outgoing() on a filtered repo since c5456b64eb07
> (discovery: run discovery on filtered repository, 2015-01-07). By
> running _outgoing() on a filtered repo, we can also remove the
> workaround there for ignoring filtered revisions.
>
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -869,7 +869,7 @@
>          revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
>
>      other = peer(repo, opts, dest)
> -    outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other,
revs,
> +    outgoing = discovery.findcommonoutgoing(repo, other, revs,
>                                              force=opts.get('force'))
>      o = outgoing.missing
>      if not o:
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -120,10 +120,6 @@
>      secretlist = []
>      if excluded:
>          for n in excluded:
> -            if n not in repo:
> -                # discovery should not have included the filtered
revision,
> -                # we have to explicitly exclude it until discovery is
cleanup.
> -                continue
>              ctx = repo[n]
>              if ctx.phase() >= phases.secret and not ctx.extinct():
>                  secretlist.append(n)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Augie Fackler - May 5, 2017, 11:15 p.m.
On Fri, May 05, 2017 at 04:12:58PM -0700, Martin von Zweigbergk wrote:
> On May 5, 2017 15:45, "Augie Fackler" <raf@durin42.com> wrote:
>
> On Fri, May 05, 2017 at 10:10:17AM -0700, Martin von Zweigbergk via
> Mercurial-devel wrote:
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz@google.com>
> > # Date 1494004116 25200
> > #      Fri May 05 10:08:36 2017 -0700
> > # Node ID 992b37360cb54124e8718f70cfccc1ee3a3f8d44
> > # Parent  2cfdf5241096f6c0c2d45d32b2f1a41575835025
> > outgoing: run on filtered repo
> >
> > outgoing has been using a filtered repo since fe67107094fd (discovery:
>
> should this instance of filtered be unfiltered?
>
>
> Indeed it should. Thanks for reading carefully. Please fix in flight if you
> don't mind.

queued with that fixed, thanks

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -869,7 +869,7 @@ 
         revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
 
     other = peer(repo, opts, dest)
-    outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs,
+    outgoing = discovery.findcommonoutgoing(repo, other, revs,
                                             force=opts.get('force'))
     o = outgoing.missing
     if not o:
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -120,10 +120,6 @@ 
     secretlist = []
     if excluded:
         for n in excluded:
-            if n not in repo:
-                # discovery should not have included the filtered revision,
-                # we have to explicitly exclude it until discovery is cleanup.
-                continue
             ctx = repo[n]
             if ctx.phase() >= phases.secret and not ctx.extinct():
                 secretlist.append(n)