bundle: avoid reset of the 'outgoing' variable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 04 May 2017 12:47:27 +0200
changeset 32169 aeb060dd7ac9
parent 32168 4e6aab69a98b
child 32170 b9d97bf96f61
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.
mercurial/commands.py
--- a/mercurial/commands.py	Thu May 04 12:43:41 2017 +0200
+++ b/mercurial/commands.py	Thu May 04 12:47:27 2017 +0200
@@ -1359,7 +1359,6 @@
         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 @@
         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