Comment 6 for bug 115965

Revision history for this message
Andrew Bennetts (spiv) wrote :

I think David is objecting to the idea that the lpnet servers should access arbitrary URLs in response to form submissions.

The problem is URLs like "http://example.com/src-repo/my-project/trunk". WIthout accessing the URL or more information from the user, it's ambiguous whether the URL is a Bazaar branch or an SVN branch.

(URLs of the form "svn://..." aren't a problem for this idea, though.)

I do see David's point; we already have systems intended to go hit foreign hosts to mirror/import branches, and they have appropriate reverse DNS so that we show up sensibly in log files, the sysadmins have set the firewalls appropriately, etc.

But if we could accomodate this somehow I think the user experience would be much better. All we'd need to do is a HEAD request on URL + '.bzr/format'. If it exists, it's Bazaar, no more user input needed. If it isn't, prompt the user for more details about SVN import.

We don't have to have the lpnet servers do the actual probing. They could poke another internal system to do it for them, which would deal with the reverse DNS and firewall issues (at the cost of the extra complexity of a new moving part). There's also the question of what to do about unreachable hosts and other timeouts; probably a page saying "sorry we couldn't autodetect, please choose the source control system manually: (*) Bazaar, ( ) Subversion, ..." (we're effectively making them choose manually already after all). Or refuse the registration, because it's probably a mistyped URL, and we can't do anything with it anyway.

It's tempting to guess purely on the string of the URL itself; if it contains the regex "\<svn\>" it's probably an SVN branch, and if not probably not, but we'd need some easy way to override the guess because that won't be 100% reliable. It would have caught all of the examples in comment #2 though. Perhaps a "good enough" solution is to just warn if a Bazaar URL contains "\<svn\>"? Not as elegant for the user as the DWIM of actually probing the URL's location, but perhaps it'd be good enough to deal with most cases?