build: improve GIT_CONF_SUBST signature
[gitweb.git] / t / lib-git-p4.sh
index 31d75ae0434221ba50f805eee718b910a9cf677a..d748c36df596b640d403626fce3200d85d68253b 100644 (file)
@@ -102,3 +102,33 @@ cleanup_git() {
        rm -rf "$git" &&
        mkdir "$git"
 }
+
+marshal_dump() {
+       what=$1 &&
+       line=${2:-1} &&
+       cat >"$TRASH_DIRECTORY/marshal-dump.py" <<-EOF &&
+       import marshal
+       import sys
+       for i in range($line):
+           d = marshal.load(sys.stdin)
+       print d['$what']
+       EOF
+       "$PYTHON_PATH" "$TRASH_DIRECTORY/marshal-dump.py"
+}
+
+#
+# Construct a client with this list of View lines
+#
+client_view() {
+       (
+               cat <<-EOF &&
+               Client: client
+               Description: client
+               Root: $cli
+               View:
+               EOF
+               for arg ; do
+                       printf "\t$arg\n"
+               done
+       ) | p4 client -i
+}