chiark / gitweb /
Fix removal of series to nuke the formatversion config item.
[stgit] / contrib / stg-swallow
CommitLineData
dee3cbb2
YD
1#!/bin/sh
2set -e
3
4# stg-swallow - completely merge an unapplied patch into current one
5
6# Copyright (c) 2006-2007 Yann Dirson <ydirson@altern.org>
7# Subject to the GNU GPL, version 2.
8
9# FIXME:
10# - should provide support for conflict solving ?
11
12[ "$#" = 1 ] || { echo >&2 "Usage: $(basename $0) <patch>"; exit 1; }
13patch="$1"
14
15stg pick --fold "$patch"
16stg refresh
17stg push "$patch"
5fe419ab 18
dee3cbb2 19#stg clean "$patch"
5fe419ab
YD
20#stg pop; stg clean -u
21[ $(stg id "$patch//top") != $(stg id "$patch//bottom") ] ||
22 { echo >&2 "Assertion failed: patch '$patch' is not empty after swallowing, not deleting it."; exit 1; }
23stg delete "$patch"