Postreview doesn't work

Dec 15, 2010 at 7:52 PM

When i try to make a code review with the last version of the postreview extension. I have the following errors :
I'm on a Windows 7 64bits

Any idea ?

hg postreview -l
searching for changes
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
** Mercurial Distributed SCM (version 1.7.2)
** Extensions loaded: fixfrozenexts, reviewboard
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 36, in dispatch
  File "mercurial\dispatch.pyo", line 58, in _runcatch
  File "mercurial\dispatch.pyo", line 590, in _dispatch
  File "mercurial\dispatch.pyo", line 401, in runcommand
  File "mercurial\dispatch.pyo", line 641, in _runcommand
  File "mercurial\dispatch.pyo", line 595, in checkargs
  File "mercurial\dispatch.pyo", line 588, in <lambda>
  File "mercurial\util.pyo", line 427, in check
  File "...\mercurial-reviewboard\__init__.py", line 117, in postrev
iew
    diff = getdiff(ui, repo, c, parent)
  File "...\mercurial-reviewboard\__init__.py", line 67, in getdiff
    for chunk in patch.diff(repo, parent.node(), r.node()):
AttributeError: 'NoneType' object has no attribute 'node'

Dec 15, 2010 at 9:26 PM

I've never gotten the -l flag to work either. This is what I use:

   hg postreview

It should prompt for a password and then post your review. Login to reviewboard and look it over. Don't forget to Publish your review so others can see it.

If you make changes to your review, do this:

  hg postreview -e NNN --parent PARENTREV

where NNN is your review ID number and PARENTREV is the changeset id of the one PRIOR to your initial commit. The thing is that PARENTREV must be a changeset that is in the official NuGet repository. All your diffs will be based off this changeset. 

It took me a little bit to figure it out. I kept using the revision of my previous commit, but reviewboard would complain that it couldn't find that changeset. That's because my changeset hadn't been pulled into the main repository yet! Doh!

Again, don't forget to publish! You can add -p to automatically publish.

I'm actually using Mercurial Queues for all my changes. When I'm working on a new patch, I enter:

  hg qnew issue123

As I work on my patch, I simply use:

  hg qrefresh -e

This updates the patch and (the -e) allows me to edit the commit message. I can also checkpoint my work by committing changes to the "patch" repository, which is basically a nested repository inside your current repo. Checkpointing is simply:

  hg commit -m "Update foo bar" --mq     <- the mq flag means commit to patch queue

When I need to update my review, I simply use:

  hg postreview -e NNN --parent qparent

Where "qparent" is a bookmark that MQ adds pointing to the parent revision. I can submit multiple reviews and when everything looks good, I simply use:

  hg qfinish -a

This will commit the patch to my repo as a SINGLE changeset that I then push to my fork and issue a pull request. This way the main repo doesn't get cluttered up with 2-3 changesets for a single feature/bugfix. 

Hope this makes sense, Anyway, I should write a blog post about it.

 

Dec 15, 2010 at 9:31 PM

I set up review-board on my home machine last night and I've got the exact same error as Malain's. It works on my work machine, which I set up a long time ago. So I suspect there is some bug with the current review-board repository.

Developer
Dec 15, 2010 at 11:02 PM

Worst cast scenario you can upload a patch file manually. 

What I would do is create a clean clone of nuget, make a trivial change and try hg postreview -l and see if that works.