bundle: check changegroup version earlier
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 04 May 2017 21:46:02 +0200
changeset 32219 38d2f9e5df40
parent 32218 3f638e626f22
child 32220 e17b8466857e
bundle: check changegroup version earlier We can check if we know how to bundle this changegroup version before actually starting to generate the changegroup.
mercurial/commands.py
--- a/mercurial/commands.py	Thu May 04 21:44:36 2017 +0200
+++ b/mercurial/commands.py	Thu May 04 21:46:02 2017 +0200
@@ -1373,8 +1373,6 @@
         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'
@@ -1386,6 +1384,8 @@
         raise error.ProgrammingError(
             'bundle: unexpected changegroup version %s' % cgversion)
 
+    cg = changegroup.getchangegroup(repo, 'bundle', outgoing, version=cgversion)
+
     # TODO compression options should be derived from bundlespec parsing.
     # This is a temporary hack to allow adjusting bundle compression
     # level without a) formalizing the bundlespec changes to declare it