Reversed (or previously applied) patch detected! when view diff after git push

1,048 views
Skip to first unread message

birdsong

unread,
Dec 21, 2010, 3:31:55 PM12/21/10
to reviewboard

I'm getting this error
http://pastebin.com/uEwh1vjR

Setup is:
reviewboard on same servers as bare git repo and cgit server.
path: /home/git/repositories/f.web.git
mirror path: g...@repo.f.com:f.web.git
raw file url mask: http://localhost:7000/cgit/f.web/plain/<filename>?id2=<revision>

(i know i'm missing the 'gtk+' path component that the docs mention,
but this url works on my version of cgit to retrieve the plain file
and adding gtk+ anywhere in the path broke that)

I am able to view the diff after running git commit and then post-
review. Once I push my commit to origin, the diff is no longer
available and I get this traceback.

Any ideas?

Christian Hammond

unread,
Dec 21, 2010, 6:24:34 PM12/21/10
to revie...@googlegroups.com
Can you plug in a filename and SHA1 into that raw URL mask and see if
it's actually fetching using the SHA1? If modifying the tip of origin
breaks things, I wonder if it's not actually making use of the SHA1 on
your copy of cgit. If things break with gtk+, maybe there is some
compatibility change.

What you can try doing is browsing your repository, going to a file
(on some older revision), and trying to view the raw file. See what
URL you get. There may be a couple versions of the raw URLs, so you
may have to find the one that uses /plain/.

Christian

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

> --
> Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to reviewboard...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en

David Birdsong

unread,
Dec 22, 2010, 2:37:38 PM12/22/10
to revie...@googlegroups.com
On Tue, Dec 21, 2010 at 6:24 PM, Christian Hammond <chi...@chipx86.com> wrote:
> Can you plug in a filename and SHA1 into that raw URL mask and see if
> it's actually fetching using the SHA1? If modifying the tip of origin
> breaks things, I wonder if it's not actually making use of the SHA1 on
> your copy of cgit. If things break with gtk+, maybe there is some
> compatibility change.
>
this is happening. calls to that raw url return the plain file, but
id2 is completely ignored.

> What you can try doing is browsing your repository, going to a file
> (on some older revision), and trying to view the raw file. See what
> URL you get. There may be a couple versions of the raw URLs, so you
> may have to find the one that uses /plain/.

so going working backwards a little, can you tell me what this id
represents? this is from diffviewer_filediff table.
source_revision: 9455e4714fa626cbd8410a3d13abb3bbe7a79f8c

i ask because this is what it's querying cgit for, but i can't find
any reference to that id...either by browsing through cgit or on my
local clone where i ran post-review.

Christian Hammond

unread,
Dec 22, 2010, 4:38:35 PM12/22/10
to revie...@googlegroups.com
It's the SHA1 of the commit.

I think I saw a setup once before that required id= instead of id2=.
Maybe try that.

Christian

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

David Birdsong

unread,
Dec 22, 2010, 7:53:04 PM12/22/10
to revie...@googlegroups.com
On Wed, Dec 22, 2010 at 4:38 PM, Christian Hammond <chi...@chipx86.com> wrote:
> It's the SHA1 of the commit.
but git log shows a different commit id for that commit.

referring to that hash tag when performing a diff, does work though
git diff 9455e4714fa626cbd8410a3d13abb3bbe7a79f8c <file_name>
diff --git a/scripts/cr.py b/scripts/cr.py
index 9455e47..ba58480 100755
....truncated

>
> I think I saw a setup once before that required id= instead of id2=.

i've tried id and id2. id is probably the correct param, because it
triggers an error for a bad commit id when rb tries to fetch using the
sha1 it has stored in the db. this is why i'm trying to understand
how rb/post-review decides to store that hash.

> Maybe try that.
>

now that i've put id instead of id2 in the raw url, when i do review
diff on a new review that hasn't been pushed to the central repo, it
gives an error. why would that commit id(which is only exists in my
local clone) be supplied to cgit which is running against the central
repo? (this question ignores the fact that this hash doesn't seem to
be a local commit either, but some sort of diff tag?)


btw, these are the commands i run for post-review--perhaps incorrect
or incomplete?
/usr/bin/post-review --guess-summary --guess-description --publish
--target-people=user1,user2 --target-group=Everyone

Long VU

unread,
Feb 3, 2012, 1:15:39 PM2/3/12
to revie...@googlegroups.com
Hi,

I also got this same problem (reversed patch detected after I push my changes to the central repository, so I can't view the diff anymore). I am using mercurial instead of git, on Review Board 1.6.3.

Traceback (most recent call last):
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/reviewboard/diffviewer/views.py", line 151, in view_diff
    interdiffset, highlighting, True)
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/reviewboard/diffviewer/diffutils.py", line 1071, in get_diff_files
    large_data=True)
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/djblets/util/misc.py", line 157, in cache_memoize
    data = lookup_callable()
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/reviewboard/diffviewer/diffutils.py", line 1070, in <lambda>
    enable_syntax_highlighting)),
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/reviewboard/diffviewer/diffutils.py", line 552, in get_chunks
    new = get_patched_file(old, filediff)
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/reviewboard/diffviewer/diffutils.py", line 374, in get_patched_file
    return patch(filediff.diff, buffer, filediff.dest_file)
  File "/opt/reviewboard_virtualenv/lib/python2.6/site-packages/reviewboard/diffviewer/diffutils.py", line 242, in patch
    (filename, tempdir, patch_output))
