[PATCH 0 of 3] [RFC] Introducing patch.patchrepo()

Matt Mackall mpm at selenic.com
Sat Jun 11 14:56:13 CDT 2011


On Sat, 2011-06-11 at 15:20 +0200, Patrick Mezard wrote:
> This series introduces patch.patchrepo() to patch repositories without a
> working directory. This is a rebased version not including the currently
> rejected:
> 
>   http://selenic.com/pipermail/mercurial-devel/2011-June/032188.html
> 
> I have no better idea right now, so I will try to move forward with
> patchrepo(). The first two patches prepare patch.py and commands.py for the
> third one. I would like some feedback about the following points:
> 
> - patchrepo() signature is:
> 
>   patchrepo(ui, repo, ctx, store, patchobj, strip, files=None, eolmode='strict')
> 
> 'store' is a filestore() object receiving the patched files, and 'files' is a
> set receiving the list of patched files. It is required since removed files do
> not appear in 'store'. 'ctx' is the revision to patch against.
> 
> - patchrepo() output can be turned into a memctx using patch.makememctx(). The
>   only useful thing done by this function is wrapping a call to an editor
>   function like localrepo.commit() does.
> 
> - I needed a feature to test all this machinery and added the --no-update
>   option to the import command. Without --exact, it patches against the working
>   directory parent. With --exact it uses the parents list in the patch header if
>   any. This version is not very useful, you would expect it to have a --rev
>   option to specify parents to patch against.
> 
> Matt suggested to replace --no-update with --parents, which would do exactly
> this. The only problem is --parents would require at least one argument, and I
> do not see how to make it work cleanly with --exact. Ideas are welcome.

Fair enough, let's go with this set.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list