docs/tutorial/testlib/common.sh
author Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
Sun, 03 Feb 2019 17:03:02 +0530
changeset 4391 054ff759f2fd
parent 3376 aad37ffd7d58
permissions -rw-r--r--
pick: add --tool for hg pick to specify mergetool This patch used configuration override to enable you to pass a mergetool via the --tool flag in case there is any merge conflict.

#!/bin/bash
. $TESTDIR/testlib/pythonpath.sh

mkcommit() {
   echo "$1" > "$1"
   hg add "$1"
   hg ci -m "$1"
}

getid() {
   hg log --hidden --template '{node}\n' --rev "$1"
}

cat >> $HGRCPATH <<EOF
[alias]
debugobsolete=debugobsolete -d '0 0'
EOF

html_output() {
    filepath="$1"
    touch "$filepath"
    shift

    python $TESTDIR/testlib/arguments_printer.py 'hg' "$@" > "$filepath"
    hg "$@" --color=always 2>&1 | aha -n | tee -a "$filepath"
}

html_raw_output() {
    filepath="$1"
    touch "$filepath"
    shift

    # python $TESTDIR/testlib/arguments_printer.py "$@" > "$filepath"
    echo "" > "$filepath"
    "$@" | tee -a "$filepath"
}

graph() {
    hg docgraph --rankdir LR --arrowhead=true --obsarrowhead=true --sphinx-directive --dot-output "$@"
}