Help with Mercurial and Post-Commit reviews

56 views
Skip to first unread message

Chris Hightower

unread,
May 16, 2022, 4:49:12 PM5/16/22
to Review Board Community
Hello all!

We're trying to swtich to ReviewBoard from JetBrains Upsource, and we're attempting to do some post-commit reviews.

The error we're seeing from rbt post happens during the 'validating commits' stage, and it fails with Error Validating Diff

You can replicate this with a mercurial repository via the following steps:

Setup:
  • Create a new branch
  • Change any file in the repository, and commit
  • Add 2 new files (i.e.  myfile1 and myfile2), hg add and hg commit
  • Change the first new file and hg commit
  • Change the 2nd new file and hg commit
  • hg push --new-branch

Attempt to create a new review request with rbt post (the revision IDs are: parent of first commit on this branch, and most recent commit on this branch):
rbt post --branch `hg branch` -p --target-groups my-review-group --summary "testing" --description "testing" --tracking-branch default f638ab41e9fc 438b21c0ba39

We see the following output:
Validating commits... ███████████████████████████████████████              [3/4]
ERROR: Error validating diff

rb_test/myfile2.txt: The file was not found in the repository. (HTTP 400, API Error 207)


What are we doing wrong? 

Our standard workflow is to create a new branch (for bugfix or new feature), make code changes/additions/etc with commits along the way, push the branch and then request a Review.  Should we change our process? If so, what is the best-practice for ReviewBoard?


Any help or insight you can provide would be greatly appreciated.

Mark Falconer

unread,
May 16, 2022, 5:15:41 PM5/16/22
to revie...@googlegroups.com, chris.h...@gmail.com
Hi Chris,

to quote Christian Hammond from a previous email

We've hit a few issues like that with Mercurial, and it partly has to do with how Mercurial represents file and revisions in their diffs. The standard Mercurial diff format has a lot of issues that make it difficult for us to extract meaningful revision history when generating a diff, particularly when dealing with ranges, and while the Git-like format is a bit better at this, it's not quite right either.
We've done some work in the past couple releases of Review Board and RBTools to try to address this, at least for some cases. Can you verify whether these scenarios are still happening for you on Review Board 4.0.6 and RBTools 3?
If you're still able to reproduce these, we'll need RBTools debug logs, the generated parent and main diffs, and some representation of the Mercurial tree showing the revisions and relations at the point when those logs were generated.
Our long-term goal is to bypass the Mercurial diff formats and go with our DiffX format instead, which will give us greater control over how we're able to represent revision information for each file.

As a workaround the multi commit feature can be turned off using rbt post:
-S, --squash-history

Force the review request to be created without history, even if the server supports it. Uploaded diffs will be squashed together.

The default can be set in SQUASH_HISTORY in .reviewboardrc.




 
Mark Falconer 
Software Development Team Lead 

 

 
Office : +44 (0) 1224347070
Mobile: +44 (0) 7734 578 948
Email: mark.f...@hrhgeology.com
Web: www.hrhgeology.com
 
  
  
  
HRH Limited is a company registered in Scotland. Registration number: SC117311. Registered office: 100 Union Street, Aberdeen, AB10 1QR, UK

​Business Address: HRH Limited, 19 Silverburn Place, Bridge of Don, Aberdeen, AB23 8EG, UK

HRH Ltd accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing.
​Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
 
  

From: revie...@googlegroups.com <revie...@googlegroups.com> on behalf of Chris Hightower <chris.h...@gmail.com>
Sent: 16 May 2022 21:38
To: Review Board Community <revie...@googlegroups.com>
Subject: Help with Mercurial and Post-Commit reviews
 
--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/4ddd2df2-6227-44b2-abd4-0278e7c661d4n%40googlegroups.com.

Chris Hightower

unread,
May 16, 2022, 6:10:31 PM5/16/22
to Review Board Community
--squash-history  will work great for my team!   Thanks Mark!

Christian Hammond

unread,
May 16, 2022, 6:56:04 PM5/16/22
to revie...@googlegroups.com
Thanks for the help there, Mark! And thanks for confirming, Chris!

We definitely want to beef up the Mercurial support. It's one of, well, a lot of competing priorities, but we're slowly improving it and trying to get things in place to not be as reliant on what Mercurial diffs want to give us.

Christian



--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board
Reply all
Reply to author
Forward
0 new messages