apply a patch on solr

View: New views
10 Messages — Rating Filter:   Alert me  

apply a patch on solr

by michael8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

First I like to pardon my novice question on patching solr (1.4).  What I like to know is, given a patch, like the one for collapse field, how would one go about knowing what solr source that patch is meant for since this is a source level patch?  Wouldn't the exact versions of a set of java files to be patched critical for the patch to work properly?

So far what I have done is to pull the latest collapse field patch down from http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch), and then svn up the latest trunk from http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and build.  Intuitively I was thinking I should be doing svn up to a specific revision/tag instead of just latest.  So far everything seems fine, but I just want to make sure I'm doing the right thing and not just being lucky.

Thanks,
Michael

Re: apply a patch on solr

by cambridgemike :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can see what revision the patch was written for at the top of the patch,
it will look like this:

Index: org/apache/solr/handler/MoreLikeThisHandler.java
===================================================================
--- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
+++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)

now check out revision 772437 using the --revision switch in svn, patch
away, and then svn up to make sure everything merges cleanly.  This is a
good guide to follow as well:
http://www.mail-archive.com/solr-user@.../msg10189.html

cheers,
-mike

On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@...> wrote:

>
> Hi,
>
> First I like to pardon my novice question on patching solr (1.4).  What I
> like to know is, given a patch, like the one for collapse field, how would
> one go about knowing what solr source that patch is meant for since this is
> a source level patch?  Wouldn't the exact versions of a set of java files
> to
> be patched critical for the patch to work properly?
>
> So far what I have done is to pull the latest collapse field patch down
> from
> http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch),
> and
> then svn up the latest trunk from
> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and build.
> Intuitively I was thinking I should be doing svn up to a specific
> revision/tag instead of just latest.  So far everything seems fine, but I
> just want to make sure I'm doing the right thing and not just being lucky.
>
> Thanks,
> Michael
> --
> View this message in context:
> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: apply a patch on solr

by hossman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


: --- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
: +++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)
:
: now check out revision 772437 using the --revision switch in svn, patch
: away, and then svn up to make sure everything merges cleanly.  This is a
: good guide to follow as well:

...that line only tells you which revision that specific file was last
updated in ... if you check for all such lines in a patch, and look for
the highest number, that ill give you a good idea which version you can
apply it against (but unfortunately, doesn't tell you anything baout other
files the patch generator may have had checked out, and what revision they
were last modified in ... the patch may depend on code in other files that
wasn't modified so it didn't make it ito the patch)

generally speaking: most patches for Solr in Jira are against the trunk
(we don't tend to have much branch development or backporting) and looking
at the date the patch was attached to Jira will help you identify what it
was generated against.

Ieally people will post the output of "svnversion" when they attach a
patch, but that usually doens't happen.

-Hoss


Re: apply a patch on solr

by michael8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Perfect.  This is what I need to know instead of patching 'in the dark'.  Good thing SVN revision cuts across all files like a tag.

Thanks Mike!

Michael

cambridgemike wrote:
You can see what revision the patch was written for at the top of the patch,
it will look like this:

Index: org/apache/solr/handler/MoreLikeThisHandler.java
===================================================================
--- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
+++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)

now check out revision 772437 using the --revision switch in svn, patch
away, and then svn up to make sure everything merges cleanly.  This is a
good guide to follow as well:
http://www.mail-archive.com/solr-user@lucene.apache.org/msg10189.html

cheers,
-mike

On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@saracatech.com> wrote:

>
> Hi,
>
> First I like to pardon my novice question on patching solr (1.4).  What I
> like to know is, given a patch, like the one for collapse field, how would
> one go about knowing what solr source that patch is meant for since this is
> a source level patch?  Wouldn't the exact versions of a set of java files
> to
> be patched critical for the patch to work properly?
>
> So far what I have done is to pull the latest collapse field patch down
> from
> http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch),
> and
> then svn up the latest trunk from
> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and build.
> Intuitively I was thinking I should be doing svn up to a specific
> revision/tag instead of just latest.  So far everything seems fine, but I
> just want to make sure I'm doing the right thing and not just being lucky.
>
> Thanks,
> Michael
> --
> View this message in context:
> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: apply a patch on solr

by michael8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmmm, perhaps I jumped the gun.  I just looked over the field collapse patch for SOLR-236 and each file listed in the patch has its own revision #.  

E.g. from field-collapse-5.patch:
--- src/java/org/apache/solr/core/SolrConfig.java (revision 824364)
--- src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java (revision 816372)
--- src/solrj/org/apache/solr/client/solrj/SolrQuery.java (revision 823653)
--- src/java/org/apache/solr/search/SolrIndexSearcher.java (revision 794328)
--- src/java/org/apache/solr/search/DocSetHitCollector.java (revision 794328)

