Alex Rivera | Logout

Can I import a patch without touching the working directory?

Asked 2011-12-15T14:39:48.267
9

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?

Edit
Report

1 Answer

10

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.

answered 2011-12-15T14:40:18.347

Your Answer