changeset 32170:b9d97bf96f61

bundle: factor the 'getchangegroup' out The call in the two branches is identical, so we can just issue it outside of the conditional.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 04 May 2017 12:48:45 +0200
parents aeb060dd7ac9
children fb9b6bfb54b5
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu May 04 12:47:27 2017 +0200
+++ b/mercurial/commands.py	Thu May 04 12:48:45 2017 +0200
@@ -1357,8 +1357,6 @@
         common = [repo.lookup(rev) for rev in base]
         heads = revs and map(repo.lookup, revs) or None
         outgoing = discovery.outgoing(repo, common, heads)
-        cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
-                                        version=cgversion)
     else:
         dest = ui.expandpath(dest or 'default-push', dest or 'default')
         dest, branches = hg.parseurl(dest, opts.get('branch'))
@@ -1369,8 +1367,7 @@
                                                 onlyheads=heads,
                                                 force=opts.get('force'),
                                                 portable=True)
-        cg = changegroup.getchangegroup(repo, 'bundle', outgoing,
-                                             version=cgversion)
+    cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
     if not cg:
         scmutil.nochangesfound(ui, repo, not base and outgoing.excluded)
         return 1