diff mercurial/exchange.py @ 34142:709b44f38ab9

changegroup: avoid creating empty changegroup part Previously this check happened in the changegroup code itself. Since its refactor, this logic needs to move out to callers that care about it, such as this one. Otherwise we get empty bundle devel-warnings in certain extensions. Differential Revision: https://phab.mercurial-scm.org/D690
author Durham Goode <durham@fb.com>
date Tue, 12 Sep 2017 09:13:02 -0700
parents dbf598196f05
children 3a5d8e2996f8
line wrap: on
line diff
--- a/mercurial/exchange.py	Tue Sep 12 15:12:27 2017 -0700
+++ b/mercurial/exchange.py	Tue Sep 12 09:13:02 2017 -0700
@@ -1632,8 +1632,9 @@
                 raise ValueError(_('no common changegroup version'))
             version = max(cgversions)
         outgoing = _computeoutgoing(repo, heads, common)
-        cgstream = changegroup.makestream(repo, outgoing, version, source,
-                                          bundlecaps=bundlecaps)
+        if outgoing.missing:
+            cgstream = changegroup.makestream(repo, outgoing, version, source,
+                                              bundlecaps=bundlecaps)
 
     if cgstream:
         part = bundler.newpart('changegroup', data=cgstream)