[PATCH 2 of 6] buildrpm: warn if there is outstanding uncommitted changes

Gilles Moris gilles.moris at free.fr
Mon Nov 9 03:21:43 CST 2009


 contrib/buildrpm |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


# HG changeset patch
# User Gilles Moris <gilles.moris at free.fr>
# Date 1257496218 -3600
# Node ID 70caa4aaceb43e12707e262d9c542ab1131db834
# Parent  244a4475d7800c164d86c68056848185792f0dfc
buildrpm: warn if there is outstanding uncommitted changes

diff --git a/contrib/buildrpm b/contrib/buildrpm
--- a/contrib/buildrpm
+++ b/contrib/buildrpm
@@ -21,6 +21,14 @@
     exit 1
 fi
 
+if $HG id -i | grep '+$' > /dev/null 2>&1; then
+    echo -n "Your local changes will NOT be in the RPM. Continue [y/n] ? "
+    read answer
+    if echo $answer | grep -iv '^y'; then
+        exit
+    fi
+fi
+
 rpmdir=/tmp/"`basename $root | sed 's/ /_/'`"-rpm # FIXME: Insecure /tmp handling
 
 cd "$root"


More information about the Mercurial-devel mailing list