diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t --- a/tests/test-histedit-commute.t +++ b/tests/test-histedit-commute.t @@ -79,7 +79,7 @@ show the edit commands offered 0 files updated, 0 files merged, 0 files removed, 0 files unresolved edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 3 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -134,7 +134,7 @@ put things back > pick b069cc29fb22 e > pick 26f6a030ae82 f > EOF - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 3 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -181,7 +181,7 @@ slightly different this time > pick e860deea161a e > pick 177f92b77385 c > EOF - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 4 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -227,7 +227,7 @@ keep prevents stripping dead revs > pick 99a62755c625 c > pick 7c6fdd608667 e > EOF - $ HGEDITOR="cat $EDITED > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-histedit-drop.t b/tests/test-histedit-drop.t --- a/tests/test-histedit-drop.t +++ b/tests/test-histedit-drop.t @@ -61,7 +61,7 @@ log before edit edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 4 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -61,7 +61,7 @@ log before edit edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved abort: Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. @@ -118,7 +118,7 @@ commit, then edit the revision $ cat > $EDITED < edit bf757c081cd0 f > EOF - $ HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle 0 files updated, 0 files merged, 1 files removed, 0 files unresolved abort: Make changes as needed, you may commit or record as needed now. When you are finished, run hg histedit --continue to resume. @@ -139,12 +139,10 @@ log after edit say we'll change the message, but don't. $ cat > ../edit.sh < #!/bin/sh - > cat \$1 | sed s/pick/mess/ > tmp - > mv tmp \$1 + > cat "\$1" | sed s/pick/mess/ > tmp + > mv tmp "\$1" > EOF - $ chmod +x ../edit.sh - $ HGEDITOR="../edit.sh" hg histedit tip 2>&1 | fixbundle + $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status @@ -160,7 +158,7 @@ modify the message $ cat > $EDITED < mess bf757c081cd0 f > EOF - $ HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status diff --git a/tests/test-histedit-fold-non-commute.t b/tests/test-histedit-fold-non-commute.t --- a/tests/test-histedit-fold-non-commute.t +++ b/tests/test-histedit-fold-non-commute.t @@ -71,7 +71,7 @@ log before edit edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 out of 1 hunks FAILED -- saving rejects to file e.rej abort: Fix up the change and run hg histedit --continue diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -61,7 +61,7 @@ log before edit edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 4 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-histedit-no-change.t b/tests/test-histedit-no-change.t --- a/tests/test-histedit-no-change.t +++ b/tests/test-histedit-no-change.t @@ -32,12 +32,11 @@ editing a changeset without any actual c > # generate an editor script for selecting changesets to be edited > choice=$1 # changesets that should be edited (using sed line ranges) > cat < #!/bin/sh > # editing the rules, replacing 'pick' with 'edit' for the chosen lines - > sed '${choice}s:^pick:edit:' \$1 > \${1}.tmp - > mv \${1}.tmp \$1 + > sed '${choice}s:^pick:edit:' "\$1" > "\${1}.tmp" + > mv "\${1}.tmp" "\$1" > # displaying the resulting rules, minus comments and empty lines - > sed '/^#/d;/^$/d;s:^:| :' \$1 >&2 + > sed '/^#/d;/^$/d;s:^:| :' "\$1" >&2 > EOF > } @@ -48,9 +47,8 @@ editing a changeset without any actual c > number="$2" # number of changesets considered (from tip) > comment="$3" > geneditor "${choice}" > edit.sh - > chmod +x edit.sh > echo % start editing the history ${comment} - > HGEDITOR=./edit.sh hg histedit -- -${number} 2>&1 | fixbundle + > HGEDITOR="sh ./edit.sh" hg histedit -- -${number} 2>&1 | fixbundle > } $ continueediting () diff --git a/tests/test-histedit-non-commute-abort.t b/tests/test-histedit-non-commute-abort.t --- a/tests/test-histedit-non-commute-abort.t +++ b/tests/test-histedit-non-commute-abort.t @@ -71,7 +71,7 @@ log before edit edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 out of 1 hunks FAILED -- saving rejects to file e.rej abort: Fix up the change and run hg histedit --continue diff --git a/tests/test-histedit-non-commute.t b/tests/test-histedit-non-commute.t --- a/tests/test-histedit-non-commute.t +++ b/tests/test-histedit-non-commute.t @@ -71,7 +71,7 @@ log before edit edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 out of 1 hunks FAILED -- saving rejects to file e.rej abort: Fix up the change and run hg histedit --continue @@ -122,7 +122,7 @@ second edit set edit the history - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 out of 1 hunks FAILED -- saving rejects to file e.rej abort: Fix up the change and run hg histedit --continue @@ -190,14 +190,14 @@ start over > EOF edit the history, this time with a fold action - $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 1 out of 1 hunks FAILED -- saving rejects to file e.rej abort: Fix up the change and run hg histedit --continue $ echo a > e $ hg add e - $ HGEDITOR="cat $EDITED > " hg histedit --continue 2>&1 | fixbundle + $ HGEDITOR="cat \"$EDITED\" > " hg histedit --continue 2>&1 | fixbundle 0 files updated, 0 files merged, 0 files removed, 0 files unresolved file e already exists 1 out of 1 hunks FAILED -- saving rejects to file e.rej