diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_bWVyY3VyaWFsL2hlbHAvY29uZmlnLnR4dA==..2009d84f245a9fbf254787016f1955132ee64265_bWVyY3VyaWFsL2hlbHAvY29uZmlnLnR4dA== 100644 --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -891,5 +891,5 @@ .. container:: windows - Some basic Unix syntax is supported for portability, including ``$VAR`` + Some basic Unix syntax can be enabled for portability, including ``$VAR`` and ``${VAR}`` style variables. To use a literal ``$``, it must be @@ -895,7 +895,8 @@ and ``${VAR}`` style variables. To use a literal ``$``, it must be - escaped with a back slash or inside of a strong quote. This can be - disabled by adding a prefix of ``tonative.`` to the hook name on a new - line, and setting it to ``False``. For example:: + escaped with a back slash or inside of a strong quote. + + This feature is enabled by adding a prefix of ``tonative.`` to the hook + name on a new line, and setting it to ``True``. For example:: [hooks] incoming.autobuild = /my/build/hook @@ -899,8 +900,8 @@ [hooks] incoming.autobuild = /my/build/hook - # disable translation to cmd.exe syntax for autobuild hook - tonative.incoming.autobuild = False + # enable translation to cmd.exe syntax for autobuild hook + tonative.incoming.autobuild = True ``changegroup`` Run after a changegroup has been added via push, pull or unbundle. The ID of diff --git a/mercurial/hook.py b/mercurial/hook.py index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_bWVyY3VyaWFsL2hvb2sucHk=..2009d84f245a9fbf254787016f1955132ee64265_bWVyY3VyaWFsL2hvb2sucHk= 100644 --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -139,7 +139,7 @@ v = stringutil.pprint(v) env['HG_' + k.upper()] = v - if ui.configbool('hooks', 'tonative.%s' % name, pycompat.iswindows): + if ui.configbool('hooks', 'tonative.%s' % name, False): ui.note(_('converting hook "%s" to native\n') % name) cmd = procutil.shelltonative(cmd, env) diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_dGVzdHMvdGVzdC1ib29rbWFya3MtcHVzaHB1bGwudA==..2009d84f245a9fbf254787016f1955132ee64265_dGVzdHMvdGVzdC1ib29rbWFya3MtcHVzaHB1bGwudA== 100644 --- a/tests/test-bookmarks-pushpull.t +++ b/tests/test-bookmarks-pushpull.t @@ -194,7 +194,6 @@ bundle2-input: part header size: 0 bundle2-input: end of bundle2 stream bundle2-input-bundle: 3 parts total - converting hook "txnclose-bookmark.test" to native (windows !) running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> bundle2-output-bundle: "HG20", 1 parts total @@ -309,7 +308,6 @@ bundle2-input: part header size: 0 bundle2-input: end of bundle2 stream bundle2-input-bundle: 3 parts total - converting hook "txnclose-bookmark.test" to native (windows !) running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> bundle2-output-bundle: "HG20", 0 parts total diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_dGVzdHMvdGVzdC1jb21taXQtYW1lbmQudA==..2009d84f245a9fbf254787016f1955132ee64265_dGVzdHMvdGVzdC1jb21taXQtYW1lbmQudA== 100644 --- a/tests/test-commit-amend.t +++ b/tests/test-commit-amend.t @@ -205,7 +205,6 @@ a committing manifest committing changelog - converting hook "pretxncommit.test-saving-last-message" to native (windows !) running hook pretxncommit.test-saving-last-message: false transaction abort! rollback completed @@ -231,7 +230,6 @@ a committing manifest committing changelog - converting hook "pretxncommit.test-saving-last-message" to native (windows !) running hook pretxncommit.test-saving-last-message: false transaction abort! rollback completed diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_dGVzdHMvdGVzdC1oaXN0ZWRpdC1mb2xkLnQ=..2009d84f245a9fbf254787016f1955132ee64265_dGVzdHMvdGVzdC1oaXN0ZWRpdC1mb2xkLnQ= 100644 --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -478,7 +478,8 @@ 1:199b6bb90248 b 0:6c795aa153cb a - $ hg histedit 6c795aa153cb --config hooks.commit='echo commit $HG_NODE' --commands - 2>&1 << EOF | fixbundle + $ hg histedit 6c795aa153cb --config hooks.commit='echo commit $HG_NODE' --config hooks.tonative.commit=True \ + > --commands - 2>&1 << EOF | fixbundle > pick 199b6bb90248 b > fold a1a953ffb4b0 c > pick 6c795aa153cb a @@ -494,5 +495,4 @@ $ cat > $TESTTMP/tmp.hgrc <<'EOF' > [hooks] > pre-add = echo no variables - > tonative.pre-add = False > post-add = echo ran $HG_ARGS, literal \$non-var, 'also $non-var', $HG_RESULT @@ -498,4 +498,5 @@ > post-add = echo ran $HG_ARGS, literal \$non-var, 'also $non-var', $HG_RESULT + > tonative.post-add = True > EOF TODO: Windows should output double quotes around "also $non-var" diff --git a/tests/test-keyword.t b/tests/test-keyword.t index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_dGVzdHMvdGVzdC1rZXl3b3JkLnQ=..2009d84f245a9fbf254787016f1955132ee64265_dGVzdHMvdGVzdC1rZXl3b3JkLnQ= 100644 --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -183,7 +183,6 @@ overwriting a expanding keywords updating the branch cache committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 - converting hook "commit.test" to native (windows !) running hook commit.test: cp a hooktest $ hg status ? hooktest diff --git a/tests/test-push-http.t b/tests/test-push-http.t index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_dGVzdHMvdGVzdC1wdXNoLWh0dHAudA==..2009d84f245a9fbf254787016f1955132ee64265_dGVzdHMvdGVzdC1wdXNoLWh0dHAudA== 100644 --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -90,6 +90,5 @@ remote: adding a revisions remote: added 1 changesets with 1 changes to 1 files remote: updating the branch cache - remote: converting hook "txnclose-phase.test" to native (windows !) remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public @@ -94,5 +93,4 @@ remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public - remote: converting hook "txnclose-phase.test" to native (windows !) remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public @@ -97,6 +95,5 @@ remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public - remote: converting hook "changegroup" to native (windows !) remote: running hook changegroup: sh -c "printenv.py changegroup 0" remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) % serve errors @@ -113,6 +110,5 @@ remote: adding a revisions remote: added 1 changesets with 1 changes to 1 files remote: updating the branch cache - remote: converting hook "txnclose-phase.test" to native (windows !) remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public @@ -117,5 +113,4 @@ remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public - remote: converting hook "txnclose-phase.test" to native (windows !) remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public @@ -120,6 +115,5 @@ remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public - remote: converting hook "changegroup" to native (windows !) remote: running hook changegroup: sh -c "printenv.py changegroup 0" remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) % serve errors diff --git a/tests/test-rebase-interruptions.t b/tests/test-rebase-interruptions.t index dbbe45ae5ad1d80ada459bbfd7fbd59e2275e018_dGVzdHMvdGVzdC1yZWJhc2UtaW50ZXJydXB0aW9ucy50..2009d84f245a9fbf254787016f1955132ee64265_dGVzdHMvdGVzdC1yZWJhc2UtaW50ZXJydXB0aW9ucy50 100644 --- a/tests/test-rebase-interruptions.t +++ b/tests/test-rebase-interruptions.t @@ -333,7 +333,8 @@ $ cp -R a3 hook-pretxncommit $ cd hook-pretxncommit - $ hg rebase --source 2 --dest 5 --tool internal:other --config 'hooks.pretxncommit=hg log -r $HG_NODE | grep "summary: C"' + $ hg rebase --source 2 --dest 5 --tool internal:other \ + > --config 'hooks.tonative.pretxncommit=True' --config 'hooks.pretxncommit=hg log -r $HG_NODE | grep "summary: C"' rebasing 2:965c486023db "C" summary: C rebasing 6:a0b2430ebfb8 "F" (tip)