Files
poky/meta/recipes-devtools/guilt/files/guilt-pop.patch
Richard Purdie 29d6678fd5 Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things
and is generally overwhelming. This commit splits it into several
logical sections roughly based on function, recipes.txt gives more
information about the classifications used.

The opportunity is also used to switch from "packages" to "recipes"
as used in OpenEmbedded as the term "packages" can be confusing to
people and has many different meanings.

Not all recipes have been classified yet, this is just a first pass
at separating things out. Some packages are moved to meta-extras as
they're no longer actively used or maintained.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-27 15:29:45 +01:00

72 lines
1.7 KiB
Diff

guilt: pop and delete tags
Add support for popping to a tag and the ability to delete
a tag while popping from the tree
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
guilt-pop | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
--- a/guilt-pop
+++ b/guilt-pop
@@ -17,6 +17,13 @@ while [ $# -gt 0 ]; do
-n)
num=t
;;
+ -t|--t)
+ tag=$2
+ shift
+ ;;
+ -d|--d) # can only be used with --t
+ delete_tag=t
+ ;;
*)
break
;;
@@ -24,7 +31,7 @@ while [ $# -gt 0 ]; do
shift
done
-# "guilt-pop" or "guilt-pop foo" or "guilt-pop -n foo"
+# "guilt-pop" or "guilt-pop foo" or "guilt-pop -n foo" or "guilt-pop -t <tag>"
if [ -z "$all" ] && [ $# -gt 1 ]; then
usage
fi
@@ -44,12 +51,26 @@ fi
patch="$1"
[ ! -z "$all" ] && patch="-a"
+
+# tag processing will just roll into another one of
+# the pop types, number or patch name
+if [ ! -z "$tag" ]; then
+ git-rev-list HEAD ^$tag > /dev/null 2>/dev/null
+ if [ $? -eq 0 ]; then
+ revs="`git-rev-list HEAD ^$tag`"
+ num=`echo "$revs" | wc -l`
+ patch=$num
+ else
+ echo "Cannot find tag $tag";
+ exit 0
+ fi
+fi
+
if [ ! -s "$applied" ]; then
disp "No patches applied."
exit 0
elif [ "$patch" = "-a" ]; then
# we are supposed to pop all patches
-
sidx=`wc -l < $applied`
eidx=0
elif [ ! -z "$num" ]; then
@@ -96,3 +117,6 @@ pop_many_patches `git rev-parse refs/pat
p=`get_top`
[ ! -z "$p" ] && disp "Now at $p." || disp "All patches popped."
+if [ ! -z "$delete_tag" ]; then
+ git tag -d $tag
+fi;