[PATCH 3 of 5] localrepo: add memcommit() to commit without working directory

Patrick Mézard pmezard at gmail.com
Sat Jun 14 17:13:50 CDT 2008


Matt Mackall a écrit :
> 
> Seems unfortunate to introduce a whole new type for this when we have
> something that's almost what's wanted.
> 
> Here's another approach: let's make commit take a context and then
> invent a new sort of context that we'd call a memctx. A memctx would be
> a subclass of a regular ctx with the ability to overlay various bits of
> it (parents, branch names, file flags and contents). 
> 
> So convert would take the context for the parent converted commit, make
> it a memctx, set it to have the appropriate parents, and also set the
> relevant file data and permissions. The latter two parts could actually
> be done with callbacks, so that we don't have to have entire changesets
> in memory.
> 
> This would also make it easy to kill the rawcommit concept.

I think I have a clearer view of what can be done here. The hard part emulating a changectx wrt to the convert extension is the converter_sources do not tell us about removed files until we try to access their data. I expect all sources can provide this information before accessing the files but it supposes a deep refactoring of the sources.

--
Patrick Mézard


More information about the Mercurial-devel mailing list