Unless there is a better way, it seems like I would need to do "svn up --revision ..." for each of the files to be patched and then apply the patch?  This seems error prone and tedious.  Am I missing something simpler here?

Michael


Perfect.  This is what I need to know instead of patching 'in the dark'.  Good thing SVN revision cuts across all files like a tag.

Thanks Mike!

Michael

cambridgemike wrote:
You can see what revision the patch was written for at the top of the patch,
it will look like this:

Index: org/apache/solr/handler/MoreLikeThisHandler.java
===================================================================
--- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
+++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)

now check out revision 772437 using the --revision switch in svn, patch
away, and then svn up to make sure everything merges cleanly.  This is a
good guide to follow as well:
http://www.mail-archive.com/solr-user@lucene.apache.org/msg10189.html

cheers,
-mike

On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@saracatech.com> wrote:

>
> Hi,
>
> First I like to pardon my novice question on patching solr (1.4).  What I
> like to know is, given a patch, like the one for collapse field, how would
> one go about knowing what solr source that patch is meant for since this is
> a source level patch?  Wouldn't the exact versions of a set of java files
> to
> be patched critical for the patch to work properly?
>
> So far what I have done is to pull the latest collapse field patch down
> from
> http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch),
> and
> then svn up the latest trunk from
> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and build.
> Intuitively I was thinking I should be doing svn up to a specific
> revision/tag instead of just latest.  So far everything seems fine, but I
> just want to make sure I'm doing the right thing and not just being lucky.
>
> Thanks,
> Michael
> --
> View this message in context:
> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


Re: apply a patch on solr

by Joe Calderon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

patch -p0 < /path/to/field-collapse-5.patch

On Tue, Nov 3, 2009 at 7:48 PM, michael8 <michael@...> wrote:

>
> Hmmm, perhaps I jumped the gun.  I just looked over the field collapse patch
> for SOLR-236 and each file listed in the patch has its own revision #.
>
> E.g. from field-collapse-5.patch:
> --- src/java/org/apache/solr/core/SolrConfig.java       (revision 824364)
> --- src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java
> (revision 816372)
> --- src/solrj/org/apache/solr/client/solrj/SolrQuery.java       (revision 823653)
> --- src/java/org/apache/solr/search/SolrIndexSearcher.java      (revision 794328)
> --- src/java/org/apache/solr/search/DocSetHitCollector.java     (revision
> 794328)
>
> Unless there is a better way, it seems like I would need to do "svn up
> --revision ..." for each of the files to be patched and then apply the
> patch?  This seems error prone and tedious.  Am I missing something simpler
> here?
>
> Michael
>
>
> michael8 wrote:
>>
>> Perfect.  This is what I need to know instead of patching 'in the dark'.
>> Good thing SVN revision cuts across all files like a tag.
>>
>> Thanks Mike!
>>
>> Michael
>>
>>
>> cambridgemike wrote:
>>>
>>> You can see what revision the patch was written for at the top of the
>>> patch,
>>> it will look like this:
>>>
>>> Index: org/apache/solr/handler/MoreLikeThisHandler.java
>>> ===================================================================
>>> --- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
>>> +++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)
>>>
>>> now check out revision 772437 using the --revision switch in svn, patch
>>> away, and then svn up to make sure everything merges cleanly.  This is a
>>> good guide to follow as well:
>>> http://www.mail-archive.com/solr-user@.../msg10189.html
>>>
>>> cheers,
>>> -mike
>>>
>>> On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@...> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> First I like to pardon my novice question on patching solr (1.4).  What
>>>> I
>>>> like to know is, given a patch, like the one for collapse field, how
>>>> would
>>>> one go about knowing what solr source that patch is meant for since this
>>>> is
>>>> a source level patch?  Wouldn't the exact versions of a set of java
>>>> files
>>>> to
>>>> be patched critical for the patch to work properly?
>>>>
>>>> So far what I have done is to pull the latest collapse field patch down
>>>> from
>>>> http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch),
>>>> and
>>>> then svn up the latest trunk from
>>>> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and
>>>> build.
>>>> Intuitively I was thinking I should be doing svn up to a specific
>>>> revision/tag instead of just latest.  So far everything seems fine, but
>>>> I
>>>> just want to make sure I'm doing the right thing and not just being
>>>> lucky.
>>>>
>>>> Thanks,
>>>> Michael
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26190563.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: apply a patch on solr

by Joe Calderon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sorry got cut off,
patch, then ant clean dist, will give you the modified solr war file,
if it doesnt apply cleanly (which i dont think is currently the case),
you can go back to the latest revision referenced in the patch,


