equal
deleted
inserted
replaced
157 bundlefile, linkmapper) |
157 bundlefile, linkmapper) |
158 |
158 |
159 class bundlerepository(localrepo.localrepository): |
159 class bundlerepository(localrepo.localrepository): |
160 def __init__(self, ui, path, bundlename): |
160 def __init__(self, ui, path, bundlename): |
161 localrepo.localrepository.__init__(self, ui, path) |
161 localrepo.localrepository.__init__(self, ui, path) |
|
162 |
|
163 self._url = 'bundle:' + bundlename |
|
164 if path: self._url += '+' + path |
|
165 |
162 self.tempfile = None |
166 self.tempfile = None |
163 self.bundlefile = open(bundlename, "rb") |
167 self.bundlefile = open(bundlename, "rb") |
164 header = self.bundlefile.read(6) |
168 header = self.bundlefile.read(6) |
165 if not header.startswith("HG"): |
169 if not header.startswith("HG"): |
166 raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename) |
170 raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename) |
206 break |
210 break |
207 self.bundlefilespos[f] = self.bundlefile.tell() |
211 self.bundlefilespos[f] = self.bundlefile.tell() |
208 for c in changegroup.chunkiter(self.bundlefile): |
212 for c in changegroup.chunkiter(self.bundlefile): |
209 pass |
213 pass |
210 |
214 |
|
215 def url(self): |
|
216 return self._url |
|
217 |
211 def dev(self): |
218 def dev(self): |
212 return -1 |
219 return -1 |
213 |
220 |
214 def file(self, f): |
221 def file(self, f): |
215 if f[0] == '/': |
222 if f[0] == '/': |