4171 partially apply without losing the associated metadata (author, |
4171 partially apply without losing the associated metadata (author, |
4172 date, description, ...). Note that when none of the hunk applies |
4172 date, description, ...). Note that when none of the hunk applies |
4173 cleanly, :hg:`import --partial` will create an empty changeset, |
4173 cleanly, :hg:`import --partial` will create an empty changeset, |
4174 importing only the patch metadata. |
4174 importing only the patch metadata. |
4175 |
4175 |
|
4176 It is possible to use external patch programs to perform the patch |
|
4177 by setting the ``ui.patch`` configuration option. |
|
4178 See :hg:`help config` for more information about configuration |
|
4179 files and how to use this option. |
|
4180 |
4176 To read a patch from standard input, use "-" as the patch name. If |
4181 To read a patch from standard input, use "-" as the patch name. If |
4177 a URL is specified, the patch will be downloaded from it. |
4182 a URL is specified, the patch will be downloaded from it. |
4178 See :hg:`help dates` for a list of formats valid for -d/--date. |
4183 See :hg:`help dates` for a list of formats valid for -d/--date. |
4179 |
4184 |
4180 .. container:: verbose |
4185 .. container:: verbose |
4195 |
4200 |
4196 - attempt to exactly restore an exported changeset (not always |
4201 - attempt to exactly restore an exported changeset (not always |
4197 possible):: |
4202 possible):: |
4198 |
4203 |
4199 hg import --exact proposed-fix.patch |
4204 hg import --exact proposed-fix.patch |
|
4205 |
|
4206 - use an external tool to apply a patch which is too fuzzy for |
|
4207 the default internal tool. |
|
4208 |
|
4209 hg import --config ui.patch="patch --merge" fuzzy.patch |
4200 |
4210 |
4201 Returns 0 on success, 1 on partial success (see --partial). |
4211 Returns 0 on success, 1 on partial success (see --partial). |
4202 """ |
4212 """ |
4203 |
4213 |
4204 if not patch1: |
4214 if not patch1: |