On 2008-09-17 17:09:46 +0100, Catalin Marinas wrote: > I'm still confused by this and I don't think your new flag would > help. The meaning of stop_before_conflict is that it won't push the > conflicting patch but actually leave the stack with several patches > pushed or popped. > > What I want for sink (and float afterwards) is by default to cancel > the whole transaction if there is a conflict and revert the stack to > it's original state prior to the "stg sink" command. 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) But with a better error message ... StackTransaction.abort() doesn't have much in the way of documentation, unfortunately, but what it does is to check out the tree we started with. (Nothing else is necessary, since we never touch any refs and stuff until the end of StackTransaction.run(). And the only case where we touch the tree is when we need to fall back to merge-recursive.) -- Karl Hasselström, kha@xxxxxxxxxxx www.treskal.com/kalle -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html