chiark / gitweb /
Avoid contrib/stg-swallow deleting unrelated empty patches.
authorYann Dirson <ydirson@altern.org>
Sat, 5 May 2007 13:58:07 +0000 (15:58 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 14 May 2007 21:21:00 +0000 (22:21 +0100)
Let's just check ourselves if the patch is empty after pushing instead
of using clean: no more surprise with patches getting abusively
cleaned, and we should now be faster when there are many unapplied
patches.

Signed-off-by: Yann Dirson <ydirson@altern.org>
contrib/stg-swallow

index 5014f39f9deaf7bef0ee6bf35c77483eae5bd8ea..924c079f678afda7b75e6a529d74e1745a7bf499 100755 (executable)
@@ -15,5 +15,9 @@ patch="$1"
 stg pick --fold "$patch"
 stg refresh
 stg push "$patch"
 stg pick --fold "$patch"
 stg refresh
 stg push "$patch"
+
 #stg clean "$patch"
 #stg clean "$patch"
-stg pop; stg clean -u
+#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"