chiark / gitweb /
stg coalesce: Support --file and --save-template
authorKarl Hasselström <kha@treskal.com>
Wed, 12 Dec 2007 20:08:46 +0000 (21:08 +0100)
committerKarl Hasselström <kha@treskal.com>
Wed, 9 Jan 2008 23:37:13 +0000 (00:37 +0100)
commitd568af721e596af12d0cde961da0030cbb43f3f0
tree207a9ccb8fa9cac13e75d1020938f831d37a31e4
parent59032ccd3656bbbdf53741bab4ccd2dc69356f04
stg coalesce: Support --file and --save-template

--save-template was a bit tricky, because we want that

  * if we reached the stage where the message is needed without
    conflicts, the message should be written and no other side effects
    should occur; but

  * if we run into conflicts before reaching that point, behave just
    as if --save-template was not given.

This makes this script

  stg coalesce --save-template <patches>
  if template was saved:
    let user edit template
    if user didn't abort:
      stg coalesce --file <patches>

equivalent to

  stg coalesce <patches>

with the added benefit that the user can abort the whole thing without
visible side effects.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/coalesce.py