Transaction semantics for transplant and import

Matt Mackall mpm at selenic.com
Sat Oct 1 16:17:22 CDT 2011


On Sat, 2011-10-01 at 16:17 -0400, Greg Ward wrote:
> Hi folks --
> 
> my recent work on rollback has me thinking about import and
> transplant. Specifically, both currently just piggyback on commit's
> transaction semantics, so if you you use import/transplant to create
> multiple changesets, rollback only destroys the last one. And it says
> "undo commit" rather than "undo import" or "undo transplant".
> 
> This could be particularly annoying with "hg import --bypass", which
> doesn't update to the new tip:
> 
>   $ hg vers -q
>   Mercurial Distributed SCM (version 1.9.2+104-59e8bc22506e)
>   $ hg export 607 | hg import --bypass -
>   applying patch from stdin
>   $ hg rollback
>   abort: rollback of last commit while not checked out may lose data
> (use -f to force)
> 
> That's annoying: imports are not valuable like commits are. We should
> feel free to destroy that changeset without --force.
> 
> So my plan is to see if I can make 'import' create its own transaction
> around the entire sequence of imports. This is a behaviour change, but
> IMHO a good one: it means that rollback after importing multiple
> changesets would rollback the entire "hg import" command, not just the
> last bit. And it also means you would not have to "rollback -f" after
> "import --bypass"
> 
> Please let me know if you think this is a bad idea.

Seems reasonable.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list