Bitbucket.org

Jesper Noehr jesper at noehr.org
Fri Aug 1 05:32:05 CDT 2008


On Aug 1, 2008, at 12:09 PM, Ondrej Certik wrote:
[...]
>> Before Bitbucket, I wanted to host hg repositories on my own website
>> (http://noehr.org/hg/), but I didn't want to run a standard hgweb  
>> instance
>> (also because it was a pain to set it up with my webhost.) Instead,  
>> I did
>> what I described above, and we are basically using the same flow on
>> Bitbucket. The source for my website *is* open source, so you can  
>> see a
>> working example of how it works:
>>
>> http://www.bitbucket.org/jespern/cx/src/6d8cb55ead16/apps/hgwebproxy/views.py
>
> When clicking on the "hgwebproxy" link in the page above, I got:
>
> "
> 404 - Not Found
>
> We're sorry, but we couldn't find the page you were looking for.
>
> You can perhaps find what you're looking for by doing a search in the
> list of public repositories.
>
> If you feel that this is an error on our part, please send us an email
> with details about the error and what you were doing when it occurred.
>
> -- The Bitbucket team
> "
>
> I think the link address is wrong.

It was, good catch. I've fixed it now, and it should work from now on.

>> One thing I should mention is that in the source above, we give the
>> hgwebdir() function a filename, but it's entirely possible to give  
>> it a
>> dictionary as well.
>
> I see thanks. Someone needs to wrap it and create a nice django app
> that just works.

On Bitbucket we have outsourced common hg operations into a mixin  
class, so you can do something like:

class Repository(models.Model, repo.RepoMixin):
	...

repo = Repository(...)
repo.get_files('tip')
repo.get_changeset('tip')

With the code I provided you with from 'cx', you should be able to  
whip up something like that in about an hour. Otherwise, it's possible  
that this will be one of the components that we might open source  
later (needs to be more abstract than it is now.)


Jesper


More information about the Mercurial mailing list