Normally, Mercurial will abort if I have a dirty working copy when I try to import a patch:
$ hg import x.patch
abort: outstanding uncommitted changes
Is it possible to import it anyway?
With Mercurial 1.9, you can use hg import --bypass
to apply a patch without touching the working copy. The patch will be applied on the working copy parent revision by default. Use the --exact
flag to apply the patch onto the changeset mentioned in the patch header instead.