get the diff in a patch file

21 views
Skip to first unread message

Ramakrishnan P R

unread,
Jan 16, 2023, 12:53:46 PM1/16/23
to Review Board Community
Hi,
Is there a way I can get a copy of the diff in a patch file format by using a rbt command on the linux server.
I see there is an option to download the diff from the review board html page. Request is to get the patch file on the linux server (SJ/BLR) using a rbt command such as rbt patch / rbt post etc.

Thanks.
Regards,
Rama

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

David Trowbridge

unread,
Jan 16, 2023, 1:11:39 PM1/16/23
to revie...@googlegroups.com
Rama,

If you want to save the patch to a file, you can do that with rbt patch:

rbt patch --write 1234.diff 1234

By default, that will grab the latest diff. If you want a specific revision you can use --diff-revision

David

--
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/74418966-5ab8-4407-9438-bc28cb807167n%40googlegroups.com.

Ramakrishnan P R

unread,
Jan 16, 2023, 10:57:05 PM1/16/23
to revie...@googlegroups.com

Hi,

 

Thanks for replying back.

I think the “1234” you mention in your example is the RB number.

I tried as below:

 

lvnvdb1375 ...rp889981/dynbwfixes/trunk> rbt patch -write 260437.diff 260437

usage: rbt patch [options] <review-request-id>

rbt: error: unrecognized arguments: -write

lvnvdb1375 ...rp889981/dynbwfixes/trunk> rbt patch --write 260437.diff 260437

usage: rbt patch [options] <review-request-id>

rbt: error: unrecognized arguments: --write

lvnvdb1375 ...rp889981/dynbwfixes/trunk>

 

Does not seem to recognize.

260437 is a valid rb :https://wlan-rb.lvn.broadcom.net/r/260437/

 

This would be helpful when we have to merge the changes from one repository to another. And in the new repository you want to do some sanity test before you use merge_jira to check in the change.

Using rbt patch rbnumber# does not work since the RB was created from a different repository.

 

lvnvdb1375 ...rp889981/dynbwfixes/trunk> rbt patch --px 4 260437

Patch is being applied from request 260437 with diff revision 4.

WARNING: This patch was generated in a different directory. To prevent conflicts, all files not under the current directory have been excluded. To apply all files in this patch, apply this patch from the /dot11_firmware/branches/RhinoUcodeBranch_1555_10000 directory.

WARNING: All files were excluded from the patch.

Successfully applied patch.

 

I found another way to do it using --print:

rbt patch --print 260437 > 260437.diff

 

Thanks.

Regards,

Rama

David Trowbridge

unread,
Jan 18, 2023, 1:22:31 PM1/18/23
to revie...@googlegroups.com
If your `rbt patch` command doesn't have the `--write` flag, then you're running a version older than 2.0.1. We highly recommend upgrading.

David

Reply all
Reply to author
Forward
0 new messages