Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
"View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nikita Zhuk  
View profile  
 More options Dec 9 2011, 3:03 am
From: Nikita Zhuk <nikita.z...@gmail.com>
Date: Fri, 9 Dec 2011 00:03:07 -0800 (PST)
Local: Fri, Dec 9 2011 3:03 am
Subject: "View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories
I'm using ReviewBoard 1.6.3 and my repositories are hosted at
BitBucket as private repositories. I have configured my repository in
the admin section of the RB by using HTTP URL and by entering my
BitBucket user name and password. I can submit review requests, upload
diffs and view raw diffs ("Download Diff") successfully, but when I
click "View Diff" button on the review page, I get the following stack
trace:

The patch to 'README.txt' didn't apply cleanly. The temporary files
have been left in '/tmp/reviewboard.FtaN0j' for debugging purposes.
`patch` returned: patching file /tmp/reviewboard.FtaN0j/tmpEtmkDI Hunk
#1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file /tmp/
reviewboard.FtaN0j/tmpEtmkDI-new.rej

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/ReviewBoard-1.6.3-py2.7.egg/
reviewboard/diffviewer/views.py", line 151, in view_diff
    interdiffset, highlighting, True)
  File "/Library/Python/2.7/site-packages/ReviewBoard-1.6.3-py2.7.egg/
reviewboard/diffviewer/diffutils.py", line 1071, in get_diff_files
    large_data=True)
  File "/Library/Python/2.7/site-packages/Djblets-0.6.14-py2.7.egg/
djblets/util/misc.py", line 156, in cache_memoize
    data = lookup_callable()
  File "/Library/Python/2.7/site-packages/ReviewBoard-1.6.3-py2.7.egg/
reviewboard/diffviewer/diffutils.py", line 1070, in <lambda>
    enable_syntax_highlighting)),
  File "/Library/Python/2.7/site-packages/ReviewBoard-1.6.3-py2.7.egg/
reviewboard/diffviewer/diffutils.py", line 552, in get_chunks
    new = get_patched_file(old, filediff)
  File "/Library/Python/2.7/site-packages/ReviewBoard-1.6.3-py2.7.egg/
reviewboard/diffviewer/diffutils.py", line 374, in get_patched_file
    return patch(filediff.diff, buffer, filediff.dest_file)
  File "/Library/Python/2.7/site-packages/ReviewBoard-1.6.3-py2.7.egg/
reviewboard/diffviewer/diffutils.py", line 242, in patch
    (filename, tempdir, patch_output))
Exception: The patch to 'README.txt' didn't apply cleanly. The
temporary files have been left in '/tmp/reviewboard.FtaN0j' for
debugging purposes.
`patch` returned: patching file /tmp/reviewboard.FtaN0j/tmpEtmkDI
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file /tmp/
reviewboard.FtaN0j/tmpEtmkDI-new.rej

When I open the file which was saved at /tmp/reviewboard.FtaN0j/
tmpEtmkDI-new I can see the HTML code from BitBucket.org which
presents Log in forms, so no wonder the patching fails.

I found a similar problem description here as well:
https://groups.google.com/forum/#!msg/reviewboard/myKbvnIPqfw/Tk3n24t...

Any help would be greatly appreciated.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Hammond  
View profile  
 More options Dec 9 2011, 2:41 pm
From: Christian Hammond <chip...@chipx86.com>
Date: Fri, 9 Dec 2011 11:41:44 -0800
Local: Fri, Dec 9 2011 2:41 pm
Subject: Re: "View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories

Hi Nikita,

Can you show me what the configuration looks like, roughly? (Censor out
sensitive parts, but the structure is important).

It sounds like it's just some configuration error. It's not using a valid
URL for fetching the raw files.

Christian

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikita Zhuk  
View profile  
 More options Dec 12 2011, 2:30 am
From: Nikita Zhuk <nikita.z...@gmail.com>
Date: Sun, 11 Dec 2011 23:30:29 -0800 (PST)
Local: Mon, Dec 12 2011 2:30 am
Subject: Re: "View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories

Hi Christian,

Sure. The repository configuration screen doesn't have any sensitive
information visible (and I'm using a non-critical test repository anyway),
so I'm attaching a screenshot of it here (the password field is blank in
the screenshot, but I do use correct password in there of course).

ReviewBoard's settings_local.py looks like this:

$ cat conf/settings_local.py
# Site-specific configuration settings for Review Board
# Definitions of these settings can be found at
# http://docs.djangoproject.com/en/dev/ref/settings/

# Database configuration
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/Users/xxx/data/reviewboard.db',
    },

}

# Unique secret key. Don't share this with anybody.
SECRET_KEY = 'XXX'

# Cache backend settings.
CACHE_BACKEND = 'file:///tmp/reviewboard_cache'

