File: stg-swallow

package info (click to toggle)
stgit 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,752 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (23 lines) | stat: -rwxr-xr-x 620 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -e

# stg-swallow - completely merge an unapplied patch into current one

# Copyright (c) 2006-2007 Yann Dirson <ydirson@altern.org>
# Subject to the GNU GPL, version 2.

# FIXME:
# - should provide support for conflict solving ?

[ "$#" = 1 ] || { echo >&2 "Usage: $(basename $0) <patch>"; exit 1; }
patch="$1"

stg pick --fold "$patch"
stg refresh
stg push "$patch"

#stg clean "$patch"
#stg pop; stg clean -u
[ $(stg id "$patch//top") != $(stg id "$patch//bottom") ] ||
    { echo >&2 "Assertion failed: patch '$patch' is not empty after swallowing, not deleting it."; exit 1; }    
stg delete "$patch"