ooo-build r13141 - in trunk: . bin



Author: jannieuw
Date: Thu Jul 10 08:35:13 2008
New Revision: 13141
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13141&view=rev

Log:
2008-07-10  Jan Nieuwenhuizen  <janneke gnu org>

	* bin/gob-bump: Support continuing of partly handled bump.


Modified:
   trunk/ChangeLog
   trunk/bin/gob-bump

Modified: trunk/bin/gob-bump
==============================================================================
--- trunk/bin/gob-bump	(original)
+++ trunk/bin/gob-bump	Thu Jul 10 08:35:13 2008
@@ -6,6 +6,7 @@
 OPTIONS_SPEC="\
 gob-bump [options] <branch> <tag>
 --
+continue             continue from previous run
 distro=              use branches for distro
 apply-dir=           use apply-dir
 
@@ -16,12 +17,16 @@
 . git-sh-setup
 
 parse_config () {
-	while test $# != 0; do
+	while test $# != 0
+	 do
 		case "$1" in
 		--apply-dir)
 			shift
 			apply_dir=$1
 			;;
+		--continue)
+			continue=t
+			;;
 		--distro)
 			shift
 			distro=$1
@@ -34,7 +39,6 @@
 		shift
 	done
 	args_left=$#
-	echo args_left=$args_left
 }
 
 test $# != 0 || usage
@@ -50,40 +54,50 @@
 # setup
 this_branch=$(git-branch | grep '^\*' | sed -e 's/^\* //')
 
-gob_bases=$(git-tag | grep '^gob-')
+gob_bases=$(git-tag | grep '^gob-'; true)
 if test -z "$gob_bases"
 then
 	echo 'cannot find any gob-* tag, aborting'  1>&2
 	exit 1
 fi
 
-# find the last unpatched version and create a 'reset' commit
-# (actually this is one commit after that, we'll use ${one_ofter}^ to get
-# the right one)
-one_after=$(git-rev-list $this_branch --not $gob_bases | tail -n 1)
+# second run, tag already set?
+the_tag=$(git-tag | grep "^$new_tag\$"; true)
 
-# reset to the state of the last gob tag
-if test -n "$one_after"
+if test -n "$the_tag" -a -z "$continue"
 then
-	temp_branch=$(mktemp $(echo temp.$this_branch.XXXXXXXXXX | tr '/' '-'))
-	rm $temp_branch
-	git-checkout -b $temp_branch ${one_after}^
-	git-reset --soft $this_branch
-	git-commit -m 'Changes reverted to the last gob tag.' -a
-	git-checkout $this_branch
-	if git-merge $temp_branch
+	echo "TAG: \`$the_tag' already exists, specify new tag or use --continue" 1>&2
+	exit 1
+elif test -z "$the_tag"
+then
+	# find the last unpatched version and create a 'reset' commit
+	# (actually this is one commit after that, we'll use ${one_ofter}^ to get
+	# the right one)
+	one_after=$(git-rev-list $this_branch --not $gob_bases | tail -n 1)
+
+	# reset to the state of the last gob tag
+	if test -n "$one_after"
 	then
-		git-branch -d $temp_branch
-	else
-		echo "Reverting changes failed." 1>&2
-		exit 1
+		temp_branch=$(mktemp $(echo temp.$this_branch.XXXXXXXXXX | tr '/' '-'))
+		rm $temp_branch
+		git-checkout -b $temp_branch ${one_after}^
+		git-reset --soft $this_branch
+		git-commit -m 'Changes reverted to the last gob tag.' -a
+		git-checkout $this_branch
+		if git-merge $temp_branch
+		then
+			git-branch -d $temp_branch
+		else
+			echo "Reverting changes failed." 1>&2
+			exit 1
+		fi
 	fi
+	
+	# get the newest changes and tag the tip
+	git-merge $new_changes
+	git-tag $new_tag
 fi
 
-# get the newest changes and tag the tip
-git-merge $new_changes
-git-tag $new_tag
-
 # update the branches
 if test -z "$apply_dir"
 then
@@ -98,8 +112,15 @@
 	branches="$(gob --apply-dir=$apply_dir --distro=$distro branches)"
 fi
 broken='layout-plugin'
-echo "$branches" | grep -Ev $broken | while read branch
+bumped=$(git branch | grep bumped/ | sed -e s'@bumped/@@' | tr -d ' ' | tr '\n' '|' | sed -e s'@|$@@')
+if test -n "$bumped" -a -z "$continue"
+then
+	echo 'bumped/* branches found, delete them or use --continue' 1>&2
+	exit 1
+fi
+echo "$branches" | grep -Ev "^(${broken}|${bumped})\$" | while read branch
 do
+	echo "Bumping: $branch"
 	temp_branch=$(mktemp fixme.$branch.XXXXXXXXXX)
 	rm $temp_branch
 	git-checkout -b $temp_branch origin/$branch



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]