Mercurial > hg
comparison hgext/shelve.py @ 23895:cda18ded2c48
changegroup.writebundle: provide ui
The next diff will add support for writing bundle2 files to writebundle, but
the bundle2 generator wants access to a ui object. This changes the signature
and callsites to pass one in.
author | Eric Sumner <ericsumner@fb.com> |
---|---|
date | Thu, 15 Jan 2015 14:39:41 -0800 |
parents | 7cc77030c557 |
children | 325f03de849d |
comparison
equal
deleted
inserted
replaced
23894:f388ceae2250 | 23895:cda18ded2c48 |
---|---|
41 the vfs layer""" | 41 the vfs layer""" |
42 def __init__(self, repo, name, filetype=None): | 42 def __init__(self, repo, name, filetype=None): |
43 self.repo = repo | 43 self.repo = repo |
44 self.name = name | 44 self.name = name |
45 self.vfs = scmutil.vfs(repo.join('shelved')) | 45 self.vfs = scmutil.vfs(repo.join('shelved')) |
46 self.ui = self.repo.ui | |
46 if filetype: | 47 if filetype: |
47 self.fname = name + '.' + filetype | 48 self.fname = name + '.' + filetype |
48 else: | 49 else: |
49 self.fname = name | 50 self.fname = name |
50 | 51 |
80 | 81 |
81 def bundlerepo(self): | 82 def bundlerepo(self): |
82 return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root, | 83 return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root, |
83 self.vfs.join(self.fname)) | 84 self.vfs.join(self.fname)) |
84 def writebundle(self, cg): | 85 def writebundle(self, cg): |
85 changegroup.writebundle(cg, self.fname, 'HG10UN', self.vfs) | 86 changegroup.writebundle(self.ui, cg, self.fname, 'HG10UN', self.vfs) |
86 | 87 |
87 class shelvedstate(object): | 88 class shelvedstate(object): |
88 """Handle persistence during unshelving operations. | 89 """Handle persistence during unshelving operations. |
89 | 90 |
90 Handles saving and restoring a shelved state. Ensures that different | 91 Handles saving and restoring a shelved state. Ensures that different |