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

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 29, 2016, 11:32 p.m.
Message ID <5813e7cbfa39384f0fb0.1456788738@waste.org>
Download mbox | patch
Permalink /patch/13480/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - Feb. 29, 2016, 11:32 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1456787652 0
#      Mon Feb 29 23:14:12 2016 +0000
# Node ID 5813e7cbfa39384f0fb0dd190207665af4087afc
# 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 "max($1)" -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
+}