From: "Catalin Marinas" <catalin.marinas@gmail.com>
To: "Karl Hasselström" <kha@treskal.com>
Cc: git@vger.kernel.org
Subject: Re: [StGit PATCH] Convert "sink" to the new infrastructure
Date: Thu, 18 Sep 2008 12:31:35 +0100 [thread overview]
Message-ID: <b0943d9e0809180431x30c8f751g374732ee861ffe61@mail.gmail.com> (raw)
In-Reply-To: <20080918072450.GB12550@diana.vm.bytemark.co.uk>
2008/9/18 Karl Hasselström <kha@treskal.com>:
> 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)
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.
What I would need is a way to save the original iw and and run
trans.abort(iw_original).
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.
--
Catalin
next prev parent reply other threads:[~2008-09-18 11:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 22:01 [StGit PATCH] Convert "sink" to the new infrastructure Catalin Marinas
2008-09-14 8:51 ` Karl Hasselström
2008-09-14 21:19 ` Catalin Marinas
2008-09-15 7:57 ` Karl Hasselström
2008-09-15 16:44 ` Catalin Marinas
2008-09-16 7:40 ` Karl Hasselström
2008-09-16 14:59 ` Catalin Marinas
2008-09-16 19:36 ` Karl Hasselström
2008-09-17 11:55 ` Catalin Marinas
2008-09-17 13:04 ` Karl Hasselström
2008-09-17 13:09 ` Karl Hasselström
2008-09-17 16:01 ` Catalin Marinas
2008-09-18 7:10 ` Karl Hasselström
2008-09-18 11:24 ` Catalin Marinas
2008-09-17 16:09 ` Catalin Marinas
2008-09-18 7:24 ` Karl Hasselström
2008-09-18 11:31 ` Catalin Marinas [this message]
2008-09-18 15:47 ` Karl Hasselström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0943d9e0809180431x30c8f751g374732ee861ffe61@mail.gmail.com \
--to=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=kha@treskal.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).