##// END OF EJS Templates
import: avoid editor invocation when importing with "--exact" for exact-ness...
FUJIWARA Katsunori -
r22278:ffaaa80f default
parent child Browse files
Show More
@@ -688,7 +688,10 b' def tryimportone(ui, repo, hunk, parents'
688 else:
688 else:
689 m = scmutil.matchfiles(repo, files or [])
689 m = scmutil.matchfiles(repo, files or [])
690 editform = mergeeditform(repo[None], 'import.normal')
690 editform = mergeeditform(repo[None], 'import.normal')
691 editor = getcommiteditor(editform=editform, **opts)
691 if opts.get('exact'):
692 editor = None
693 else:
694 editor = getcommiteditor(editform=editform, **opts)
692 n = repo.commit(message, opts.get('user') or user,
695 n = repo.commit(message, opts.get('user') or user,
693 opts.get('date') or date, match=m,
696 opts.get('date') or date, match=m,
694 editor=editor, force=partial)
697 editor=editor, force=partial)
@@ -705,7 +708,10 b' def tryimportone(ui, repo, hunk, parents'
705 files, eolmode=None)
708 files, eolmode=None)
706 except patch.PatchError, e:
709 except patch.PatchError, e:
707 raise util.Abort(str(e))
710 raise util.Abort(str(e))
708 editor = getcommiteditor(editform='import.bypass')
711 if opts.get('exact'):
712 editor = None
713 else:
714 editor = getcommiteditor(editform='import.bypass')
709 memctx = context.makememctx(repo, (p1.node(), p2.node()),
715 memctx = context.makememctx(repo, (p1.node(), p2.node()),
710 message,
716 message,
711 opts.get('user') or user,
717 opts.get('user') or user,
@@ -226,6 +226,25 b' Test applying multiple patches with --ex'
226
226
227 $ cd ..
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 #if symlink execbit
248 #if symlink execbit
230
249
231 Test complicated patch with --exact
250 Test complicated patch with --exact
@@ -107,6 +107,22 b" the commit message, regardless of '--edi"
107 HG: changed a
107 HG: changed a
108 abort: empty commit message
108 abort: empty commit message
109 [255]
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 $ rm -r b
126 $ rm -r b
111
127
112
128
General Comments 0
You need to be logged in to leave comments. Login now