Mercurial > public > mercurial-scm > hg-stable
diff mercurial/statichttprepo.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 | 345bac2bc4ec |
line wrap: on
line diff
--- a/mercurial/statichttprepo.py Sun Jul 30 22:52:34 2006 -0700 +++ b/mercurial/statichttprepo.py Mon Jul 31 07:11:12 2006 -0700 @@ -7,9 +7,10 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -from demandload import demandload +from demandload import * +from i18n import gettext as _ demandload(globals(), "changelog filelog httprangereader") -demandload(globals(), "localrepo manifest os urllib urllib2") +demandload(globals(), "localrepo manifest os urllib urllib2 util") class rangereader(httprangereader.httprangereader): def read(self, size=None): @@ -50,3 +51,14 @@ def local(self): return False + +def instance(ui, path, create): + if create: + raise util.Abort(_('cannot create new static-http repository')) + if path.startswith('old-http:'): + ui.warn(_("old-http:// syntax is deprecated, " + "please use static-http:// instead\n")) + path = path[4:] + else: + path = path[7:] + return statichttprepository(ui, path)