On Tue, Nov 3, 2009 at 8:17 PM, Joe Calderon <calderon.joe@...> wrote:

> patch -p0 < /path/to/field-collapse-5.patch
>
> On Tue, Nov 3, 2009 at 7:48 PM, michael8 <michael@...> wrote:
>>
>> Hmmm, perhaps I jumped the gun.  I just looked over the field collapse patch
>> for SOLR-236 and each file listed in the patch has its own revision #.
>>
>> E.g. from field-collapse-5.patch:
>> --- src/java/org/apache/solr/core/SolrConfig.java       (revision 824364)
>> --- src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java
>> (revision 816372)
>> --- src/solrj/org/apache/solr/client/solrj/SolrQuery.java       (revision 823653)
>> --- src/java/org/apache/solr/search/SolrIndexSearcher.java      (revision 794328)
>> --- src/java/org/apache/solr/search/DocSetHitCollector.java     (revision
>> 794328)
>>
>> Unless there is a better way, it seems like I would need to do "svn up
>> --revision ..." for each of the files to be patched and then apply the
>> patch?  This seems error prone and tedious.  Am I missing something simpler
>> here?
>>
>> Michael
>>
>>
>> michael8 wrote:
>>>
>>> Perfect.  This is what I need to know instead of patching 'in the dark'.
>>> Good thing SVN revision cuts across all files like a tag.
>>>
>>> Thanks Mike!
>>>
>>> Michael
>>>
>>>
>>> cambridgemike wrote:
>>>>
>>>> You can see what revision the patch was written for at the top of the
>>>> patch,
>>>> it will look like this:
>>>>
>>>> Index: org/apache/solr/handler/MoreLikeThisHandler.java
>>>> ===================================================================
>>>> --- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
>>>> +++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)
>>>>
>>>> now check out revision 772437 using the --revision switch in svn, patch
>>>> away, and then svn up to make sure everything merges cleanly.  This is a
>>>> good guide to follow as well:
>>>> http://www.mail-archive.com/solr-user@.../msg10189.html
>>>>
>>>> cheers,
>>>> -mike
>>>>
>>>> On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@...> wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> First I like to pardon my novice question on patching solr (1.4).  What
>>>>> I
>>>>> like to know is, given a patch, like the one for collapse field, how
>>>>> would
>>>>> one go about knowing what solr source that patch is meant for since this
>>>>> is
>>>>> a source level patch?  Wouldn't the exact versions of a set of java
>>>>> files
>>>>> to
>>>>> be patched critical for the patch to work properly?
>>>>>
>>>>> So far what I have done is to pull the latest collapse field patch down
>>>>> from
>>>>> http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch),
>>>>> and
>>>>> then svn up the latest trunk from
>>>>> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and
>>>>> build.
>>>>> Intuitively I was thinking I should be doing svn up to a specific
>>>>> revision/tag instead of just latest.  So far everything seems fine, but
>>>>> I
>>>>> just want to make sure I'm doing the right thing and not just being
>>>>> lucky.
>>>>>
>>>>> Thanks,
>>>>> Michael
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context: http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26190563.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
>

Re: apply a patch on solr

by michael8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, but my question here was not about the patch command itself (which I already know), but about simpler way (if any) to go about guaranteeing a proper patch with the right file revisions needed by the patch.

Michael

Joe Calderon-2 wrote:
patch -p0 < /path/to/field-collapse-5.patch

