regproj: enforce fork origin path
commit5900815c2b6504a5dd642082ed01204eaba5cd42
authorZachary T Welch <zw@superlucidity.net>
Sun, 25 Oct 2009 16:35:25 +0000 (25 09:35 -0700)
committerZachary T Welch <zw@superlucidity.net>
Wed, 28 Oct 2009 03:08:39 +0000 (27 20:08 -0700)
tree0271973a407b18904296070a4b66b34a75994882
parentfb7ddd2dcf77551b58832f076e2cead857175668
regproj: enforce fork origin path

Adds initial support for 'origin' parameter, deriving a value from the
'name' parameter passed by project 'fork' links (if not passed
directly).

If origin is defined, then the project mode radio buttens are hidden,
and the value is forced to push mode, as it does not make any sense to
allowing forking read-only mirrors for local upsream repositorys.

This simple change ensures stupid users cannot accidentally change the
origin after clicking on a 'fork' link.  For context, I can call users
stupid here, because I was the idiot that discovered this missing check.
I meant to create a fork called 'foo/bar' and got one called 'foo-bar'.
The change prevents other users from making this mistake in the future.

The origin should display in bold text immediately preceding the 'name'
text input box, without a leading '/' to help remind the user of the
new fork's relative path.  When not provided, the '/' shows the fact
that the repositories create a new virtual root for future forks.
cgi/regproj.cgi