Patchwork [6,of,7] bundle: avoid reset of the 'outgoing' variable

login
register
mail settings
Submitter Pierre-Yves David
Date May 5, 2017, 6:26 a.m.
Message ID <5ff659101e17aa1e2b63.1493965616@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20456/
State Accepted
Headers show

Comments

Pierre-Yves David - May 5, 2017, 6:26 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# 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.

Patch

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