Sorry for the late reply here. Holidays and all..

On Fri, Dec 17, 2010 at 7:06 AM, Oz Linden (Scott Lawrence)
<o...@lindenlab.com> wrote:
> Our project uses Mercurial, and so there are a couple of things I'd like to
> be able to have contributors post patches generated with 'hg export' (either
> by uploading or even better with post-review) and have rb extract the
> metadata (description at least) from the export output.

We have some open bugs like this for Git, where the metadata in the
diff (this is in the diff, right?) isn't preserved. Our diff parsers
need some tweaks to not strip out too much. Shouldn't be a lot of
work, but definitely needs to be done.

> Even more important, if they post using export, I'd like to get that
> meta-data back when I download the patch; at present I seem to only get the
> actual diff, which means I can't use 'hg import' to pull in the change.

If we fix our parsers, the stored diffs will retain this data.

> I'm also having a bit of trouble figuring out what the smoothest way to use
> post-review is... the repository configured in the reviewboard server points
> to our canonical project repo on bitbucket:
>   https://bitbucket.org/lindenlab/viewer-development/
> but the way that people work is to clone that to other repos either locally
> or on bitbucket, so that url is rarely the one in the hgrc 'default' or
> 'default-push' parameter.   Even when it is, post-review fails to match it
> when the trailing slash is missing locally (common).   I think what I'd
> really like is that post-review take a repository name argument somewhere,
> and get the url from the web api...

It's rather important that post-review and Review Board are on the
same page regarding commits. It's fine to have a clone and then
generate a diff using that, so long as either the base of that diff
points to a known commit on the central repository or the base of the
parent diff points to a known commit.

I'm not a Mercurial expert, so I don't have a lot of experience in
using it with Review Board. On Git, we recommend that "origin" (the
default remote name pointing to a central server) points to the
central repository, and then post-review will use that when
determining the diffs. Maybe something similar can be enforced for
your Mercurial setup?

There's a --repository-url parameter for post-review that can specify
which repository you want to match on the server. It doesn't look like
the Mercurial support in post-review handles this parameter, but it
wouldn't take much to patch that if you wanted to play around with it
and contribute a fix.

The trailing slash thing is a more global problem, outside of
Mercurial. Not just with slashes, but variations on a URL, such as
http/https variations, domain aliases, etc.

I have a couple ideas for fixing this, but haven't really decided
which way to go (maybe all).

One way is to allow a list of aliases to be configured for a
repository, and then match each alias. We'd need to figure out how to
do that query in an optimal way. If the aliases were stored in a
comma-separated list in the database, we'd have to use "LIKE
%,alias,%" or something, which skips the indexes. So maybe
pre-fetching and caching the list from the database, but that
increases memory usage and may not scale.

Another option is to generate some possible variations, such as
different prefixes, trailing slash, etc., when querying the database.
This would increase the lookup as well, but less so. In most cases,
it'd probably be doing extra work when it doesn't need to, but could
solve this problem in the general cases.


Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com

Want to help the Review Board project? Donate today at 
Happy user? Let us know at http://www.reviewboard.org/users/
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to