WEBVTT 00:00:00.537 --> 00:00:03.254 In this video, we're going to learn how to import a patch that someone else created. 00:00:03.254 --> 00:00:05.588 I'm going to show you 2 different ways to do this. 00:00:05.588 --> 00:00:09.754 One is from the local file system, and one is directly from a bug in bugzilla. 00:00:09.754 --> 00:00:13.837 So let's say we're doing a review, and I want to test someone else's functionality. 00:00:13.837 --> 00:00:17.255 Or perhaps I just want to import someone's patch, to have it locally. 00:00:17.255 --> 00:00:20.669 So what I can do is I can go to the bug in Bugzilla. 00:00:20.669 --> 00:00:23.588 For example 924900 00:00:23.588 --> 00:00:27.237 And I can go down to the attachments section right here. 00:00:27.237 --> 00:00:31.868 And I can right click, and save link as... 00:00:31.868 --> 00:00:36.304 And I'm just going to save it to the Downloads folder. 00:00:36.304 --> 00:00:39.137 And it says downloads complete. 00:00:39.137 --> 00:00:42.255 So next I'm going to open up the terminal. 00:00:42.255 --> 00:00:46.704 And I'm going to type hg qimport 00:00:46.704 --> 00:00:49.838 and that's going to import the patch directly in my patch queue. 00:00:49.838 --> 00:00:52.804 And all you do is you specify the location of the patch. 00:00:52.804 --> 00:01:02.588 So in my home directory, downloads, bug924900_removeSyncSetup.diff 00:01:02.588 --> 00:01:04.138 And I'm going to press enter. 00:01:04.138 --> 00:01:10.255 And you can see that it says: Adding bug blah blah blah to series file. 00:01:10.255 --> 00:01:11.138 OK. 00:01:11.138 --> 00:01:13.070 now I do hg qapplied. 00:01:13.070 --> 00:01:16.036 And it shows that nothing is yet applied. 00:01:16.036 --> 00:01:18.037 But it is in my series. 00:01:18.037 --> 00:01:19.737 So when I do hg qpush 00:01:19.737 --> 00:01:24.755 You'll see that it's applying that bug that we just imported. 00:01:24.755 --> 00:01:29.205 And when I do hg qapplied now, it's there now. 00:01:29.205 --> 00:01:33.004 So what I'm going to do now is I'm going to show you the second way. 00:01:33.004 --> 00:01:35.537 So first I'm just going to clear the terminal. 00:01:35.537 --> 00:01:41.204 And I'm just going to remove that bug now. 00:01:41.204 --> 00:01:43.973 So first you can do hg qpop 00:01:43.973 --> 00:01:48.971 And the reason I'm removing this patch is just so that I can get it directly from the web again. 00:01:48.971 --> 00:01:55.837 And you can actually use hg qremove and specify the bug number, as long as it's not applied already. 00:01:55.837 --> 00:01:58.505 And since we just popped it's not applied. 00:01:58.505 --> 00:02:02.369 So hg qremove, specify the bug, press enter. 00:02:02.369 --> 00:02:03.802 And it's gone now. 00:02:03.802 --> 00:02:10.336 So I'm going to go back to the web browser, and this time instead of downloading I'm just going to right click. 00:02:10.336 --> 00:02:12.203 And I'm going to copy link location. 00:02:12.203 --> 00:02:15.402 And then I'm going to go back to the terminal. 00:02:15.402 --> 00:02:23.303 And I'm going to do hg qimport and what you can do is you can just paste the link there. 00:02:23.303 --> 00:02:35.921 And then you specify -n and then the patch name, so bug924900.diff let's say. 00:02:35.921 --> 00:02:37.921 Hit enter. 00:02:37.921 --> 00:02:39.903 And it's there. 00:02:39.903 --> 00:02:41.970 So I can press hg qpush now. 00:02:41.970 --> 00:02:45.138 And it applies it in the same way. 00:02:45.138 --> 00:02:49.637 Now the reason why you need to specify the -n with the bug name when you do it this way. 00:02:49.637 --> 00:02:53.705 Is because it doesn't determine the patch name properly. 00:02:53.705 --> 00:02:57.170 And I believe it's just because of this query parameter there. 00:02:57.170 --> 00:02:59.000 And that's all I have for this video.