Skip to content
Snippets Groups Projects
  1. Jul 31, 2017
    • Martin von Zweigbergk's avatar
    • Martin von Zweigbergk's avatar
    • Martin von Zweigbergk's avatar
      tests: fix test-flagprocessor.t flakiness · c6146dd10072
      Martin von Zweigbergk authored
      The test for duplicate flag processors depended on the timestamps
      being set in the dirstate to work. If the time between the the
      previous failed commit (which would set the timestamp, due to bug
      5645) and the attempted commit with the duplicate flag processors was
      small enough, it would fail. The failure was caused by a call to
      commands.status() early in the commit process. If the dirstate did not
      have the timestamp set, it would need to fetch the file content to
      compare with. Since two flag processors had been registered, it would
      attempted to base64 decode the contents twice, which would of course
      fail.
      
      This patch adds a "hg debugrebuilddirstate" to make it deterministic
      and also replaces the test case's "hg commit" by simply "hg status",
      since that will trigger reading of the contents and thereby use of the
      flag processors as noted above.
      
      Differential Revision: https://phab.mercurial-scm.org/D202
      c6146dd10072
    • Martin von Zweigbergk's avatar
      tests: clarify that duplicate flag processors is not an error · 41081364addb
      Martin von Zweigbergk authored
      The flag processors test for duplicate processors for a single flag
      was misleading because the file from the previous test case caused it
      to fail (making the "echo 'this should fail' > file" part
      irrelevant). Let's remove the leftover from the previous test case to
      make it clear that duplicate flag processors results only in a
      warning.
      
      Note that duplicate flag processors would have resulted in a failure
      (not just a warning) until ea1c2eb7abd3 (extensions: catch uisetup and
      extsetup failures and don't let them break hg, 2017-06-06). I remember
      expressing my concern about ending up with half-loaded extensions. It
      would be pretty unfortunate to have double-encoded revlog content
      enter a repo, so maybe we should reconsider?
      
      Differential Revision: https://phab.mercurial-scm.org/D201
      41081364addb
    • Katsunori FUJIWARA's avatar
      tests: avoid unexpected result at invocation of *.py file on Windows · 3b77d4787c18
      Katsunori FUJIWARA authored
      Invocation of "diff tool.py" in test-extdiff.t tests whether
      shellquote() is applied on specified command as expected.
      
      But direct invocation of "*.py" file might cause unexpected result on
      Windows according to suffix binding.
      
      For example, starting IDE, showing dialog to choose program to be
      used, and so on. In such case, running test-extdiff.t is easily timed
      out.
      
      This patch uses intermediate *.bat file on Windows, to avoid such
      unexpected result. Naming that intermediate file as "diff tool.bat" is
      enough to test applying shellquote().
      3b77d4787c18
    • Katsunori FUJIWARA's avatar
      tests: use pdiff instead of diff for portability · 798f7beadbc9
      Katsunori FUJIWARA authored
      "diff" command might cause redundant message, "No differences
      encountered" on Solaris for example. But suppressing option like "-q"
      isn't portable, because POSIX specification doesn't define it.
      
      pdiff script was introduced by b59ef0c21405 to stabilize output of
      standard diff command on each platforms.
      798f7beadbc9
    • Katsunori FUJIWARA's avatar
      tests: make pdiff return appropriate exit code at comparison of files · a2b55ee62803
      Katsunori FUJIWARA authored
      Before this patch, pdiff script returns 0, even if diff is detected.
      
      This issue doesn't cause failure of tests using it, if it is invoked
      via extdiff extension, because extdiff itself examines changes between
      specified revisions and decides exit code.
      
      BTW, this patch ignores recursive comparison case, because:
      
        - there is no portable way for current while-read based
          implementation to return 1 at detecting changes
      
        - it isn't yet needed to replace direct "diff -r" invocation by
          pdiff for portability
      a2b55ee62803
    • Martin von Zweigbergk's avatar
      tests: make test-profile.t pass if statprof didn't collect samples · a72b2db1a6a9
      Martin von Zweigbergk authored
      We had the first 3 tests in test-profile.t fail because the output
      didn't match. I have not yet confirmed that this was because no
      samples were collected, but we shouldn't require samples to be
      collected for the test to pass either way.
      
      Differential Revision: https://phab.mercurial-scm.org/D199
      a72b2db1a6a9
  2. Jul 27, 2017
    • Boris Feld's avatar
      pypy: fix failing test-devel-warnings.t with Pypy5.6.0 · d524cd1d1648
      Boris Feld authored
      In Pypy 5.6.0, traceback exception classes are not displayed with their full
      qualified name.
      
      Instead of displaying mercurial.error.ProgrammingError, Pypy displays
      ProgrammingError.
      
      Update the test to support both version.
      d524cd1d1648
  3. Jul 31, 2017
    • Boris Feld's avatar
      pypy: fix failing test files with Pypy5.6.0 · 6c142f279625
      Boris Feld authored
      Pypy 5.6.0 saves cached bytecode files in __pycache__ directory, clean them in
      tests to fix loading old test extensions code.
      
      Doing so should also helps for Python3.x migration.
      6c142f279625
  4. Jul 30, 2017
  5. Jul 29, 2017
    • Gregory Szorc's avatar
      statichttprepo: implement wlock() (issue5613) · 8b00c723cee1
      Gregory Szorc authored
      statichttprepo inherits from localrepository. In doing so, it
      obtains default implementations of various methods, like wlock().
      
      Before this change, tags cache writing would call repo.wlock().
      This failed on statichttprepo due to localrepository's wlock()
      looking for an instance attribute that doesn't exist on statichttprepo
      (statichttprepo doesn't call localrepository.__init__).
      
      We /could/ define missing attributes until the base wlock() works.
      However, a statichttprepo is remote and read-only and can't be
      locked. The class already has a lock() that short circuits. So
      it makes sense to implement a short-circuited wlock() as well. That
      is what this patch does.
      
      LockError is expected to be raised when locking fails. The constructor
      takes a number of arguments that are local repository centric. Rather
      than rework LockError to not require them (which would not be
      appropriate for stable), this commit populates dummy values. I don't
      believe they'll ever be seen by the user, as lock failures on
      static http repos should be limited to well-defined (and tested)
      scenarios. We can and should revisit the LockError type to improve
      this.
      8b00c723cee1
    • Gregory Szorc's avatar
      test: add tests for branches and tags with static http repo (issue5613) · 075823a6161b
      Gregory Szorc authored
      Mercurial currently fails to clone by revision on static http
      repos with tags. The added tests demonstrate this.
      075823a6161b
  6. Jul 28, 2017
  7. Jul 27, 2017
  8. Jul 20, 2017
  9. Jul 27, 2017
  10. Jul 25, 2017
    • Augie Fackler's avatar
      osx: wire up genosxversion script · c5607b65fcb8
      Augie Fackler authored
      The only version strings that are changed are the ones baked into the
      .pkg - hg's self-reported version string doesn't change, so users will
      still see our mostly-pip-compatible version strings.
      
      For reference, the part of our versioning setup that's not PEP440
      compatible is the RC releases - those should be .rc0 insted of
      -rc. It's too late to change that for the 4.3 cycle, so I'll worry
      about fixing that during the 4.4 cycle.
      c5607b65fcb8
    • Augie Fackler's avatar
      osx: new script for generating OS X package versions · 283a7da602ae
      Augie Fackler authored
      If you're shipping prerelease or rc packages using Munki, you'll
      eventually discover that Munki's version comparison logic is not as
      good as pip's. In theory we should be able to fix Munki, but it seems
      entirely reasonable to produce version strings that sort reasonably
      under these conditions. Since the requried logic not brief, add a new
      script and some tests of that logic.
      
      A followup change will wire this into the Makefile.
      283a7da602ae
    • Augie Fackler's avatar
      tests: update mac packaging test expectations · 441a4550a80a
      Augie Fackler authored
      Some more files are included these days.
      441a4550a80a
  11. Jul 26, 2017
  12. Jul 25, 2017
    • Jun Wu's avatar
      rebase: move bookmark to destination for commits becoming empty (issue5627) · 52f82e7d6a7e
      Jun Wu authored
      When rebasing a changeset X and that changeset becomes empty, we should move
      the bookmark on X to rebase destination.
      
      This is a regression caused by the scmutil.cleanupnodes refactoring for
      rebase.
      
      The `adjustdest` function calculates the destination of bookmark movement.
      It was back-ported from https://phab.mercurial-scm.org/D21. It might be
      slightly more powerful than the minimal requirement to solve this issue.
      For example, it's impossible for a merge changeset to become empty while any
      of its ancestors does not become empty, but the code could handle that case.
      Since the code is reasonably short and clean, and helps the upcoming D21
      series, I'd like to check-in `adjustdest` now.
      
      Thanks Martin von Zweigbergk for spotting corner cases (-k and descendant
      with bookmarks) in this area!
      52f82e7d6a7e
  13. Jul 26, 2017
  14. Jul 21, 2017
    • Augie Fackler's avatar
      setup: add extra logic to try and recommend a new pip on bad Python · 025017423e53
      Augie Fackler authored
      Modern pip can detect supported Python versions (which we now
      declare), and pull down a reasonable release. This trick was suggested
      in http://bit.ly/pycon2017-build-bridges, and seems like a good
      defensive maneuver so that when we want to move to Python 3 it's
      less risky for existing users.
      
      This moves the version-check logic after defining our printf function
      so we can print more informative messages.
      025017423e53
    • Augie Fackler's avatar
      setup: explicitly declare supported Python versions · e0bbe32d8b55
      Augie Fackler authored
      I think we should probably backport this to 4.2 as well, and do one
      more release there that explicitly declares 2.6 support. That way
      anyone stuck on Python 2.6 will end up getting the right hg if they
      use a modern pip to install. Users can still use `python setup.py`
      incantations to attempt installing Mercurial on unsupported Pythons,
      including 3.5 and 3.6.
      
      A followup change will switch to only doing our own
      Python-version-check logic if we're not being installed by a
      reasonable pip.
      e0bbe32d8b55
  15. Jul 24, 2017
  16. Jul 21, 2017
  17. Jul 19, 2017
  18. Jul 21, 2017
    • Steve Borho's avatar
      wix: update list of necessary pyd files · e12c3049af8e
      Steve Borho authored
      e12c3049af8e
    • Jun Wu's avatar
      run-tests: pre instantiate pygments objects · 20436925e080
      Jun Wu authored
      This speeds up run-tests.py diff output by 10x, which affects developer
      experience significantly. As demonstrated by the following test:
      
      ```
      #require pygments
      
        $ for i in `seq 1 200`; do
        >   echo '  $ echo '$i >> test-a.t
        >   echo '  wrong' >> test-a.t
        > done
      
        $ cat > walltime.py <<EOF
        > from __future__ import absolute_import, print_function
        > import os, sys, time
        > t1 = time.time()
        > os.system(' '.join(sys.argv[1:]) + ' >/dev/null 2>/dev/null')
        > t2 = time.time()
        > print('%0.2f' % (t2 - t1))
        > EOF
      
        $ $PYTHON walltime.py $TESTDIR/run-tests.py -l --color=never $TESTTMP/test-a.t
        0.24
      
      Before this patch:
      
        $ $PYTHON walltime.py $TESTDIR/run-tests.py -l --color=always $TESTTMP/test-a.t
        2.46
      
      After this patch:
      
        $ $PYTHON walltime.py $TESTDIR/run-tests.py -l --color=always $TESTTMP/test-a.t
        0.25
      ```
      20436925e080
  19. Jul 19, 2017
  20. Jul 21, 2017
Loading