From patchwork Fri May 5 06:26:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6,of,7] bundle: avoid reset of the 'outgoing' variable From: Pierre-Yves David X-Patchwork-Id: 20456 Message-Id: <5ff659101e17aa1e2b63.1493965616@nodosa.octopoid.net> To: mercurial-devel@mercurial-scm.org Date: Fri, 05 May 2017 08:26:56 +0200 # HG changeset patch # User Pierre-Yves David # Date 1493894847 -7200 # Thu May 04 12:47:27 2017 +0200 # Node ID 5ff659101e17aa1e2b63ddd0efd5e2b0bcb7b226 # Parent 2f51cfeac5bcf8ee266a6fada56517d5d44d9b6b # EXP-Topic bundle.cleanup # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ # hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 5ff659101e17 bundle: avoid reset of the 'outgoing' variable We have a cleaner way to achieve the same effect. Not resetting the variable will help us to simplify the code. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1359,7 +1359,6 @@ def bundle(ui, repo, fname, dest=None, * outgoing = discovery.outgoing(repo, common, heads) cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion) - outgoing = None else: dest = ui.expandpath(dest or 'default-push', dest or 'default') dest, branches = hg.parseurl(dest, opts.get('branch')) @@ -1373,7 +1372,7 @@ def bundle(ui, repo, fname, dest=None, * cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion) if not cg: - scmutil.nochangesfound(ui, repo, outgoing and outgoing.excluded) + scmutil.nochangesfound(ui, repo, not base and outgoing.excluded) return 1 if cgversion == '01': #bundle1