Patchwork [3,of,3] tests: choose the proper environment variable style for the platform

login
register
mail settings
Submitter Matt Harbison
Date Nov. 21, 2014, 4:16 a.m.
Message ID <ed6f861d80668bfb5029.1416543396@Envy>
Download mbox | patch
Permalink /patch/6818/
State Accepted
Headers show

Comments

Matt Harbison - Nov. 21, 2014, 4:16 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1416540820 18000
#      Thu Nov 20 22:33:40 2014 -0500
# Node ID ed6f861d80668bfb502925a0ca1ca44e371393ec
# Parent  9973255d082986ceb894983077e39edd1bd0b9b8
tests: choose the proper environment variable style for the platform

Windows was printing out 'commit $HG_NODE' instead of the actual hash.
Augie Fackler - Nov. 25, 2014, 3:31 p.m.
On Thu, Nov 20, 2014 at 11:16:36PM -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1416540820 18000
> #      Thu Nov 20 22:33:40 2014 -0500
> # Node ID ed6f861d80668bfb502925a0ca1ca44e371393ec
> # Parent  9973255d082986ceb894983077e39edd1bd0b9b8
> tests: choose the proper environment variable style for the platform

Queued these, thanks.

>
> Windows was printing out 'commit $HG_NODE' instead of the actual hash.
>
> 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
> @@ -470,7 +470,14 @@
>    1:199b6bb90248 b
>    0:6c795aa153cb a
>
> -  $ hg histedit 6c795aa153cb --config hooks.commit="echo commit \$HG_NODE" --commands - 2>&1 << EOF | fixbundle
> +Setup the proper environment variable symbol for the platform, to be subbed
> +into the hook command.
> +#if windows
> +  $ NODE="%HG_NODE%"
> +#else
> +  $ NODE="\$HG_NODE"
> +#endif
> +  $ hg histedit 6c795aa153cb --config hooks.commit="echo commit $NODE" --commands - 2>&1 << EOF | fixbundle
>    > pick 199b6bb90248 b
>    > fold a1a953ffb4b0 c
>    > pick 6c795aa153cb a
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

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
@@ -470,7 +470,14 @@ 
   1:199b6bb90248 b
   0:6c795aa153cb a
 
-  $ hg histedit 6c795aa153cb --config hooks.commit="echo commit \$HG_NODE" --commands - 2>&1 << EOF | fixbundle
+Setup the proper environment variable symbol for the platform, to be subbed
+into the hook command.
+#if windows
+  $ NODE="%HG_NODE%"
+#else
+  $ NODE="\$HG_NODE"
+#endif
+  $ hg histedit 6c795aa153cb --config hooks.commit="echo commit $NODE" --commands - 2>&1 << EOF | fixbundle
   > pick 199b6bb90248 b
   > fold a1a953ffb4b0 c
   > pick 6c795aa153cb a