3890: "Didn't apply patch cleanly" when using rbt post --parent in mercurial

ronal******@visierc******* (Google Code) (Is this you? Claim this profile.)
What version are you running?
site 2.0.15
rbt 0.7.4

What's the URL of the page containing the problem?

What steps will reproduce the problem?
1. given a mercurial repository where tip is hash AAAAA
2. make two commits locally with hash BBBBB, and CCCCC
3. rbt post --parent AAAAA
4. open in web ui and look at diff

What is the expected output? What do you see instead?
The diff from AAAAA to CCCCC.

What I see is "Didn't apply patch cleanly".  Downloading the patch and applying it locally is fine:
cd mercurial-repository
wget -Opatch http://reviews.internal/r/67/diff/raw
hg update -r AAAAA
patch -p1 < patch

Looking at the contents of the patch we see:
diff -r AAAAA -r CCCCC filename

The problem is "-r CCCCC", if we remove it and re-upload the patch it diffs fine.  This is a but in rbt where it is adding the "-r CCCCC"

rbt diff --parent AAAAA | perl -pe 's/^(diff -r \w+) -r \w+/\1/g'> patch
upload patch

This means I cannot use rbt post

What operating system are you using? What browser?
Mac OS X

Please provide any additional information below.
#1 ronal******@visierc******* (Google Code) (Is this you? Claim this profile.)
A one-liner to replace rbi post --parent AAAAA is:
rbt diff --parent AAAAA | perl -pe 's/^(diff -r \w+) -r \w+/\1/g' | rbt post --diff-filename=-
#2 david
  • -reviewboard