@@ -11,12 +11,24 @@ Usage: ${tgname:-tg} [...] export [--collapse] [--force] [<option>...] <newbranc
1111 Or: ${tgname:- tg} [...] export --quilt [--force] [-a | --all | -b <branch>...]
1212 [--binary] [--flatten] [--numbered] [--strip[=N]] <directory>
1313 Or: ${tgname:- tg} [...] export --rebase --from-to <old_base> <new_base>
14- [--prefix <prefix>] [--drop-prefix <prefix>]
14+ [--prefix <prefix>] [--drop-prefix <prefix>] -b <branch> -b <branch>
1515 rebase topgit branches from old_base to new_base.
1616 This is useful if you need to maintain topgit
1717 branches on multiple releases of a project
18- Example: tg export --from-to release-1.0 release-1.1
19- --prefix release-1.1-topgit-patches/ --drop-prefix release-1.0-topgit-patches/
18+ Example:
19+ 2) Assuming the old base is release-1.0 the new base will be release-1.1
20+ the old topic branches have been prefixed by release-1.0-topgit-patches/
21+ and new topic branches should be prefixed by release-1.1-topgit-patches/
22+ start the rebase with
23+
24+ tg export --from-to release-1.0 release-1.1 \
25+ --drop-prefix release-1.0-topgit-patches/ \
26+ --prefix release-1.1-topgit-patches/ \
27+ release-1.0-topgit-patches/topic-summing-up-other-topics
28+
29+ Looks like there is still a problem with the
30+ final tg create. Just exit shell/ignore and
31+ run tg update yourself to see it worked (?)
2032
2133Options:
2234 -s <mode> set subject bracketed [strings] strip mode
@@ -113,12 +125,11 @@ while [ -n "$1" ]; do
113125 --from-to)
114126 declare -A REBASE_FROM_TO
115127 REBASE_FROM_TO[" $1 " ]=" $2 "
116- shift ; shift ;;
128+ shift 2 ;;
117129 --drop-prefix)
118130 REBASE_DROP_PREFIX=" $1 " ; shift ;;
119131 --prefix)
120132 REBASE_PREFIX=" $1 " ; shift ;;
121-
122133 --quilt)
123134 driver=quilt;;
124135 --collapse)
@@ -171,7 +182,10 @@ if [ "$driver" != "quilt" ]; then
171182 fi
172183fi
173184
174- if [ " $driver " != " rebase" ]; then
185+ if [ " $driver " == " rebase" ]; then
186+ name=$output
187+ output=
188+ else
175189 if [ -n " $REBASE_FROM_TO " -o -n " $REBASE_DROP_PREFIX " -o -n " $REBASE_PREFIX " ]; then
176190 die " --onto and --drop-prefix can only be used in --rebase mode"
177191 fi
@@ -207,7 +221,7 @@ if [ "$driver" = "linearize" ]; then
207221 fi
208222fi
209223
210- if [ -z " $branches " ] && [ -z " $allbranches " ]; then
224+ if [ -z " $branches " ] && [ -z " $allbranches " ] && [ " $driver " != " rebase " ] ; then
211225 # this check is only needed when no branches have been passed
212226 v_verify_topgit_branch name HEAD
213227fi
469483 git show " $_dep " :.topmsg > $playground /.topmsg
470484 echo " creating topgit branch $new_branch_name with deps ${target_deps[@]} "
471485 git checkout " ${target_deps[0]} " || die 'checking out failed'
472- tg create --topmsg-file $playground /.topmsg -m " new tg branch $new_branch_name " " ${new_branch_name} " " ${target_deps[@]} " || {
486+ # sourcing tg-create doesn't work cause it calls exit
487+ " $TG_INST_CMDDIR " /../../bin/tg create --topmsg-file $playground /.topmsg -m " new tg branch $new_branch_name " " ${new_branch_name} " " ${target_deps[@]} " || {
473488 echo 'tg create failed';
474489 " ${SHELL:-@ SHELL_PATH@ } " -i </dev/tty || { echo " user abort" ; return ; }
475490 }
0 commit comments