[PATCH] import: move tryone closure in cmdutil
Matt Mackall
mpm at selenic.com
Wed Feb 12 03:57:12 UTC 2014
On Tue, 2014-02-11 at 16:59 -0800, pierre-yves.david at ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1392166356 28800
> # Tue Feb 11 16:52:36 2014 -0800
> # Node ID 9b59241d45fcdc69a13459c0a90942b808faf69e
> # Parent 1478a9ce679097c03234201d179e48c58d0b5c1d
> import: move tryone closure in cmdutil
>
> We extract the `tryone` function into the `cmdutil` module. A lot fo the command
> context have to be passed to the utility function, but having and explicit
> declaration will allow extension to wrap it. This will allows use to make
> changeset evolution related experiment in dedicated extension.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -540,10 +540,124 @@ def service(opts, parentfn=None, initfn=
> os.close(logfilefd)
>
> if runfn:
> return runfn()
>
> +def tryimportone(ui, repo, hunk, parents, opts, msgs, updatefunc):
> + """Utility function used by commands.import to import a single patch
This is perhaps a bit too ugly as an API. Can we try to extract the core
"import a patch" function from this? At the very least, we should
document the horrendous args this accepts.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list