mercurial/hg.py
changeset 176 1d8e9637a0a4
parent 171 75dddd697ed4
child 178 b3bf5a0edd69
child 178 b3bf5a0edd69
equal deleted inserted replaced
175:0eb6e2c9800d 176:1d8e9637a0a4
   810             
   810             
   811         return fl.add(text, transaction, link, my, other)
   811         return fl.add(text, transaction, link, my, other)
   812 
   812 
   813 class remoterepository:
   813 class remoterepository:
   814     def __init__(self, ui, path):
   814     def __init__(self, ui, path):
   815         self.url = path.replace("hg://", "http://", 1)
   815         self.url = path
   816         self.ui = ui
   816         self.ui = ui
   817 
   817 
   818     def do_cmd(self, cmd, **args):
   818     def do_cmd(self, cmd, **args):
   819         self.ui.debug("sending %s command\n" % cmd)
   819         self.ui.debug("sending %s command\n" % cmd)
   820         q = {"cmd": cmd}
   820         q = {"cmd": cmd}
   845                 yield zd.flush()
   845                 yield zd.flush()
   846                 break
   846                 break
   847             yield zd.decompress(d)
   847             yield zd.decompress(d)
   848 
   848 
   849 def repository(ui, path=None, create=0):
   849 def repository(ui, path=None, create=0):
       
   850     if path and path[:7] == "http://":
       
   851         return remoterepository(ui, path)
   850     if path and path[:5] == "hg://":
   852     if path and path[:5] == "hg://":
   851         return remoterepository(ui, path)
   853         return remoterepository(ui, path.replace("hg://", "http://"))
       
   854     if path and path[:11] == "old-http://":
       
   855         return localrepository(ui, path.replace("old-http://", "http://"))
   852     else:
   856     else:
   853         return localrepository(ui, path, create)
   857         return localrepository(ui, path, create)
   854 
   858 
   855 class ui:
   859 class ui:
   856     def __init__(self, verbose=False, debug=False, quiet=False,
   860     def __init__(self, verbose=False, debug=False, quiet=False,