[PATCH 4 of 5 V2] cmdutil: call memctx directly instead of makememctx
Sean Farley
sean.michael.farley at gmail.com
Wed Aug 6 23:20:25 UTC 2014
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1402871026 25200
# Sun Jun 15 15:23:46 2014 -0700
# Node ID dd995b3276747e0ceab33a4cddaf4e3dbcd4a877
# Parent e0a761486fd816bb7baab8645f6c44c64e0489ef
cmdutil: call memctx directly instead of makememctx
Now that a memctx can take a store-type object directly, let's use that instead
of makememctx.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -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'))
More information about the Mercurial-devel
mailing list