diff mercurial/localrepo.py @ 12337:6a6149487817

bundle: encapsulate all bundle streams in unbundle class
author Matt Mackall <mpm@selenic.com>
date Mon, 20 Sep 2010 14:32:21 -0500
parents e21fe9c5fb25
children 01b6f058021b
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Sep 19 13:12:45 2010 -0500
+++ b/mercurial/localrepo.py	Mon Sep 20 14:32:21 2010 -0500
@@ -1543,7 +1543,7 @@
             if msng_cl_lst:
                 self.hook('outgoing', node=hex(msng_cl_lst[0]), source=source)
 
-        return util.chunkbuffer(gengroup())
+        return changegroup.unbundle10(util.chunkbuffer(gengroup()), 'UN')
 
     def changegroup(self, basenodes, source):
         # to avoid a race we use changegroupsubset() (issue1320)
@@ -1621,7 +1621,7 @@
             if nodes:
                 self.hook('outgoing', node=hex(nodes[0]), source=source)
 
-        return util.chunkbuffer(gengroup())
+        return changegroup.unbundle10(util.chunkbuffer(gengroup()), 'UN')
 
     def addchangegroup(self, source, srctype, url, emptyok=False, lock=None):
         """Add the changegroup returned by source.read() to this repo.
@@ -1644,9 +1644,6 @@
         if not source:
             return 0
 
-        if not hasattr(source, 'chunk'):
-            source = changegroup.unbundle10(source, 'UN')
-
         self.hook('prechangegroup', throw=True, source=srctype, url=url)
 
         changesets = files = revisions = 0