Hi Tim, Cool to see this arrive! Sadly, I'm not sure it can land yet, because of the new sourcecode branch. Let's talk to a LOSA about that. > === modified file 'lib/lp/code/stories/codeimport/xx-create-codeimport.txt' I think it would be good to create a Hg import in this test. > --- lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2010-01-11 22:40:42 +0000 > +++ lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2010-01-12 22:39:29 +0000 > @@ -32,6 +32,7 @@ > > >>> print_radio_button_field(browser.contents, "rcs_type") > ( ) Git > + ( ) Mercurial > (*) Subversion > ( ) CVS > > @@ -66,21 +67,14 @@ > Requesting a Git import > ======================= > > -The default foreign VCS type is Subversion. > - > - >>> browser.open("http://code.launchpad.dev/+code-imports/+new") > - >>> print_radio_button_field(browser.contents, "rcs_type") > - ( ) Git > - (*) Subversion > - ( ) CVS > - > The user is required to enter a project that the import is for, > a name for the import branch, and a subversion branch location. > > + >>> browser.open("http://code.launchpad.dev/+code-imports/+new") > >>> browser.getControl('Project').value = "firefox" > >>> browser.getControl('Branch Name').value = "git-import" > >>> browser.getControl('Git').click() > - >>> browser.getControl('Repo URL').value = ( > + >>> browser.getControl('Repo URL', index=0).value = ( > ... "git://example.com/firefox.git") > >>> browser.getControl('Request Import').click() > > === modified file 'lib/lp/code/templates/branch-import-details.pt' > --- lib/lp/code/templates/branch-import-details.pt 2010-01-11 21:21:00 +0000 > +++ lib/lp/code/templates/branch-import-details.pt 2010-01-12 22:39:29 +0000 > @@ -45,6 +45,12 @@ >

> > > + > +

This branch is an import of the Mercurial repo at I think I overheard some conversation about this, but it's not really an import of the repo, but of the tip branch or whatever it's called for Mercurial. Should we try to explain this? > + . > +

> +
> + > >

> This branch is an import of the > === modified file 'lib/lp/codehosting/codeimport/tests/servers.py' > --- lib/lp/codehosting/codeimport/tests/servers.py 2009-12-04 04:08:12 +0000 > +++ lib/lp/codehosting/codeimport/tests/servers.py 2010-01-12 22:39:29 +0000 > @@ -8,6 +8,7 @@ > __all__ = [ > 'CVSServer', > 'GitServer', > + 'MercurialServer', > 'SubversionServer', > ] > > @@ -210,3 +211,23 @@ > builder.finish() > finally: > os.chdir(wd) > + > + > +class MercurialServer(Server): > + > + def __init__(self, repo_url): > + super(MercurialServer, self).__init__() > + self.repo_url = repo_url > + > + def makeRepo(self, tree_contents): > + from mercurial.ui import ui > + from mercurial.localrepo import localrepository > + repo = localrepository(ui(), self.repo_url, create=1) > + for filename, contents in tree_contents: > + f = open(os.path.join(self.repo_url, filename), 'w') > + try: > + f.write(contents) > + finally: > + f.close() > + repo.add([filename]) > + repo.commit(text='', user='jane Foo