Re: [StGit PATCH] Convert "sink" to the new infrastructure
- From
Karl Hasselström <kha@treskal.com>
- Date
- Sep 18, 2008, 15:47 UTC
- Message-ID
- <20080918154757.GA19868@diana.vm.bytemark.co.uk>
- In-Reply-To
- <b0943d9e0809180431x30c8f751g374732ee861ffe61@mail.gmail.com>
On 2008-09-18 12:31:35 +0100, Catalin Marinas wrote:
Show 18 quoted lines
> 2008/9/18 Karl Hasselström <kha@treskal.com>: > > > Ah, OK. Then I think you want something like this: > > > > try: > > trans.reorder_patches(applied, unapplied, hidden, iw) > > except transaction.TransactionHalted: > > if not options.conflict: > > trans.abort(iw) > > raise common.CmdException( > > 'Operation rolled back -- would result in conflicts') > > return trans.run(iw) > > I tried this before but trans.abort(iw) seems to check out the iw > index which is the one immediately after the push conflict, though > the stack is unmodified, i.e. stg status shows some missing files > (which are added by subsequent patches after the conflicting one) > and a conflict.
Hmm, strange. That's not what I thought it was supposed to do. Look at how coalesce uses it, for example.
Show 7 quoted lines
> Or simply give up on the --conflict option and always stop after the > conflict (catch the exception and don't re-raise it). This way we > don't have to bother with checking out the initial state. With the > "undo" command in your branch, people could simply revert the stack > to the state prior to the sink command. Maybe that's a good idea so > that we don't complicate commands further with different conflict > behaviours.
Yes, this is what every other command does, so it makes sense consistency-wise.
But I liked the idea of your "roll-back-in-case-of-conflicts" flag; it would be nice to have in many commands.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle