diff mercurial/commands.py @ 21063:7ca4f2049d3b

bundle2: move `readbundle` into the `exchange` module The `readbundle` function is going to understand the bundle2 header. We move the function to a more suitable place before making any other changes.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 14 Apr 2014 15:33:50 -0400
parents 1004d3cd65fd
children 4d9d490d7bbe
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Apr 14 14:46:32 2014 -0400
+++ b/mercurial/commands.py	Mon Apr 14 15:33:50 2014 -0400
@@ -20,7 +20,7 @@
 import dagparser, context, simplemerge, graphmod
 import random
 import setdiscovery, treediscovery, dagutil, pvec, localrepo
-import phases, obsolete
+import phases, obsolete, exchange
 
 table = {}
 
@@ -1736,7 +1736,7 @@
     """lists the contents of a bundle"""
     f = hg.openpath(ui, bundlepath)
     try:
-        gen = changegroup.readbundle(f, bundlepath)
+        gen = exchange.readbundle(f, bundlepath)
         if all:
             ui.write(("format: id, p1, p2, cset, delta base, len(delta)\n"))
 
@@ -5807,7 +5807,7 @@
     try:
         for fname in fnames:
             f = hg.openpath(ui, fname)
-            gen = changegroup.readbundle(f, fname)
+            gen = exchange.readbundle(f, fname)
             modheads = changegroup.addchangegroup(repo, gen, 'unbundle',
                                                   'bundle:' + fname)
     finally: