Mercurial > hg
comparison hgext/shelve.py @ 20983:2778616de7ce
shelve: add "writebundle()" to invoke "writebundle()" with relative path and vfs
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 09 Mar 2014 01:03:28 +0900 |
parents | 1df99f1ea28d |
children | 7ca4f2049d3b |
comparison
equal
deleted
inserted
replaced
20982:1df99f1ea28d | 20983:2778616de7ce |
---|---|
74 gen = changegroup.readbundle(fp, self.fname, self.vfs) | 74 gen = changegroup.readbundle(fp, self.fname, self.vfs) |
75 changegroup.addchangegroup(self.repo, gen, 'unshelve', | 75 changegroup.addchangegroup(self.repo, gen, 'unshelve', |
76 'bundle:' + self.vfs.join(self.fname)) | 76 'bundle:' + self.vfs.join(self.fname)) |
77 finally: | 77 finally: |
78 fp.close() | 78 fp.close() |
79 | |
80 def writebundle(self, cg): | |
81 changegroup.writebundle(cg, self.fname, 'HG10UN', self.vfs) | |
79 | 82 |
80 class shelvedstate(object): | 83 class shelvedstate(object): |
81 """Handle persistence during unshelving operations. | 84 """Handle persistence during unshelving operations. |
82 | 85 |
83 Handles saving and restoring a shelved state. Ensures that different | 86 Handles saving and restoring a shelved state. Ensures that different |
235 fp = shelvedfile(repo, name, 'files').opener('wb') | 238 fp = shelvedfile(repo, name, 'files').opener('wb') |
236 fp.write('\0'.join(shelvedfiles)) | 239 fp.write('\0'.join(shelvedfiles)) |
237 | 240 |
238 bases = list(publicancestors(repo[node])) | 241 bases = list(publicancestors(repo[node])) |
239 cg = changegroup.changegroupsubset(repo, bases, [node], 'shelve') | 242 cg = changegroup.changegroupsubset(repo, bases, [node], 'shelve') |
240 changegroup.writebundle(cg, shelvedfile(repo, name, 'hg').filename(), | 243 shelvedfile(repo, name, 'hg').writebundle(cg) |
241 'HG10UN') | |
242 cmdutil.export(repo, [node], | 244 cmdutil.export(repo, [node], |
243 fp=shelvedfile(repo, name, 'patch').opener('wb'), | 245 fp=shelvedfile(repo, name, 'patch').opener('wb'), |
244 opts=mdiff.diffopts(git=True)) | 246 opts=mdiff.diffopts(git=True)) |
245 | 247 |
246 | 248 |