Patchwork [1,of,6] bundle: check lack of revs to bundle before generating the changegroup

login
register
mail settings
Submitter Pierre-Yves David
Date May 6, 2017, 8:04 a.m.
Message ID <f2da8236b1566e14cce6.1494057895@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20479/
State Accepted
Headers show

Comments

Pierre-Yves David - May 6, 2017, 8:04 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1493927076 -7200
#      Thu May 04 21:44:36 2017 +0200
# Node ID f2da8236b1566e14cce6e83169000b9376429433
# Parent  8f1a2b848b52ea7bf3fe2404e3b62924c7aae93f
# 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 f2da8236b156
bundle: check lack of revs to bundle before generating the changegroup

We already have the information so we can check it earlier.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1367,11 +1367,13 @@  def bundle(ui, repo, fname, dest=None, *
                                                 onlyheads=heads,
                                                 force=opts.get('force'),
                                                 portable=True)
-    cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
-    if not cg:
+
+    if not outgoing.missing:
         scmutil.nochangesfound(ui, repo, not base and outgoing.excluded)
         return 1
 
+    cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
+
     if cgversion == '01': #bundle1
         if bcompression is None:
             bcompression = 'UN'