On Tue, Nov 3, 2009 at 7:48 PM, michael8 <michael@saracatech.com> wrote:
>
> Hmmm, perhaps I jumped the gun.  I just looked over the field collapse patch
> for SOLR-236 and each file listed in the patch has its own revision #.
>
> E.g. from field-collapse-5.patch:
> --- src/java/org/apache/solr/core/SolrConfig.java       (revision 824364)
> --- src/solrj/org/apache/solr/client/solrj/response/QueryResponse.java
> (revision 816372)
> --- src/solrj/org/apache/solr/client/solrj/SolrQuery.java       (revision 823653)
> --- src/java/org/apache/solr/search/SolrIndexSearcher.java      (revision 794328)
> --- src/java/org/apache/solr/search/DocSetHitCollector.java     (revision
> 794328)
>
> Unless there is a better way, it seems like I would need to do "svn up
> --revision ..." for each of the files to be patched and then apply the
> patch?  This seems error prone and tedious.  Am I missing something simpler
> here?
>
> Michael
>
>
> michael8 wrote:
>>
>> Perfect.  This is what I need to know instead of patching 'in the dark'.
>> Good thing SVN revision cuts across all files like a tag.
>>
>> Thanks Mike!
>>
>> Michael
>>
>>
>> cambridgemike wrote:
>>>
>>> You can see what revision the patch was written for at the top of the
>>> patch,
>>> it will look like this:
>>>
>>> Index: org/apache/solr/handler/MoreLikeThisHandler.java
>>> ===================================================================
>>> --- org/apache/solr/handler/MoreLikeThisHandler.java (revision 772437)
>>> +++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)
>>>
>>> now check out revision 772437 using the --revision switch in svn, patch
>>> away, and then svn up to make sure everything merges cleanly.  This is a
>>> good guide to follow as well:
>>> http://www.mail-archive.com/solr-user@lucene.apache.org/msg10189.html
>>>
>>> cheers,
>>> -mike
>>>
>>> On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@saracatech.com> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> First I like to pardon my novice question on patching solr (1.4).  What
>>>> I
>>>> like to know is, given a patch, like the one for collapse field, how
>>>> would
>>>> one go about knowing what solr source that patch is meant for since this
>>>> is
>>>> a source level patch?  Wouldn't the exact versions of a set of java
>>>> files
>>>> to
>>>> be patched critical for the patch to work properly?
>>>>
>>>> So far what I have done is to pull the latest collapse field patch down
>>>> from
>>>> http://issues.apache.org/jira/browse/SOLR-236 (field-collapse-5.patch),
>>>> and
>>>> then svn up the latest trunk from
>>>> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and
>>>> build.
>>>> Intuitively I was thinking I should be doing svn up to a specific
>>>> revision/tag instead of just latest.  So far everything seems fine, but
>>>> I
>>>> just want to make sure I'm doing the right thing and not just being
>>>> lucky.
>>>>
>>>> Thanks,
>>>> Michael
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26190563.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: apply a patch on solr

by David Stuart-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should be ok with the the revision option below. Look for the  
highest revision number in the list of files in the patch as  
subversion increments revision number on a repo basis not a file basis  
so the highest number will represent the current state of all the  
files when the patch was made if that make sense

Regards
Dave

On 4 Nov 2009, at 03:40, michael8 <michael@...> wrote:

>
> Perfect.  This is what I need to know instead of patching 'in the  
> dark'.
> Good thing SVN revision cuts across all files like a tag.
>
> Thanks Mike!
>
> Michael
>
>
> cambridgemike wrote:
>>
>> You can see what revision the patch was written for at the top of the
>> patch,
>> it will look like this:
>>
>> Index: org/apache/solr/handler/MoreLikeThisHandler.java
>> ===================================================================
>> --- org/apache/solr/handler/MoreLikeThisHandler.java (revision  
>> 772437)
>> +++ org/apache/solr/handler/MoreLikeThisHandler.java (working copy)
>>
>> now check out revision 772437 using the --revision switch in svn,  
>> patch
>> away, and then svn up to make sure everything merges cleanly.  This  
>> is a
>> good guide to follow as well:
>> http://www.mail-archive.com/solr-user@.../msg10189.html
>>
>> cheers,
>> -mike
>>
>> On Mon, Nov 2, 2009 at 3:55 PM, michael8 <michael@...>  
>> wrote:
>>
>>>
>>> Hi,
>>>
>>> First I like to pardon my novice question on patching solr (1.4).  
>>> What I
>>> like to know is, given a patch, like the one for collapse field, how
>>> would
>>> one go about knowing what solr source that patch is meant for  
>>> since this
>>> is
>>> a source level patch?  Wouldn't the exact versions of a set of  
>>> java files
>>> to
>>> be patched critical for the patch to work properly?
>>>
>>> So far what I have done is to pull the latest collapse field patch  
>>> down
>>> from
>>> http://issues.apache.org/jira/browse/SOLR-236 (field-
>>> collapse-5.patch),
>>> and
>>> then svn up the latest trunk from
>>> http://svn.apache.org/repos/asf/lucene/solr/trunk/, then patch and  
>>> build.
>>> Intuitively I was thinking I should be doing svn up to a specific
>>> revision/tag instead of just latest.  So far everything seems  
>>> fine, but I
>>> just want to make sure I'm doing the right thing and not just being
>>> lucky.
>>>
>>> Thanks,
>>> Michael
>>> --
>>> View this message in context:
>>> http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26157827.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/apply-a-patch-on-solr-tp26157827p26189573.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: apply a patch on solr

by hossman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


: Thanks, but my question here was not about the patch command itself (which I
: already know), but about simpler way (if any) to go about guaranteeing a
: proper patch with the right file revisions needed by the patch.

as i mentioned before, there is no garuntee that you are patching the
exact version the diff came from, unless someone tells you which version
it was...

http://old.nabble.com/Re%3A-apply-a-patch-on-solr-p26181837.html




-Hoss