--- a/mercurial/bundlerepo.py Sun Jul 30 22:52:34 2006 -0700
+++ b/mercurial/bundlerepo.py Mon Jul 31 07:11:12 2006 -0700
@@ -237,3 +237,18 @@
self.bundlefile.close()
if self.tempfile is not None:
os.unlink(self.tempfile)
+
+def instance(ui, path, create):
+ if create:
+ raise util.Abort(_('cannot create new bundle repository'))
+ path = util.drop_scheme('file', path)
+ if path.startswith('bundle:'):
+ path = util.drop_scheme('bundle', path)
+ s = path.split("+", 1)
+ if len(s) == 1:
+ repopath, bundlename = "", s[0]
+ else:
+ repopath, bundlename = s
+ else:
+ repopath, bundlename = '', path
+ return bundlerepository(ui, repopath, bundlename)