- tr "." "\n" | tac | tr "\n" ".")
- branch_name="$reverse_hostname$file_basename"
- reponame_with_ext="$file_basename.monotone"
- mtn db init -d "$repodir/$reponame_with_ext"
- mtn setup -d "$repodir/$reponame_with_ext" -b "$branch_name" "$srcdir"
+ tr "." "\n" | ( tac 2>/dev/null || tail -r ) | tr "\n" "." )
+ branch_name="$reverse_hostname$cleaned_srcdir"
+ mtn setup -d "$repository" -b "$branch_name" "$srcdir"
+