Return to Video

Working on multiple patches within your patch queue (http://codefirefox.com)

  • 0:00 - 0:05
    We seen in the last video, that patch queues allow you to apply and unapply patches.
  • 0:05 - 0:09
    What I didn't show you yet, is how to work with multiple different patches.
  • 0:09 - 0:11
    This video is going to try to cover that.
  • 0:11 - 0:14
    So let's say we have one patch applied,
  • 0:14 - 0:20
    and it's bug123456_whitespacefixes
  • 0:20 - 0:23
    And we want to create a new patch.
  • 0:23 - 0:25
    This patch will be independent of the last.
  • 0:25 - 0:28
    The first thing we're going to do is go make a change to a file.
  • 0:28 - 0:38
    And we're just going to add a pretty useless comment right now and say: This is a comment.
  • 0:38 - 0:41
    And we're going to save and quit.
  • 0:41 - 0:57
    And we're going to go hg qnew bug777777 comment changes dot diff
  • 0:57 - 1:02
    And hit enter.
  • 1:02 - 1:05
    So this is going to create a second patch.
  • 1:05 - 1:07
    If we would have wanted that change inside the last patch,
  • 1:07 - 1:10
    we would have just used hg qrefresh or hg qref.
  • 1:10 - 1:15
    So if we go look at hg qapplied now, you're going to see that there's 2 patches.
  • 1:15 - 1:18
    The first one being the whitespace patch. The second one being the comment change.
  • 1:18 - 1:23
    Now we can pop off the last change, using hg qpop.
  • 1:23 - 1:29
    And it says that we're now at the whitespace patch.
  • 1:29 - 1:33
    So if we go look at hg qapplied again, it's just going to show the one patch.
  • 1:33 - 1:36
    Now if we go modify the file that we just changed,
  • 1:36 - 1:40
    we'll notice that the comment is not there.
  • 1:40 - 1:42
    And that's because the patch is not applied.
  • 1:42 - 1:45
    As soon as we push it back on.
  • 1:45 - 1:49
    And we go modify that same file again,
  • 1:49 - 1:51
    we'll see that the comment is present now.
  • 1:51 - 1:57
    So what I want to explain now, is just the concept of how patch queues work.
  • 1:57 - 2:01
    Is that, it kind of works like a stack and not a queue.
  • 2:01 - 2:07
    So just like if you have a stack of plates, basically you have a stack of patches.
  • 2:07 - 2:13
    The current patch is always the very top. So if you put food on the stack of plate for example,
  • 2:13 - 2:16
    that food will only be on the very top plate.
  • 2:16 - 2:24
    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.
  • 2:24 - 2:30
    So hg qapplied, now you see that we're on the comment changes is the last patch there.
  • 2:30 - 2:32
    That's the top of your stack basically.
  • 2:32 - 2:39
    So if you go make a change, This is a, we're just going to put "good" comment.
  • 2:39 - 2:41
    Save it, and quit.
  • 2:41 - 2:50
    Now when we hg qref, that change is going to go inside your top of your stack, which is the bug777777 comment changes
  • 2:50 - 2:54
    So now I'm just going to go open that patch,
  • 2:54 - 3:00
    and you'll see that it says: This is a good comment
  • 3:00 - 3:02
    And that's all for this video.
Title:
Working on multiple patches within your patch queue (http://codefirefox.com)
Description:

Video for working with multiple patches in your patch queue when developing for Firefox.
http://codefirefox.com

more » « less
Video Language:
English
Duration:
03:03

English subtitles

Revisions