Patchwork [1,of,2] tests: introduce helper commands for histedit

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 29, 2016, 11:08 p.m.
Message ID <92cdfcfa8fcea1fcda0f.1456787282@waste.org>
Download mbox | patch
Permalink /patch/13478/
State Superseded
Headers show

Comments

timeless@mozdev.org - Feb. 29, 2016, 11:08 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1456785265 0
#      Mon Feb 29 22:34:25 2016 +0000
# Node ID 92cdfcfa8fcea1fcda0f1ab762d0c23835dd7213
# Parent  41dcd754526612c43b9695df8851557c851828ef
tests: introduce helper commands for histedit

plan -- starts a plan

the following are histedit verbs and take a REV:
base
drop
edit
fold
mess
pick
roll

internal use:
short REV -- picks a hash
step ACTION REV -- perform an action

Patch

diff --git a/tests/histedit-helpers.sh b/tests/histedit-helpers.sh
--- a/tests/histedit-helpers.sh
+++ b/tests/histedit-helpers.sh
@@ -5,3 +5,44 @@ 
         grep -v "e: No such file or directory" | \
     cat
 }
+
+PLAN=../plan
+plan() {
+    cp /dev/null $PLAN
+}
+
+short() {
+    hg log -r "reverse($1)" -l1 -T '{node|short}'
+}
+
+step() {
+    echo $1 `short $2` >> $PLAN
+}
+
+base() {
+    step base $1
+}
+
+drop() {
+    step drop $1
+}
+
+edit() {
+    step edit $1
+}
+
+fold() {
+    step fold $1
+}
+
+mess() {
+    step mess $1
+}
+
+pick() {
+    step pick $1
+}
+
+roll() {
+    step roll $1
+}