@@ -598,10 +598,11 @@ def tryimportone(ui, repo, hunk, parents
strip = opts["strip"]
sim = float(opts.get('similarity') or 0)
if not tmpname:
return (None, None, False)
msg = _('applied to working directory')
+ extra = {}
rejects = False
try:
cmdline_message = logmessage(ui, opts)
@@ -674,28 +675,30 @@ def tryimportone(ui, repo, hunk, parents
n = repo.commit(message, opts.get('user') or user,
opts.get('date') or date, match=m,
editor=editor, force=partial)
else:
if opts.get('exact') or opts.get('import_branch'):
- branch = branch or 'default'
+ extra['branch'] = branch or 'default'
else:
- branch = p1.branch()
+ extra['branch'] = p1.branch()
store = patch.filestore()
try:
files = set()
try:
patch.patchrepo(ui, repo, p1, store, tmpname, strip,
files, eolmode=None)
except patch.PatchError, e:
raise util.Abort(str(e))
editor = getcommiteditor(editform='import.bypass')
- memctx = context.makememctx(repo, (p1.node(), p2.node()),
- message,
- opts.get('user') or user,
- opts.get('date') or date,
- branch, files, store,
- editor=editor)
+ memctx = context.memctx(repo, (p1.node(), p2.node()),
+ message,
+ files,
+ store,
+ opts.get('user') or user,
+ opts.get('date') or date,
+ extra,
+ editor=getcommiteditor())
n = memctx.commit()
finally:
store.close()
if opts.get('exact') and hex(n) != nodeid:
raise util.Abort(_('patch is damaged or loses information'))