exchange: deal with empty obscommon stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 11 Mar 2020 18:50:39 +0100
branchstable
changeset 5205 240efc3ab4dd
parent 5202 c0b8804066dc
child 5206 dc3571a37b56
exchange: deal with empty obscommon The case can happen, we better support it.
CHANGELOG
hgext3rd/evolve/obsexchange.py
--- a/CHANGELOG	Fri Mar 06 02:42:03 2020 +0100
+++ b/CHANGELOG	Wed Mar 11 18:50:39 2020 +0100
@@ -5,6 +5,8 @@
 -------------------
 
   * obsexchange: avoid sending too large request to http server
+  * obsdiscovery: server no longer aborts with a 500 error if client sends a
+    request without obscommon
 
 9.3.0 -- 2020-03-04
 -------------------
--- a/hgext3rd/evolve/obsexchange.py	Fri Mar 06 02:42:03 2020 +0100
+++ b/hgext3rd/evolve/obsexchange.py	Wed Mar 11 18:50:39 2020 +0100
@@ -106,8 +106,10 @@
             if heads is None:
                 heads = repo.heads()
             obscommon = kwargs.get('evo_obscommon', ())
-            assert obscommon
-            obsset = repo.unfiltered().set(b'::%ln - ::%ln', heads, obscommon)
+            if obscommon:
+                obsset = repo.unfiltered().set(b'::%ln - ::%ln', heads, obscommon)
+            else:
+                obsset = repo.unfiltered().set(b'::%ln', heads)
             subset = [c.node() for c in obsset]
         else:
             common = kwargs.get('common')