die "not on a TopGit-controlled branch"
-playground="$(mktemp -d)"
+playground="$(mktemp -d -t tg-export.XXXXXX)"
trap 'rm -rf "$playground"' EXIT
else
# First time hitting this dep; the common case
+ echo "Collapsing $_dep"
commit="$(collapsed_commit "$_dep")"
-
mkdir -p "$playground/$(dirname "$_dep")"
echo "$commit" >"$playground/$_dep"
- echo "Collapsed $_dep"
fi
# Propagate our work through the dependency chain
return
fi
+ echo "Exporting $_dep"
mkdir -p "$(dirname "$filename")"
tg patch "$_dep" >"$filename"
echo "$_dep.diff -p1" >>"$output/series"
- echo "Exported $_dep"
}
if [ "$driver" = "collapse" ]; then
[ -n "$output" ] ||
die "no target branch specified"
- ! git rev-parse --verify "$output" >/dev/null 2>&1 ||
+ ! ref_exists "$output" ||
die "target branch '$output' already exists; first run: git branch -D $output"
elif [ "$driver" = "quilt" ]; then
if [ "$driver" = "collapse" ]; then
- git update-ref "refs/heads/$output" "$(cat "$playground/$name")"
+ git update-ref "refs/heads/$output" "$(cat "$playground/$name")" ""
depcount="$(cat "$playground/^ticker" | wc -l)"
echo "Exported topic branch $name (total $depcount topics) to branch $output"