Show More
@@ -688,6 +688,9 b' def tryimportone(ui, repo, hunk, parents' | |||
|
688 | 688 | else: |
|
689 | 689 | m = scmutil.matchfiles(repo, files or []) |
|
690 | 690 | editform = mergeeditform(repo[None], 'import.normal') |
|
691 | if opts.get('exact'): | |
|
692 | editor = None | |
|
693 | else: | |
|
691 | 694 | editor = getcommiteditor(editform=editform, **opts) |
|
692 | 695 | n = repo.commit(message, opts.get('user') or user, |
|
693 | 696 | opts.get('date') or date, match=m, |
@@ -705,6 +708,9 b' def tryimportone(ui, repo, hunk, parents' | |||
|
705 | 708 | files, eolmode=None) |
|
706 | 709 | except patch.PatchError, e: |
|
707 | 710 | raise util.Abort(str(e)) |
|
711 | if opts.get('exact'): | |
|
712 | editor = None | |
|
713 | else: | |
|
708 | 714 | editor = getcommiteditor(editform='import.bypass') |
|
709 | 715 | memctx = context.makememctx(repo, (p1.node(), p2.node()), |
|
710 | 716 | message, |
@@ -226,6 +226,25 b' Test applying multiple patches with --ex' | |||
|
226 | 226 | |
|
227 | 227 | $ cd .. |
|
228 | 228 | |
|
229 | Test avoiding editor invocation at applying the patch with --exact | |
|
230 | even if commit message is empty | |
|
231 | ||
|
232 | $ cd repo-options | |
|
233 | ||
|
234 | $ echo a >> a | |
|
235 | $ hg commit -m ' ' | |
|
236 | $ hg tip -T "{node}\n" | |
|
237 | 1b77bc7d1db9f0e7f1716d515b630516ab386c89 | |
|
238 | $ hg export -o ../empty-log.diff . | |
|
239 | $ hg update -q -C ".^1" | |
|
240 | $ hg --config extensions.strip= strip -q tip | |
|
241 | $ HGEDITOR=cat hg import --exact --bypass ../empty-log.diff | |
|
242 | applying ../empty-log.diff | |
|
243 | $ hg tip -T "{node}\n" | |
|
244 | 1b77bc7d1db9f0e7f1716d515b630516ab386c89 | |
|
245 | ||
|
246 | $ cd .. | |
|
247 | ||
|
229 | 248 |
|
|
230 | 249 |
|
|
231 | 250 | Test complicated patch with --exact |
@@ -107,6 +107,22 b" the commit message, regardless of '--edi" | |||
|
107 | 107 | HG: changed a |
|
108 | 108 | abort: empty commit message |
|
109 | 109 | [255] |
|
110 | ||
|
111 | Test avoiding editor invocation at applying the patch with --exact, | |
|
112 | even if commit message is empty | |
|
113 | ||
|
114 | $ echo a >> b/a | |
|
115 | $ hg --cwd b commit -m ' ' | |
|
116 | $ hg --cwd b tip -T "{node}\n" | |
|
117 | d8804f3f5396d800812f579c8452796a5993bdb2 | |
|
118 | $ hg --cwd b export -o ../empty-log.diff . | |
|
119 | $ hg --cwd b update -q -C ".^1" | |
|
120 | $ hg --cwd b --config extensions.strip= strip -q tip | |
|
121 | $ HGEDITOR=cat hg --cwd b import --exact ../empty-log.diff | |
|
122 | applying ../empty-log.diff | |
|
123 | $ hg --cwd b tip -T "{node}\n" | |
|
124 | d8804f3f5396d800812f579c8452796a5993bdb2 | |
|
125 | ||
|
110 | 126 | $ rm -r b |
|
111 | 127 | |
|
112 | 128 |
General Comments 0
You need to be logged in to leave comments.
Login now