changeset 26506:edecf059fda6

shelve: move changegroup generation inside writebundle We will generate different changegroup if general delta is enabled so we gather this in the lower level function. There wasn't any good reason to have it in the main code anyway.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 01 Oct 2015 15:09:32 -0700
parents 6086ddc1fdc6
children ae29cffa05db
files hgext/shelve.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Tue Sep 29 17:14:30 2015 -0700
+++ b/hgext/shelve.py	Thu Oct 01 15:09:32 2015 -0700
@@ -105,7 +105,8 @@
     def bundlerepo(self):
         return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root,
                                            self.vfs.join(self.fname))
-    def writebundle(self, cg):
+    def writebundle(self, bases, node):
+        cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve')
         changegroup.writebundle(self.ui, cg, self.fname, 'HG10BZ', self.vfs)
 
 class shelvedstate(object):
@@ -291,8 +292,7 @@
             return 1
 
         bases = list(publicancestors(repo[node]))
-        cg = changegroup.changegroupsubset(repo, bases, [node], 'shelve')
-        shelvedfile(repo, name, 'hg').writebundle(cg)
+        shelvedfile(repo, name, 'hg').writebundle(bases, node)
         cmdutil.export(repo, [node],
                        fp=shelvedfile(repo, name, 'patch').opener('wb'),
                        opts=mdiff.diffopts(git=True))