bundle: check lack of revs to bundle before generating the changegroup
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 04 May 2017 21:44:36 +0200
changeset 32218 3f638e626f22
parent 32217 affd753ddaf1
child 32219 38d2f9e5df40
bundle: check lack of revs to bundle before generating the changegroup We already have the information so we can check it earlier.
mercurial/commands.py
--- a/mercurial/commands.py	Sat May 06 23:00:57 2017 -0400
+++ b/mercurial/commands.py	Thu May 04 21:44:36 2017 +0200
@@ -1368,11 +1368,13 @@
                                                 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'