narrow: remove unrequired compat code for old versions of hg
authorPulkit Goyal <7895pulkit@gmail.com>
Tue, 21 May 2019 04:49:18 +0530
changeset 42387 92f584065b4f
parent 42386 a09829e14fc0
child 42388 21e77ede77ab
narrow: remove unrequired compat code for old versions of hg As the comment says, that if is only required for servers having hg version 3.1 and 3.2. Any client connecting having hg 3.1 or 3.2 locally and trying to use narrow should already be broken taking in account the changes which have been done since narrow moved to core. Differential Revision: https://phab.mercurial-scm.org/D6434
hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py	Thu May 23 19:05:39 2019 +0200
+++ b/hgext/narrow/narrowbundle2.py	Tue May 21 04:49:18 2019 +0530
@@ -51,15 +51,11 @@
     assert repo.ui.configbool('experimental', 'narrowservebrokenellipses')
 
     cgversions = b2caps.get('changegroup')
-    if cgversions:  # 3.1 and 3.2 ship with an empty value
-        cgversions = [v for v in cgversions
-                      if v in changegroup.supportedoutgoingversions(repo)]
-        if not cgversions:
-            raise ValueError(_('no common changegroup version'))
-        version = max(cgversions)
-    else:
-        raise ValueError(_("server does not advertise changegroup version,"
-                           " can't negotiate support for ellipsis nodes"))
+    cgversions = [v for v in cgversions
+                  if v in changegroup.supportedoutgoingversions(repo)]
+    if not cgversions:
+        raise ValueError(_('no common changegroup version'))
+    version = max(cgversions)
 
     include = sorted(filter(bool, kwargs.get(r'includepats', [])))
     exclude = sorted(filter(bool, kwargs.get(r'excludepats', [])))