mercurial/changegroup.py
branchstable
changeset 27929 3b2ac2115464
parent 27928 c0f11347b107
child 27931 1289a122cf3f
--- a/mercurial/changegroup.py	Tue Jan 19 14:27:18 2016 -0800
+++ b/mercurial/changegroup.py	Tue Jan 19 15:32:32 2016 -0800
@@ -961,6 +961,15 @@
         versions.discard('03')
     return versions
 
+def safeversion(repo):
+    # Finds the smallest version that it's safe to assume clients of the repo
+    # will support.
+    versions = supportedversions(repo)
+    if 'generaldelta' in repo.requirements:
+        versions.discard('01')
+    assert versions
+    return min(versions)
+
 def getbundler(version, repo, bundlecaps=None):
     assert version in supportedversions(repo)
     return _packermap[version][0](repo, bundlecaps)