Exception: The patch to '3rd_Party/PacsRuntime/3rdPartyRpms.txt' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.IkSvOF' for debugging purposes.
`patch` returned: patching file /tmp/reviewboard.IkSvOF/tmpahHYOO
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file /tmp/reviewboard.IkSvOF/tmpahHYOO-new.rej


I was using `post-review --guess-summary --guess-description` to post my review and subsequenly using `post-review -r review_id` to update the existing review.

One work-around I've found is to immediately re-post the review again after I've push my changes to the central repository using `post-review -r review_id --revision-range tip`.

This work-around is highly annoying. Did I do something wrong when posting and updating the review? How can I avoid this work-around? How can I debug this problem?

Thanks,
Long

Long VU

unread,
Feb 2, 2012, 2:21:05 PM2/2/12
to David Birdsong, revie...@googlegroups.com
Hi,

I am having the same problem (diff failed after push to central repo).
I am using Mercurial instead of Git, using RB 1.6.3. Here's the error:

One work-around I found is to immediately do another `post-review -r
review_id --revision-range tip` right after the push to fix the diff
on ReviewBoard.

I initially created the review by doing `post-review --guess-summary --
guess-description`.

Then subsequently updating it using `post-review -r review_id`

Did I do something wrong?

How can I prevent / debug this problem?

Long

On Dec 22 2010, 7:53 pm, David Birdsong <david.birds...@gmail.com>
wrote:

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


>
> > On Wed, Dec 22, 2010 at 11:37 AM, David Birdsong

> > <david.birds...@gmail.com> wrote:


> >> On Tue, Dec 21, 2010 at 6:24 PM, Christian Hammond <chip...@chipx86.com> wrote:
> >>> Can you plug in a filename and SHA1 into that raw URL mask and see if
> >>> it's actually fetching using the SHA1? If modifying the tip of origin
> >>> breaks things, I wonder if it's not actually making use of the SHA1 on
> >>> your copy of cgit. If things break with gtk+, maybe there is some
> >>> compatibility change.
>
> >> this is happening.  calls to that raw url return the plain file, but
> >> id2 is completely ignored.
>
> >>> What you can try doing is browsing your repository, going to a file
> >>> (on some older revision), and trying to view the raw file. See what
> >>> URL you get. There may be a couple versions of the raw URLs, so you
> >>> may have to find the one that uses /plain/.
>
> >> so going working backwards a little, can you tell me what this id
> >> represents?  this is from diffviewer_filediff table.
> >>   source_revision: 9455e4714fa626cbd8410a3d13abb3bbe7a79f8c
>
> >> i ask because this is what it's querying cgit for, but i can't find
> >> any reference to that id...either by browsing through cgit or on my
> >> local clone where i ran post-review.
>
> >>> Christian
>
> >>> --

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


>
> >>> On Tue, Dec 21, 2010 at 12:31 PM, birdsong <david.birds...@gmail.com> wrote:
>
> >>>> I'm getting this error
> >>>>http://pastebin.com/uEwh1vjR
>
> >>>> Setup is:
> >>>> reviewboard on same servers as bare git repo and cgit server.
> >>>> path: /home/git/repositories/f.web.git
> >>>> mirror path: g...@repo.f.com:f.web.git
> >>>> raw file url mask:http://localhost:7000/cgit/f.web/plain/<filename>?id2=<revision>
>
> >>>> (i know i'm missing the 'gtk+' path component that the docs mention,
> >>>> but this url works on my version of cgit to retrieve the plain file
> >>>> and adding gtk+ anywhere in the path broke that)
>
> >>>> I am able to view the diff after running git commit and then post-

> >>>> review.  Once Ipushmy commit to origin, the diff is no longer


> >>>> available and I get this traceback.
>
> >>>> Any ideas?
>
> >>>> --

> >>>> Want to help the Review Board project? Donate today athttp://www.reviewboard.org/donate/
> >>>> Happy user? Let us know athttp://www.reviewboard.org/users/


> >>>> -~----------~----~----~----~------~----~------~--~---
> >>>> To unsubscribe from this group, send email to reviewboard...@googlegroups.com

> >>>> For more options, visit this group athttp://groups.google.com/group/reviewboard?hl=en
>
> >>> --
> >>> Want to help the Review Board project? Donate today athttp://www.reviewboard.org/donate/
> >>> Happy user? Let us know athttp://www.reviewboard.org/users/


> >>> -~----------~----~----~----~------~----~------~--~---
> >>> To unsubscribe from this group, send email to reviewboard...@googlegroups.com

> >>> For more options, visit this group athttp://groups.google.com/group/reviewboard?hl=en
>
> >> --
> >> Want to help the Review Board project? Donate today athttp://www.reviewboard.org/donate/
> >> Happy user? Let us know athttp://www.reviewboard.org/users/


> >> -~----------~----~----~----~------~----~------~--~---
> >> To unsubscribe from this group, send email to reviewboard...@googlegroups.com

> >> For more options, visit this group athttp://groups.google.com/group/reviewboard?hl=en
>
> > --
> > Want to help the Review Board project? Donate today athttp://www.reviewboard.org/donate/
> > Happy user? Let us know athttp://www.reviewboard.org/users/

Reply all
Reply to author
Forward
0 new messages