Skip to content
Snippets Groups Projects
  1. Nov 30, 2014
  2. Dec 01, 2014
  3. Nov 28, 2014
    • Mads Kiilerich's avatar
      mq: fix update of headers that occur in the "wrong" order · 94092019
      Mads Kiilerich authored
      Mq tried to insert headers in the right order. Sometimes it would stop
      searching before checking all headers and it could thus duplicate a header
      instead of replacing it.
      94092019
    • Gregory Szorc's avatar
      hgweb: send proper HTTP response after uncaught exception · dc4d2cd3
      Gregory Szorc authored
      This patch fixes a bug where hgweb would send an incomplete HTTP
      response.
      
      If an uncaught exception is raised when hgweb is processing a request,
      hgweb attempts to send a generic error response and log that exception.
      
      The server defaults to chunked transfer coding. If an uncaught exception
      occurred, it was sending the error response string / chunk properly.
      However, RFC 7230 Section 4.1 mandates a 0 size last chunk be sent to
      indicate end of the entity body. hgweb was failing to send this last
      chunk. As a result, properly written HTTP clients would assume more data
      was coming and they would likely time out waiting for another chunk to
      arrive.
      
      Mercurial's own test harness was paving over the improper HTTP behavior
      by not attempting to read the response body if the status code was 500.
      This incorrect workaround was added in ba6577a19656 and has been removed
      with this patch.
      dc4d2cd3
  4. Nov 26, 2014
  5. Nov 25, 2014
    • Pierre-Yves David's avatar
      rename: properly report removed and added file as modified (issue4458) · 2963d5c9
      Pierre-Yves David authored
      The result of 'hg rm' + 'hg rename' disagreed with the one from
      'hg rename --force'. We align them on 'hg move --force' because it agrees with
      what 'hg status' says after the commit.
      
      Stopping reporting a modified file as added puts an end to the hg revert confusion in this
      situation (issue4458).
      
      However, reporting the file as modified also prevents revert from restoring the copy
      source. We fix this in a later changeset.
      
      Git diff also stop reporting the add in the middle of the chain as add. Not
      sure how important (and even wrong) it is.
      2963d5c9
  6. Nov 26, 2014
    • Pierre-Yves David's avatar
      manifest: fix a bug where working copy file 'add' mark was buggy · fd1bab28
      Pierre-Yves David authored
      Because the same dictionary was used to (1) get node from parent and (2) store
      annotated version, we could end up with buggy values. For example with a chain
      of renames:
      
        $ hg mv b c
        $ hg mv a b
      
      The value from 'b' would be updated as "<old-a>a", then the value of c would be
      updated as "<old-b>a'. With the current dictionary sharing this ends up with:
      
          '<new-c>' == '<old-a>aa'
      
      This value is double-wrong as we should use '<old-b>' and a single 'a'.
      
      We now use a read-only value for lookup. The 'test-rename.t' test is impacted
      because such a chained added file is suddenly detected as such.
      fd1bab28
    • anatoly techtonik's avatar
  7. Nov 25, 2014
  8. Nov 21, 2014
    • Durham Goode's avatar
      changegroup: fix file linkrevs during reorders (issue4462) · cc0ff93d
      Durham Goode authored
      Previously, if reorder was true during the creation of a changegroup bundle,
      it was possible that the manifest and filelogs would be reordered such that the
      resulting bundle filelog had a linkrev that pointed to a commit that was not
      the earliest instance of the filelog revision. For example:
      
      With commits:
      
      0<-1<---3<-4
        \       /
         --2<---
      
      if 2 and 3 added the same version of a file, if the manifests of 2 and 3 have
      their order reversed, but the changelog did not, it could produce a filelog with
      linkrevs 0<-3 instead of 0<-2, which meant if commit 3 was stripped, it would
      delete that file data from the repository and commit 2 would be corrupt (as
      would any future pulls that tried to build upon that version of the file).
      
      The fix is to make the linkrev fixup smarter. Previously it considered the first
      manifest that added a file to be the first commit that added that file, which is
      not true. Now, for every file revision we add to the bundle we make sure we
      attach it to the earliest applicable linkrev.
      cc0ff93d
    • Anton Shestakov's avatar
      templates: fix broken "less" & "more" links in paper style (issue4460) · c00b156d
      Anton Shestakov authored
      "/search", which is an invalid command in hgweb, was mistakenly used for
      "[show] more [revsets]" and "[show] less [revsets]" links on search page in
      templates "paper" (and those which inherit paper, such as coal) before and
      worked fine until 6e1fbcb18a75, which made hgweb more strict about invalid
      commands.
      c00b156d
  9. Nov 19, 2014
    • Pierre-Yves David's avatar
      push: stop independent usage of bundle2 in syncphase (issue4454) · 2e65da5f
      Pierre-Yves David authored
      The phase-syncing code was using bundle2 if the remote supported it. It was
      doing so without regard to bundle2 activation on the client. Moreover, the
      phase push is now properly included in the unified bundle2 push, so having extra
      code in syncphase should be useless. If the remote is bundle2-enabled, the
      phases should already be synced.
      
      The buggy verification code was leading to a crash when a 3.2 client was pushing
      to a 3.1 server. The real bundle2 path detected that their versions were
      incompatible, but the syncphase code failed to, sending an incompatible bundle2
      to the server.
      
      We drop the useless and buggy code as a result. The "else" clause is
      de-indented in the process.
      2e65da5f
  10. Nov 17, 2014
  11. Nov 16, 2014
  12. Nov 11, 2014
  13. Nov 10, 2014
  14. Nov 06, 2014
  15. Nov 07, 2014
    • Gregory Szorc's avatar
      changegroup: sparsely populate fnodes · 5dcaed20
      Gregory Szorc authored
      Previously, fnodes had a key and empty dict value for every element in
      changedfiles. This is somewhat wasteful. Empty dicts in CPython consume
      a lot more memory than you would expect - 280 bytes.
      
      On mozilla-central, which has ~190,000 files/fnodes keys, the previous
      loop populating fnodes allocated 91,924 KB of memory, most of that for
      the empty dicts.
      
      With this patch in place, our peak RSS during mozilla-central clone
      drops:
      
      before:  364,356 KB
      after:   326,008 KB
      delta:   -38,348 KB
      
      When combined with the previous patch, total peak RSS decrease is now
      190,116 KB.
      5dcaed20
    • Gregory Szorc's avatar
      changegroup: don't store unused value on fnodes (issue4443) · bdf7b1ea
      Gregory Szorc authored
      The contents of fnodes are only accessed once per key. It is wasteful to
      cache the value since nobody will use it.
      
      Before this patch, the caching of unused data in fnodes was effectively
      causing a memory leak during the file streaming part of bundle creation.
      
      On mozilla-central (which has ~190,000 entries in fnodes), this patch
      has a significant impact on RSS at the end of generate():
      
      before:  516,124 KB
      after:   364,356 KB
      delta:  -151,768 KB
      
      The origin of this code can be traced back to 627cd7842e5d and has been
      with us since the 2.7 release.
      bdf7b1ea
    • Gregory Szorc's avatar
      changegroup: don't define lookupmf() until it is needed · f4ab47cc
      Gregory Szorc authored
      lookupmf() is currently defined earlier than when it is needed. Future
      patches further refactoring this code will be easier to read when
      lookupmf() is in its new home.
      f4ab47cc
  16. Nov 05, 2014
    • Pierre-Yves David's avatar
      mail: actually use the verifycert config value · a4af6fd9
      Pierre-Yves David authored
      The mail module only verifies the smtp ssl certificate if 'verifycert' is enabled
      (the default). The 'verifycert' can take three possible values:
      
      - 'strict'
      - 'loose'
      - any "False" value, eg: 'false' or '0'
      
      We tested the validity of the third value, but never converted it to actual
      falseness, making 'False' an equivalent for 'loose'.
      
      This changeset fixes it.
      a4af6fd9
  17. Nov 06, 2014
  18. Nov 05, 2014
  19. Nov 03, 2014
    • Matt Harbison's avatar
      templater: don't overwrite the keyword mapping in runsymbol() (issue4362) · a3c2d921
      Matt Harbison authored
      This keyword remapping was introduced in e06e9fd2d99f as part of converting
      generator based iterators into list based iterators, mentioning "undesired
      behavior in template" when a generator is exhausted, but doesn't say what and
      introduces no tests.
      
      The problem with the remapping was that it corrupted the output for keywords
      like 'extras', 'file_copies' and 'file_copies_switch' in templates such as:
      
          $ hg log -r 142b5d5ec9cc --template "{file_copies % ' File: {file_copy}\n'}"
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
          File: mercurial/changelog.py (mercurial/hg.py)
      
      What was happening was that in the first call to runtemplate() inside runmap(),
      'lm' mapped the keyword (e.g. file_copies) to the appropriate showxxx() method.
      On each subsequent call to runtemplate() in that loop however, the keyword was
      mapped to a list of the first item's pieces, e.g.:
      
         'file_copy': ['mercurial/changelog.py', ' (', 'mercurial/hg.py', ')']
      
      Therefore, the dict for the second and any subsequent items were not processed
      through the corresponding showxxx() method, and the first item's data was
      reused.
      
      The 'extras' keyword regressed in de7e6c489412, and 'file_copies' regressed in
      0b241d7a8c62 for other reasons.  The common thread of things fixed by this seems
      to be when a list of dicts are passed to the templatekw._hybrid class.
      a3c2d921
  20. Jul 26, 2012
    • Michael Fyles's avatar
      extdiff: quote user-supplied options passed to shell · 72a89cf8
      Michael Fyles authored
      $ hg extdiff -p cmd -o "name <user@example.com>"
      resulted in a shell redirection error (due to the less-than sign),
      rather than passing the single option to cmd. This was due to options
      not being quoted for passing to the shell, via util.system(). Apply
      util.shellquote() to each of the user-specified options (-o) to the
      comparison program before they are concatenated and passed to
      util.system(). The requested external diff command (-p) and the
      files/directories being compared are already quoted correctly.
      
      The discussion at the time of changeset be98c5ce4022 correctly noted
      that this course of action breaks whitespace-separated options specified
      for external diff commands in the configuration. The lower part of the
      patch corrects this by lexing options read from the configuration file
      into separate options rather than reading them all into the first
      option.
      
      Update test to cover these conditions.
      
      Related changesets (reverse-chronological):
      - be98c5ce4022 (fix reverted to make configuration file options work)
      - 453097750fbf (issue fixed but without fix for configuration file)
      72a89cf8
  21. Nov 02, 2014
  22. Nov 01, 2014
    • Pierre-Yves David's avatar
      setdiscovery: limit the size of all sample (issue4411) · ced63239
      Pierre-Yves David authored
      Further digging on this issue show that the limit on the sample size used in
      discovery never works for heads. Here is a quote from the code itself:
      
        desiredlen = size - len(always)
        if desiredlen <= 0:
            # This could be bad if there are very many heads, all unknown to the
            # server. We're counting on long request support here.
      
      The long request support never landed and evolution make the "very many heads,
      all unknown to the server" case quite common.
      
      We implement a simple and stupid hard limit of sample size for all query. This
      should prevent HTTP 414 error with the current state of the code.
    • Pierre-Yves David's avatar
      hook: protect commit hooks against stripping of temporary commit (issue4422) · eb315418
      Pierre-Yves David authored
      History rewriting commands like histedit tend to use temporary
      commits. They may schedule hook execution on these temporary commits
      for after the lock has been released. But temporary commits are likely
      to have been stripped before the lock is released (and the hook run).
      Hook executed for missing revisions leads to various crashes.
      
      We disable hooks execution for revision missing in the repo. This
      provides a dirty but simple fix to user issues.
      eb315418
    • Pierre-Yves David's avatar
      mq: do not call [0] on revset · b6f7cf47
      Pierre-Yves David authored
      The __getitem__ method have been removed. The "first" method is to be used
      instead. Test have been extended to test this code path.
      b6f7cf47
    • Pierre-Yves David's avatar
      addset: fix `first` and `last` on sorted addset (issue4426) · 7361d824
      Pierre-Yves David authored
      The lazy sorting were not enforced on addset. This was made visible through MQ.
      7361d824
Loading