From: Karl =?iso-8859-1?Q?Hasselstr=F6m?= Subject: Re: [StGit PATCH] Convert "sink" to the new infrastructure Date: Thu, 18 Sep 2008 17:47:57 +0200 Message-ID: <20080918154757.GA19868@diana.vm.bytemark.co.uk> References: <20080914085118.GC30664@diana.vm.bytemark.co.uk> <20080915075740.GB14452@diana.vm.bytemark.co.uk> <20080916074024.GA2454@diana.vm.bytemark.co.uk> <20080916193647.GA12513@diana.vm.bytemark.co.uk> <20080918072450.GB12550@diana.vm.bytemark.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: git@vger.kernel.org To: Catalin Marinas X-From: git-owner@vger.kernel.org Thu Sep 18 17:27:14 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1KgLPR-0007id-Lx for gcvg-git-2@gmane.org; Thu, 18 Sep 2008 17:27:10 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754236AbYIRPZ7 convert rfc822-to-quoted-printable (ORCPT ); Thu, 18 Sep 2008 11:25:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754128AbYIRPZ7 (ORCPT ); Thu, 18 Sep 2008 11:25:59 -0400 Received: from diana.vm.bytemark.co.uk ([80.68.90.142]:2321 "EHLO diana.vm.bytemark.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754219AbYIRPZ6 (ORCPT ); Thu, 18 Sep 2008 11:25:58 -0400 Received: from kha by diana.vm.bytemark.co.uk with local (Exim 3.36 #1 (Debian)) id 1KgLjZ-0005CA-00; Thu, 18 Sep 2008 16:47:57 +0100 Content-Disposition: inline In-Reply-To: X-Manual-Spam-Check: kha@treskal.com, clean User-Agent: Mutt/1.5.9i Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On 2008-09-18 12:31:35 +0100, Catalin Marinas wrote: > 2008/9/18 Karl Hasselstr=F6m : > > > 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. > 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. --=20 Karl Hasselstr=F6m, kha@treskal.com www.treskal.com/kalle