# Extra site information.
SITE_ID = 1
SITE_ROOT = '/review/'
FORCE_SCRIPT_NAME = ''
DEBUG = True
LOGGING_ENABLED = True

Since I have enabled logging, I can also provide the debug-level log which
is generated when I click the "View Diff" button:

ReviewBoard base URL: http://myhost.local/review
URL which is opened by clicking the "View Diff"
button: http://myhost.local/review/r/39/diff/#index_header

Log output:

2011-12-09 20:20:00,157 - DEBUG - Logging to /tmp/rb/reviewboard.log with a
minimum level of DEBUG
2011-12-09 20:20:00,157 - DEBUG - Log file for Review Board v1.6.3 (PID
10247)
2011-12-09 20:20:15,090 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:15,090 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:16,962 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:16,963 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:16,965 - DEBUG - Generating diff viewer page for filediff
id 13
2011-12-09 20:20:16,966 - DEBUG - Begin: Generating diff file info for
diffset id 13
2011-12-09 20:20:16,967 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:16,968 - DEBUG - End: Generating diff file info for
diffset id 13
2011-12-09 20:20:16,968 - DEBUG - Generating diff file info for diffset id
13 took 0.1665 seconds
2011-12-09 20:20:16,968 - DEBUG - Begin: Generating diff file info for
diffset id 13, filediff 13
2011-12-09 20:20:16,968 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:16,969 - INFO - Cache miss for key
myhost.local:diff-sidebyside-hl-13.
2011-12-09 20:20:16,969 - DEBUG - Initialized HgWebClient with
url=u'http://bitbucket.org/nzhuk/testrep1/', username=u'nzhuk'
2011-12-09 20:20:16,969 - INFO - Cache miss for key
myhost.local:http%3A//bitbucket.org/nzhuk/testrep1/:README.txt:2df4ddabbe02 .
2011-12-09 20:20:16,970 - DEBUG - Begin: Fetching file 'README.txt'
r2df4ddabbe02 from TestRep1
2011-12-09 20:20:19,525 - DEBUG - End: Fetching file 'README.txt'
r2df4ddabbe02 from TestRep1
2011-12-09 20:20:19,525 - DEBUG - Fetching file 'README.txt' r2df4ddabbe02
from TestRep1 took 2.555507 seconds
2011-12-09 20:20:19,527 - DEBUG - Begin: Patching file README.txt
2011-12-09 20:20:19,536 - DEBUG - End: Patching file README.txt
2011-12-09 20:20:19,536 - DEBUG - Patching file README.txt took 0.8341
seconds

  rb-repository-config.png
83K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikita Zhuk  
View profile  
 More options Dec 21 2011, 10:08 am
From: Nikita Zhuk <nikita.z...@gmail.com>
Date: Wed, 21 Dec 2011 07:08:14 -0800 (PST)
Local: Wed, Dec 21 2011 10:08 am
Subject: Re: "View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories
Ok, I've debugged this problem a bit and came to the conclusion that
fetching raw files in hg.py from BitBucket with HTTPBasicAuthHandler
seems to have some issues. I've created a workaround by tweaking the
HgWebClient class a bit to use BitBucket API to fetch raw files. This
patch solved my problem:
https://github.com/nzhuk/reviewboard/commit/a56829a594ade9696a6ba9bfb...

Since it's BitBucket-only solution you probably wouldn't want to pull
it directly into the main fork, but it might give you some ideas for
the development.

- Nikita Zhuk

On Dec 12, 9:30 am, Nikita Zhuk <nikita.z...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Olivia  
View profile  
 More options Jan 5 2012, 3:46 am
From: Olivia <honghua....@gmail.com>
Date: Thu, 5 Jan 2012 00:46:35 -0800 (PST)
Local: Thurs, Jan 5 2012 3:46 am
Subject: Re: "View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories
Hi Nikita,

I met the same issue with Git repository. Do you have any suggestion
to fix?
Should I also change /usr/local/lib/python2.6/dist-packages/
ReviewBoard-1.6-py2.6.egg/reviewboard/scmtools/git.py and how?

Best Regards,
Olivia Yin

On 2011年12月21日, 下午11时08分, Nikita Zhuk <nikita.z...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vairav  
View profile  
 More options Jan 5 2012, 9:04 pm
From: Vairav <vayira...@gmail.com>
Date: Thu, 5 Jan 2012 18:04:32 -0800 (PST)
Local: Thurs, Jan 5 2012 9:04 pm
Subject: Re: "View Diff" cause "patch didn't apply cleanly" error when ReviewBoard is used with BitBucket repositories
Hi,
  I have a similar setup of ReviewBoard with Mercurial repository
being managed by RhodeCode with a username and password
authentication.
I'm able to do a 'hg postreview -o xxx' and when I click on 'View
Diff' I'm getting the same error.

Any pointers on the same would be really helpful.

Thanks,
Vairav

On Jan 5, 12:46 am, Olivia <honghua....@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »