Patchwork D8425: wait-on-file: don't quote arithmetic argument

login
register
mail settings
Submitter phabricator
Date April 15, 2020, 7:07 p.m.
Message ID <differential-rev-PHID-DREV-o35gx56uf5j52ypwxny2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46130/
State Superseded
Headers show

Comments

phabricator - April 15, 2020, 7:07 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is unnecessary and Mac OS X choke on them.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8425

AFFECTED FILES
  tests/testlib/wait-on-file

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel
phabricator - April 15, 2020, 10:10 p.m.
mharbison72 added a comment.
mharbison72 accepted this revision.


  I couldn't reproduce the problem on 10.14 with or without this.  But I can confirm that it appears to fix the issue on MSYS.
  
    --- g:/Users/test/projects/hg-default-x86_64/Win7_x86_64_hg_tests/build/tests/test-persistent-nodemap.t
    +++ g:/Users/test/projects/hg-default-x86_64/Win7_x86_64_hg_tests/build/tests/test-persistent-nodemap.t.err
    @@ -354,22 +388,19 @@
       $ wait-on-file 20 sync-txn-pending && \
       > hg debugnodemap --metadata && \
       > wait-on-file 20 sync-txn-close sync-repo-read
    +  \Users\test\projects\hg-default-x86_64\Win7_x86_64_hg_tests\build\tests/testlib/wait-on-file: line 16: ("20" * "600") / 180 : syntax error: operand expected (error token is ""20" * "600") / 180 ")

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8425/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8425

To: marmoute, #hg-reviewers, mharbison72
Cc: mharbison72, mercurial-devel

Patch

diff --git a/tests/testlib/wait-on-file b/tests/testlib/wait-on-file
--- a/tests/testlib/wait-on-file
+++ b/tests/testlib/wait-on-file
@@ -13,7 +13,7 @@ 
 
 # if the test timeout have been extended, explicitly extend the provided timer
 if [ "$HGTEST_TIMEOUT_DEFAULT" -lt "$HGTEST_TIMEOUT" ]; then
-    timer=$(( ("$timer" * "$HGTEST_TIMEOUT") / $HGTEST_TIMEOUT_DEFAULT ))
+    timer=$(( ($timer * $HGTEST_TIMEOUT) / $HGTEST_TIMEOUT_DEFAULT ))
 fi
 
 wait_on="$2"