[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.27,0:00:04.52,Default,,0000,0000,0000,,We seen in the last video, that patch queues allow you to apply and unapply patches. Dialogue: 0,0:00:04.52,0:00:08.64,Default,,0000,0000,0000,,What I didn't show you yet, is how to work with multiple different patches. Dialogue: 0,0:00:08.64,0:00:11.47,Default,,0000,0000,0000,,This video is going to try to cover that. Dialogue: 0,0:00:11.47,0:00:14.35,Default,,0000,0000,0000,,So let's say we have one patch applied, Dialogue: 0,0:00:14.35,0:00:19.87,Default,,0000,0000,0000,,and it's bug123456_whitespacefixes Dialogue: 0,0:00:19.87,0:00:22.64,Default,,0000,0000,0000,,And we want to create a new patch. Dialogue: 0,0:00:22.64,0:00:25.18,Default,,0000,0000,0000,,This patch will be independent of the last. Dialogue: 0,0:00:25.18,0:00:27.64,Default,,0000,0000,0000,,The first thing we're going to do is go make a change to a file. Dialogue: 0,0:00:27.64,0:00:37.52,Default,,0000,0000,0000,,And we're just going to add a pretty useless comment right now and say: This is a comment. Dialogue: 0,0:00:37.52,0:00:40.68,Default,,0000,0000,0000,,And we're going to save and quit. Dialogue: 0,0:00:40.68,0:00:56.64,Default,,0000,0000,0000,,And we're going to go hg qnew bug777777 comment changes dot diff Dialogue: 0,0:00:56.64,0:01:01.84,Default,,0000,0000,0000,,And hit enter. Dialogue: 0,0:01:01.84,0:01:05.17,Default,,0000,0000,0000,,So this is going to create a second patch. Dialogue: 0,0:01:05.17,0:01:07.04,Default,,0000,0000,0000,,If we would have wanted that change inside the last patch, Dialogue: 0,0:01:07.04,0:01:10.07,Default,,0000,0000,0000,,we would have just used hg qrefresh or hg qref. Dialogue: 0,0:01:10.07,0:01:15.09,Default,,0000,0000,0000,,So if we go look at hg qapplied now, you're going to see that there's 2 patches. Dialogue: 0,0:01:15.09,0:01:18.34,Default,,0000,0000,0000,,The first one being the whitespace patch. The second one being the comment change. Dialogue: 0,0:01:18.34,0:01:22.76,Default,,0000,0000,0000,,Now we can pop off the last change, using hg qpop. Dialogue: 0,0:01:22.76,0:01:29.47,Default,,0000,0000,0000,,And it says that we're now at the whitespace patch. Dialogue: 0,0:01:29.47,0:01:32.64,Default,,0000,0000,0000,,So if we go look at hg qapplied again, it's just going to show the one patch. Dialogue: 0,0:01:32.64,0:01:35.87,Default,,0000,0000,0000,,Now if we go modify the file that we just changed, Dialogue: 0,0:01:35.87,0:01:40.18,Default,,0000,0000,0000,,we'll notice that the comment is not there. Dialogue: 0,0:01:40.18,0:01:42.26,Default,,0000,0000,0000,,And that's because the patch is not applied. Dialogue: 0,0:01:42.26,0:01:45.37,Default,,0000,0000,0000,,As soon as we push it back on. Dialogue: 0,0:01:45.37,0:01:48.54,Default,,0000,0000,0000,,And we go modify that same file again, Dialogue: 0,0:01:48.54,0:01:51.42,Default,,0000,0000,0000,,we'll see that the comment is present now. Dialogue: 0,0:01:51.42,0:01:57.43,Default,,0000,0000,0000,,So what I want to explain now, is just the concept of how patch queues work. Dialogue: 0,0:01:57.43,0:02:01.04,Default,,0000,0000,0000,,Is that, it kind of works like a stack and not a queue. Dialogue: 0,0:02:01.04,0:02:07.21,Default,,0000,0000,0000,,So just like if you have a stack of plates, basically you have a stack of patches. Dialogue: 0,0:02:07.21,0:02:12.92,Default,,0000,0000,0000,,The current patch is always the very top. So if you put food on the stack of plate for example, Dialogue: 0,0:02:12.92,0:02:15.92,Default,,0000,0000,0000,,that food will only be on the very top plate. Dialogue: 0,0:02:15.92,0:02:23.68,Default,,0000,0000,0000,,Just like if you make changes to your current patch queue, those changes will only be made to the very top patch that's applied. Dialogue: 0,0:02:23.68,0:02:30.24,Default,,0000,0000,0000,,So hg qapplied, now you see that we're on the comment changes is the last patch there. Dialogue: 0,0:02:30.24,0:02:32.47,Default,,0000,0000,0000,,That's the top of your stack basically. Dialogue: 0,0:02:32.47,0:02:39.14,Default,,0000,0000,0000,,So if you go make a change, This is a, we're just going to put "good" comment. Dialogue: 0,0:02:39.14,0:02:40.90,Default,,0000,0000,0000,,Save it, and quit. Dialogue: 0,0:02:40.90,0:02:49.84,Default,,0000,0000,0000,,Now when we hg qref, that change is going to go inside your top of your stack, which is the bug777777 comment changes Dialogue: 0,0:02:49.84,0:02:53.59,Default,,0000,0000,0000,,So now I'm just going to go open that patch, Dialogue: 0,0:02:53.59,0:03:00.18,Default,,0000,0000,0000,,and you'll see that it says: This is a good comment Dialogue: 0,0:03:00.18,0:03:02.10,Default,,0000,0000,0000,,And that's all for this video.