Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Perhaps the best way to maintain sanity with so many
targets is to be able to choose specific patches to apply for a given
situation. MQ provides a feature called “guards” (which
originated from quilt’s guards command) that does
just this. To start off, let’s create a simple repository for
experimenting in.
$hg qinit$hg qnew hello.patch$echo hello > hello$hg add hello$hg qrefresh$hg qnew goodbye.patch$echo goodbye > goodbye$hg add goodbye$hg qrefresh
This gives us a tiny repository that contains two patches that don’t have any dependencies on each other, because they touch different files.
The idea behind conditional application is that you can “tag” a patch with a guard, which is simply a text string of your choosing, then tell MQ to select specific guards to use when applying patches. MQ will then either apply, or skip over, a guarded patch, depending on the guards that you have selected.