Mercurial > hg
comparison mercurial/bundlerepo.py @ 2740:386f04d6ecb3
clean up hg.py: move repo constructor code into each repo module
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 31 Jul 2006 07:11:12 -0700 |
parents | 109a22f5434a |
children | b19360aa21e9 |
comparison
equal
deleted
inserted
replaced
2739:3248aa10b388 | 2740:386f04d6ecb3 |
---|---|
235 def __del__(self): | 235 def __del__(self): |
236 if not self.bundlefile.closed: | 236 if not self.bundlefile.closed: |
237 self.bundlefile.close() | 237 self.bundlefile.close() |
238 if self.tempfile is not None: | 238 if self.tempfile is not None: |
239 os.unlink(self.tempfile) | 239 os.unlink(self.tempfile) |
240 | |
241 def instance(ui, path, create): | |
242 if create: | |
243 raise util.Abort(_('cannot create new bundle repository')) | |
244 path = util.drop_scheme('file', path) | |
245 if path.startswith('bundle:'): | |
246 path = util.drop_scheme('bundle', path) | |
247 s = path.split("+", 1) | |
248 if len(s) == 1: | |
249 repopath, bundlename = "", s[0] | |
250 else: | |
251 repopath, bundlename = s | |
252 else: | |
253 repopath, bundlename = '', path | |
254 return bundlerepository(ui, repopath, bundlename) |