Skip to content
Snippets Groups Projects
  1. Apr 07, 2016
    • Blake Burkhart's avatar
      convert: pass absolute paths to git (SEC) · a56296f55a5e
      Blake Burkhart authored
      Fixes CVE-2016-3105 (1/1).
      
      Previously, it was possible for the repository path passed to git-ls-remote
      to be misinterpreted as a URL.
      
      Always passing an absolute path to git is a simple way to avoid this.
      3.8.1
      a56296f55a5e
  2. May 01, 2016
  3. Apr 30, 2016
    • Sean Farley's avatar
      builddeb: use codename in version · 52f71214efce
      Sean Farley authored
      Apparently, this is needed to allow ppas to be built for multiple distros.
      52f71214efce
    • Pierre-Yves David's avatar
      rebase: restrict rebase destination to the pulled set (issue5214) · 261c25372959
      Pierre-Yves David authored
      Before this patch, `hg pull --rebase` would be a strict sequence of `hg pull`
      followed by `hg rebase` if anything was pulled.
      
      Now that rebase pick his default destination the same way than merge, than
      `hg rebase` step would abort in the case the repo already had multiple anonymous
      heads (because of the ambiguity). (changed in fac3a24be50e)
      
      The intend of the user with `hg pull --rebase` is clearly to rebase on pulled
      content. This used to be (mostly) enforced by the former default destination for
      rebase, "tipmost changeset of the branch" as the tipmost would likely a
      changeset that just got pulled. But this intended was no longer enforced with
      the new defaul destination (unified with merge).
      
      This changeset makes use of the '_destspace' mechanism introduced in the previous
      changeset to enforce this.
      
      This partially fixes issue5214 as no change at all have been made to the new
      handling of the case with bookmark (unified with merge).
      261c25372959
    • Pierre-Yves David's avatar
      destutil: add the ability to specify a search space for rebase destination · cf7de4aeb86b
      Pierre-Yves David authored
      In the 'hg pull --rebase', we don't want to pick a rebase destination unrelated
      to the pull, we lay down basic infrastructure to allow such restriction on
      stable (before 3.8 release) in this case. See issue 5214 for details.
      
      Actual usage and test will be in the next patch.
      cf7de4aeb86b
    • Gregory Szorc's avatar
      sslutil: restore old behavior not requiring a hostname argument (issue5210) · 693b856a4d45
      Gregory Szorc authored
      This effectively backs out changeset 1fde84d42f9c.
      
      The http library behind ui.http2=true isn't specifying the hostname.
      It is the day before the expected 3.8 release and we don't want to ship
      a regression.
      
      I'll try to restore this requirement in the 3.9 release cycle as part
      of planned improvements to Mercurial's SSL/TLS interactions.
      693b856a4d45
  4. Apr 28, 2016
    • Matt Mackall's avatar
      tests: test a variety of cache invariants · b962ae0a0a05
      Matt Mackall authored
      We've historically had a problem maintaining the expected invariants
      on our caches, especially when introducing new caches. This tests
      documents the invariants and exercises them across most of our
      existing cache files.
      b962ae0a0a05
    • Matt Mackall's avatar
      repoview: ignore unwritable hidden cache · a4dc5fe7bf54
      Matt Mackall authored
      The atomictemp.close() file attempts to do a rename, which can fail.
      Moving the close inside the exception handler fixes it.
      
      This doesn't fit well with the with: pattern, as it's the finalizer
      that's failing.
      a4dc5fe7bf54
    • Matt Mackall's avatar
      tags: silence hgtagsfnodes reading failures · e3055b46ed1b
      Matt Mackall authored
      tryread() doesn't handle "is a directory" errors and presumably
      others. We might not want to globally swallow such tryread errors, so
      we replace with our own try/except handling.
      
      An upcoming test will use directories as a portable stand-in for
      various bizarre circumstances that cache read/write code should be
      robust to.
      e3055b46ed1b
    • Matt Mackall's avatar
      tags: silence cache parsing errors · a9dd92c48a1c
      Matt Mackall authored
      Follow our standard STFU cache-handling pattern
      a9dd92c48a1c
  5. May 01, 2016
  6. Apr 27, 2016
  7. Apr 28, 2016
    • Adam Simpkins's avatar
      graft: fix printing of --continue command · 224dd889ecd0
      Adam Simpkins authored
      Properly shell quote arguments, to avoid printing commands that won't work when
      run literally.  For example, a date string with timestamp needs to be quoted:
      --date '1456953053 28800'
      224dd889ecd0
  8. Apr 29, 2016
  9. Apr 27, 2016
    • Kevin Bullock's avatar
      osx: create a modern package including manpages · db5084d27df5
      Kevin Bullock authored
      Instead of using bdist_mpkg, we use the modern Apple-provided tools to
      build an OS X Installer package directly. This has several advantages:
      
      * Avoids bdist_mpkg which seems to be barely maintained and is hard to
        use.
      * Creates a single unified .pkg instead of a .mpkg.
      * The package we produce is in the modern, single-file format instead of
        a directory bundle that we have to zip up for download.
      
      In addition, this way of building the package now correctly:
      
      * Installs the manpages, bringing the `make osx`-generated package in
        line with the official Mac packages we publish on the website.
      * Installs files with the correct permissions instead of encoding the
        UID of the user who happened to build the package.
      
      Thanks to Augie for updating the test expectations.
      db5084d27df5
    • Augie Fackler's avatar
      hghave: add check for OS X packaging tools · 80f15aa32edd
      Augie Fackler authored
      80f15aa32edd
  10. Apr 19, 2016
  11. Apr 28, 2016
    • Matt Harbison's avatar
      verify: don't init subrepo when missing one is referenced (issue5128) (API) · 92d37fb3f1aa
      Matt Harbison authored
      Initializing a subrepo when one doesn't exist is the right thing to do when the
      parent is being updated, but in few other cases.  Unfortunately, there isn't
      enough context in the subrepo module to distinguish this case.  This same issue
      can be caused with other subrepo aware commands, so there is a general issue
      here beyond the scope of this fix.
      
      A simpler attempt I tried was to add an '_updating' boolean to localrepo, and
      set/clear it around the call to mergemod.update() in hg.updaterepo().  That
      mostly worked, but doesn't handle the case where archive will clone the subrepo
      if it is missing.  (I vaguely recall that there may be other commands that will
      clone if needed like this, but certainly not all do.  It seems both handy, and a
      bit surprising for what should be a read only operation.  It might be nice if
      all commands did this consistently, but we probably need Angel's subrepo caching
      first, to not make a mess of the working directory.)
      
      I originally handled 'Exception' in order to pick up the Aborts raised in
      subrepo.state(), but this turns out to be unnecessary because that is called
      once and cached by ctx.sub() when iterating the subrepos.
      
      It was suggested in the bug discussion to skip looking at the subrepo links
      unless -S is specified.  I don't really like that idea because missing a subrepo
      or (less likely, but worse) a corrupt .hgsubstate is a problem of the parent
      repo when checking out a revision.  The -S option seems like a better fit for
      functionality that would recurse into each subrepo and do a full verification.
      
      Ultimately, the default value for 'allowcreate' should probably be flipped, but
      since the default behavior was to allow creation, this is less risky for now.
      92d37fb3f1aa
    • Gregory Szorc's avatar
      setup: detect Python DLL filename from loaded DLL · ee2e4a2c3690
      Gregory Szorc authored
      Attempting to build Mercurial from source using MinGW from
      msys2 on Windows produces a hg.exe that attempts to load e.g.
      python27.dll. MinGW prefixes its library name with "lib" and
      adds a period between the major and minor versions. e.g.
      "libpython2.7.dll."
      
      Before this patch, hg.exe files in a MinGW environment would
      either fail to find a Python DLL or would attempt to load a
      non-MinGW DLL, which would summarily explode. Either way,
      hg.exe wouldn't work.
      
      This patch improves the code that determines the Python DLL
      filename to actually use the loaded Python DLL instead of
      inferring it. Basically we take the handle of the loaded DLL
      from sys.dllhandle and call a Windows API to try to resolve
      that handle to a filename.
      ee2e4a2c3690
  12. Apr 27, 2016
    • Gregory Szorc's avatar
      exewrapper: add .dll to LoadLibrary() argument · 210bb28ca4fb
      Gregory Szorc authored
      LoadLibrary() changes behavior depending on whether the argument
      passed to it contains a period. From the MSDN docs:
      
      If no file name extension is specified in the lpFileName parameter,
      the default library extension .dll is appended. However, the file name
      string can include a trailing point character (.) to indicate that the
      module name has no extension. When no path is specified, the function
      searches for loaded modules whose base name matches the base name of
      the module to be loaded. If the name matches, the load succeeds.
      Otherwise, the function searches for the file.
      
      As the subsequent patch will show, some environments on Windows
      define their Python library as e.g. "libpython2.7.dll." The existing
      code would pass "libpython2.7" into LoadLibrary(). It would assume
      "7" was the file extension and look for a "libpython2.dll" to load.
      
      By passing ".dll" into LoadLibrary(), we force it to search for the
      exact basename we want, even if it contains a period.
      210bb28ca4fb
    • Martin von Zweigbergk's avatar
      update: correct description of --check option · 602cc9bf036e
      Martin von Zweigbergk authored
      The old "update across branches if no uncommitted changes" made
      it sound like updating across branches (with no uncommitted changes)
      was allowed only with this option, which was not true. Also, the option
      did not care whether it was linear or across branches. Instead, it
      checked that there were no uncommitted changes. Let's explain what it
      does instead of trying to suggest what happens without it.
      602cc9bf036e
  13. Apr 26, 2016
    • Adam Simpkins's avatar
      util: fix race in makedirs() · 07be86828e79
      Adam Simpkins authored
      Update makedirs() to ignore EEXIST in case someone else has already created the
      directory in question.  Previously the ensuredirs() function existed, and was
      nearly identical to makedirs() except that it fixed this race.  Unfortunately
      ensuredirs() was only used in 3 places, and most code uses the racy makedirs()
      function.  This fixes makedirs() to be non-racy, and replaces calls to
      ensuredirs() with makedirs().
      
      In particular, mercurial.scmutil.origpath() used the racy makedirs() code,
      which could cause failures during "hg update" as it tried to create backup
      directories.
      
      This does slightly change the behavior of call sites using ensuredirs():
      previously ensuredirs() would throw EEXIST if the path existed but was a
      regular file instead of a directory.  It did this by explicitly checking
      os.path.isdir() after getting EEXIST.  The makedirs() code did not do this and
      swallowed all EEXIST errors.  I kept the makedirs() behavior, since it seemed
      preferable to avoid the extra stat call in the common case where this directory
      already exists.  If the path does happen to be a file, the caller will almost
      certainly fail with an ENOTDIR error shortly afterwards anyway.  I checked
      the 3 existing call sites of ensuredirs(), and this seems to be the case for
      them.
      07be86828e79
  14. Apr 24, 2016
  15. Apr 22, 2016
    • Matt Mackall's avatar
      bdiff: further restrain potential quadratic performance · 87d4a6c5567e
      Matt Mackall authored
      This causes the longest_match search to limit itself to a window of
      30000 lines during search (roughly 1MB), thus avoiding a full O(N*M)
      search that might occur in repetitive structured inputs. For a
      particular class of many MB pathological test cases, this generated
      the following timings:
      
      size    before      after
      10x     1.25s       1.24s
      100x    57s         33s
      1000x   >8400s      400s
      
      The times on the right quickly become much faster and appear more linear.
      
      While windowing means deltas are no longer "optimal", the resulting
      deltas were within a couple percent of expected size. While we've yet
      to have a report of a file with the level of repetition necessary to
      hit this case, some JSON/XML database dump scenario is fairly likely
      to hit it.
      
      This may also slightly improve the average-case performance for deltas
      of large binaries.
      87d4a6c5567e
    • Matt Mackall's avatar
      bdiff: balance recursion to avoid quadratic behavior (issue4704) · f1ca249696ed
      Matt Mackall authored
      For highly structured files like JSON or XML dumps with large numbers
      of duplicate lines (eg braces) and isolated matching lines, bdiff
      could find large numbers of equally good spans. Because it prefers
      earlier matches, this would result in pathologically unbalance
      recursion that resulted in quadratic performance.
      
      This patch makes it prefer matches closer to the middle that tend to
      balance recursion. This change improves the speed of a pathological
      test case from 1100s to 9s.
      
      Included is a smaller test that has a roughly 50x safety margin on the
      performance it accepts. It's likely to fail on pure builds because
      difflib also has a recursion-balancing problem.
      f1ca249696ed
    • Matt Mackall's avatar
      bdiff: deal better with duplicate lines · 9a8363d23419
      Matt Mackall authored
      The longest_match code compares all the possible positions in two
      files to find the best match. Given a pair of sequences, it
      effectively searches a grid like this:
      
        a b b b c . d e . f
        0 1 2 3 4 5 6 7 8 9
      a 1 - - - - - - - - -
      b - 2 1 1 - - - - - -
      b - 1 3 2 - - - - - -
      b - 1 2 4 - - - - - -
      . - - - - - 1 - - 1 -
      
      
      Here, the 4 in the middle says "the first four lines of the
      file match", which it can compute be comparing the fourth lines and
      then adding one to the result found when comparing the third lines in
      the entry to the upper left.
      
      We generally avoid the quadratic worst case by only looking at lines
      that match, which is precomputed. We also avoid quadratic storage by
      only keeping a single column vector and then keeping track of the best
      match.
      
      Unfortunately, this can get us into trouble with the sequences above.
      Because we want to reuse the '3' value when calculating the '4', we
      need to be careful not to overwrite it with the '2' we calculate
      immediately before. If we scan left to right, top to bottom, we're
      going to have a problem: we'll overwrite our 3 before we use it and
      calculate a suboptimal best match.
      
      To address this, we can either keep two column vectors and swap
      between them (which significantly complicates bookkeeping), or change
      our scanning order. If we instead scan from left to right, bottom to
      top, we'll avoid ever overwriting values we'll need in the future.
      
      This unfortunately needs several changes to be made simultaneously:
      
      - change the order we build the initial hash chains for the b sequence
      - change the sentinel values from INT_MAX to -1
      - change the visit order in the longest_match inner loop
      - add a tie-breaker preference for earlier matches
      
      This last is needed because we previously had an implicit tie-breaker
      from our visitation order that our test suite relies on. Later matches
      can also trigger a bug in the normalization code in diff().
      9a8363d23419
    • Matt Mackall's avatar
      bdiff: fix latent normalization bug · 4bd67ae7d75a
      Matt Mackall authored
      This bug is hidden by the current bias towards matches at the
      beginning of the file. When this bias is tweaked later to address
      recursion balancing, the normalization code could cause the next block
      to shrink to a negative length, thus creating invalid delta chunks. We
      add checks here to disallow that.
      
      This bug requires test cases that are an awkwardly large size for the test
      suite, but is very rapidly picked up by the included torture tester.
      4bd67ae7d75a
Loading