[PATCH 3 of 4 V2] serve: make the URL the same for `hg serve` and `hg serve -S`
Yuya Nishihara
yuya at tcha.org
Mon Feb 20 09:38:13 EST 2017
On Thu, 16 Feb 2017 16:41:10 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1486877030 18000
> # Sun Feb 12 00:23:50 2017 -0500
> # Node ID 38babd487181374325f3d27c5bc081dadf31b9b9
> # Parent 27a4bc77e8b8e50abc76c387f117082e5853c47e
> serve: make the URL the same for `hg serve` and `hg serve -S`
> elif not virtual:
> + if self._rootrepo:
> + # Redirect '/' to the main repo when -S is given.
> + path = '/' + self._rootrepo
> + if self.prefix:
> + path = '/' + self.prefix + path
> + req.headers.append(('Location', path))
> + html = '<html>Moved <a href="' + path + '">here</a>.</html>'
> + req.respond(HTTP_MOVED_PERMANENTLY, "text/html", body=html)
> + return []
Suppose "hg serve" is used for temporarily serving random repositories, 301
seems too strong.
More information about the Mercurial-devel
mailing list