From: Niko Tyni Date: Thu, 20 Nov 2008 08:12:13 +0000 (+0200) Subject: Use the topological order when exporting explicitly listed branches. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=commitdiff_plain;h=538f91a77a5c629e1d25244a3a84d03aedbb9709 Use the topological order when exporting explicitly listed branches. When exporting explicitly listed branches (tg export -b), the branch dependencies were not taken into account. Signed-off-by: martin f. krafft Tested-by: martin f. krafft --- diff --git a/.topmsg b/.topmsg index 2da2505..c3b9247 100644 --- a/.topmsg +++ b/.topmsg @@ -6,4 +6,8 @@ not, when really -b should just default to the name of the current branch. -b could also make sense with the collapse driver. +Debian bug: #506284 +Credits: Niko Tyni for spotting the bug and sending an + initial fix. + Signed-off-by: martin f. krafft diff --git a/tg-export.sh b/tg-export.sh index 52af88d..037b991 100644 --- a/tg-export.sh +++ b/tg-export.sh @@ -181,9 +181,9 @@ if [ -z "$branches" ]; then recurse_deps driver "$name" (_ret=0; _dep="$name"; _name=""; _dep_is_tgish=1; driver) else - echo "$branches" | tr ',' '\n' | while read _dep; do - _dep_is_tgish=1 - $driver + echo "$branches" | tr ',' '\n' | while read name; do + recurse_deps driver "$name" + (_ret=0; _dep="$name"; _name=""; _dep_is_tgish=1; driver) done name="$(echo "$branches" | sed 's/.*,//')" fi