Mercurial > hg-stable
changeset 623:314867960a4a
Change remote repository to httprepository
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 05 Jul 2005 17:50:43 -0800 |
parents | e9fe5d5e67f7 |
children | 876333a295ff |
files | mercurial/hg.py |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hg.py Tue Jul 05 17:50:02 2005 -0800 +++ b/mercurial/hg.py Tue Jul 05 17:50:43 2005 -0800 @@ -1498,7 +1498,7 @@ self.ui.warn("%d integrity errors encountered!\n" % errors) return 1 -class remoterepository: +class httprepository: def __init__(self, ui, path): self.url = path self.ui = ui @@ -1593,12 +1593,12 @@ self.ui.note("%d bytes of data transfered\n" % bytes) def repository(ui, path=None, create=0): - if path and path[:7] == "http://": - return remoterepository(ui, path) - if path and path[:5] == "hg://": - return remoterepository(ui, path.replace("hg://", "http://")) - if path and path[:11] == "old-http://": - return localrepository(ui, path.replace("old-http://", "http://")) - else: - return localrepository(ui, path, create) + if path: + if path.startswith("http://"): + return httprepository(ui, path) + if path.startswith("hg://"): + return httprepository(ui, path.replace("hg://", "http://")) + if path.startswith("old-http://"): + return localrepository(ui, path.replace("old-http://", "http://")) + return localrepository(ui, path, create)