Mercurial > hg
comparison hgext/shelve.py @ 26507:ae29cffa05db
shelve: bundle using bundle2 if repository is general delta (issue4862)
This will prevent expensive delta computation on bundling and is similar to what we do
for strip backup.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 01 Oct 2015 15:08:00 -0700 |
parents | edecf059fda6 |
children | 46dec89fe888 |
comparison
equal
deleted
inserted
replaced
26506:edecf059fda6 | 26507:ae29cffa05db |
---|---|
104 | 104 |
105 def bundlerepo(self): | 105 def bundlerepo(self): |
106 return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root, | 106 return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root, |
107 self.vfs.join(self.fname)) | 107 self.vfs.join(self.fname)) |
108 def writebundle(self, bases, node): | 108 def writebundle(self, bases, node): |
109 cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve') | 109 btype = 'HG10BZ' |
110 changegroup.writebundle(self.ui, cg, self.fname, 'HG10BZ', self.vfs) | 110 cgversion = '01' |
111 compression = None | |
112 if 'generaldelta' in self.repo.requirements: | |
113 btype = 'HG20' | |
114 cgversion = '02' | |
115 compression = 'BZ' | |
116 | |
117 cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve', | |
118 version=cgversion) | |
119 changegroup.writebundle(self.ui, cg, self.fname, btype, self.vfs, | |
120 compression=compression) | |
111 | 121 |
112 class shelvedstate(object): | 122 class shelvedstate(object): |
113 """Handle persistence during unshelving operations. | 123 """Handle persistence during unshelving operations. |
114 | 124 |
115 Handles saving and restoring a shelved state. Ensures that different | 125 Handles saving and restoring a shelved state. Ensures that different |