Skip to content
Snippets Groups Projects
  1. Jan 15, 2015
  2. Jan 16, 2015
    • Gregory Szorc's avatar
      dispatch: only check compatibility against major and minor versions (BC) · b2d8f368
      Gregory Szorc authored
      Extensions can declare compatibility with Mercurial versions. If an
      error occurs, Mercurial will attempt to pin blame on an extension that
      isn't marked as compatible.
      
      While all bets are off when it comes to the internal API, my experience
      has shown that a monthly/patch release of Mercurial has never broken any
      of the extensions I've written. I think that expecting extensions to
      declare compatibility with every patch release of Mercurial is asking a
      bit much and adds little to no value.
      
      This patch changes the blame logic from exact version matching to only
      match on the major and minor Mercurial versions. This means that
      extensions only need to mark themselves as compatible with the major,
      quarterly releases and not the monthly ones in order to stay current and
      avoid what is almost certainly unfair blame. This will mean less work
      for extension authors and almost certainly fewer false positives in the
      blame attribution.
      b2d8f368
    • Gregory Szorc's avatar
      test-extension: use a realistic Mercurial version · 9070e200
      Gregory Szorc authored
      Mercurial doesn't define the 3rd "patch" version field for major
      releases. Don't use it in tests.
      9070e200
    • Gregory Szorc's avatar
      test-extension: improve test readability · d9967b82
      Gregory Szorc authored
      There was a mountain of text in this file that made reading the tests
      difficult. Inserting some line breaks greatly improves the situation.
      d9967b82
  3. Dec 19, 2014
    • Pierre-Yves David's avatar
      bundle2: enforce parttype as alphanumerical · 405eacbe
      Pierre-Yves David authored
      The binary format description has always stated that the parttype should be simple,
      but it was never really enforced. Recent discussions have convinced me we want to
      keep the part type simple and easy to debug. There is enough extensibility in
      the rest of the format.
      405eacbe
  4. Jan 15, 2015
    • Matt Harbison's avatar
      tests: conditionalize test-tools.t for Windows support · 049a9e3a
      Matt Harbison authored
      I still get the following diff on Windows 7 with NTFS.  I'm not sure if it is
      expected and we should wildcard the link count, or if something needs to be
      fixed.
      
        @@ -58,7 +58,7 @@
      
           $ ln bar baz
           $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
        -  bar: file, links=2, newer than baz, sha1=612ca68d0305c821750a
        +  bar: file, links=0, newer than baz, sha1=612ca68d0305c821750a\r (esc)
           0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
           0010: 39 0a                                           |9.|
      049a9e3a
  5. Jan 14, 2015
  6. Jan 15, 2015
  7. Jan 14, 2015
    • Mads Kiilerich's avatar
      branchcache: make _rbcrevslen handling more safe · 669106fc
      Mads Kiilerich authored
      self._rbcrevslen is used to keep track of the number of good records on disk.
      It should thus not be updated before the records actually have been written to
      disk.
      669106fc
    • Mads Kiilerich's avatar
      branchcache: add debug output whenever cache files use truncate · 7aa14055
      Mads Kiilerich authored
      The cache files are usually append only but will automatically be truncated and
      recover in exceptional situations. Add a debug notice when such exceptional
      situations are encountered.
      7aa14055
    • Mads Kiilerich's avatar
      tests: rework revision branch cache tests · 01426cad
      Mads Kiilerich authored
      The tests that were added with the revision branch cache in 678f53865c68 had
      suffered from bit rot in the development iterations. They were no longer that
      "good".
      
      Now, the tests are rewritten and reworked to be more readable and maintainable
      and relevant for the actual implementation.
      
      This also utilizes the new 'f' helper tool for keeping an eye the cache files.
      01426cad
    • Mads Kiilerich's avatar
      tests: add 'f' tool for cross platform file operations in the tests · bead0c7b
      Mads Kiilerich authored
      This tool is like the collection of tools found in a unix environment but are
      cross platform and stable and suitable for our needs in the test suite.
      
      The main reason it is "needed" now is for hexdump of revision branch cache to
      keep an eye on how it changes and make sure the format is stable.
      
      It is a very generic tool that can end up being used a lot in tests, so I gave
      it very generic name.
      bead0c7b
    • Mads Kiilerich's avatar
      run-tests: include testdir in $PATH so tests easily can use helper tools · 661b246b
      Mads Kiilerich authored
      The testdir is already added to $PYTHONPATH - I think it makes sense and is
      convenient to add it to $PATH too.
      
      The following binaries are invoked from tests using full path with $TESTDIR/ -
      they can now be used without specifying path:
        dumbhttp.py
        dummyssh
        filterpyflakes.py
        generate-working-copy-states.py
        get-with-headers.py
        hghave
        histedit-helpers.sh
        killdaemons.py
        md5sum.py
        notcapable
        printenv.py
        readlink.py
        revlog-formatv0.py
        run-tests.py
        svn-safe-append.py
        svnxml.py
        tinyproxy.py
      661b246b
  8. Jan 12, 2015
  9. Jan 11, 2015
  10. Jan 10, 2015
  11. Jan 14, 2015
  12. Jan 07, 2015
    • Pierre-Yves David's avatar
      discovery: run discovery on filtered repository · c5456b64
      Pierre-Yves David authored
      We have been running discovery on unfiltered repository for quite some time.
      This was aimed at two things:
      
      - save some bandwith by prevent the repushing of common but hidden changesets
      - allow phases changes on secret/hidden changeset on bare push.
      
      The cost of this unfiltered discovery combined with evolution is actually really
      high. Evolution likely create thousand of hidden heads, and the discovery is
      going to try to discovery if each of them are common or not. For example,
      pushing from my development mercurial repository implies 17 discovery
      round-trip.
      
      The benefit are rare corner cases while the drawback are massive. So we run the
      discovery on a filtered repository again.
      
      We add some hack to detect remote heads that are known locally and adds them to
      the common set anyway, so the good behavior of most of the corner case should
      remains. But this will not work in all cases.
      
      This bring my discovery phase back from 17 round-trips to 1 or 2.
      c5456b64
  13. Jan 10, 2015
    • Katsunori FUJIWARA's avatar
      revset: check for collisions between alias argument names in the declaration · 71402bb8
      Katsunori FUJIWARA authored
      Before this patch, collisions between alias argument names in the
      declaration are ignored, and this silently causes unexpected alias
      evaluation.
      
      This patch checks for such collisions, and aborts (or shows a warning) when
      collisions are detected.
      
      This patch doesn't add a test to "test-revset.t", because a doctest is
      enough to test the collisions detection itself.
      71402bb8
    • Katsunori FUJIWARA's avatar
      revset: parse alias declaration strictly by _parsealiasdecl · aac4a1a7
      Katsunori FUJIWARA authored
      Before this patch, alias declaration is parsed by string base
      operations: matching against "^([^(]+)\(([^)]+)\)$" and splitting by
      ",".
      
      This overlooks many syntax errors like below (see the previous patch
      introducing "_parsealiasdecl" for detail):
      
        - un-closed parenthesis causes being treated as "alias symbol"
        - symbol/function name aren't examined whether they are valid or not
        - invalid argument list causes unexpected argument names
      
      To parse alias declaration strictly, this patch replaces parsing
      implementation by "_parsealiasdecl".
      
      This patch tests only one typical declaration error case, because
      error detection itself is already tested in the doctest of
      "_parsealiasdecl".
      
      This also removes class property "args" and "error", because these are
      certainly initialized in "revsetalias.__init__".
      aac4a1a7
    • Katsunori FUJIWARA's avatar
      revset: introduce "_parsealiasdecl" to parse alias declarations strictly · 0a7fd54d
      Katsunori FUJIWARA authored
      This patch introduces "_parsealiasdecl" to parse alias declarations
      strictly. For example, "_parsealiasdecl" can detect problems below,
      which current implementation can't.
      
        - un-closed parenthesis causes being treated as "alias symbol"
      
          because all of declarations not in "func(....)" style are
          recognized as "alias symbol".
      
          for example, "foo($1, $2" is treated as the alias symbol.
      
        - alias symbol/function names aren't examined whether they are valid
          as symbol or not
      
          for example, "foo bar" can be treated as the alias symbol, but of
          course such invalid symbol can't be referred in revset.
      
        - just splitting argument list by "," causes overlooking syntax
          problems in the declaration
      
          for example, all of invalid declarations below are overlooked:
      
          - foo("bar")     => taking one argument named as '"bar"'
          - foo("unclosed) => taking one argument named as '"unclosed'
          - foo(bar::baz)  => taking one argument named as 'bar::baz'
          - foo(bar($1))   => taking one argument named as 'bar($1)'
      
      To decrease complication of patch, current implementation for alias
      declarations is replaced by "_parsealiasdecl" in the subsequent
      patch. This patch just introduces it.
      
      This patch defines "_parsealiasdecl" not as a method of "revsetalias"
      class but as a one of "revset" module, because of ease of testing by
      doctest.
      
      This patch factors some helper functions for "tree" out, because:
      
        - direct accessing like "if tree[0] == 'func' and len(tree) > 1"
          decreases readability
      
        - subsequent patch (and also existing code paths, in the future) can
          use them for readability
      
      This patch also factors "_tokenizealias" out, because it can be used
      also for parsing alias definitions strictly.
      0a7fd54d
    • Katsunori FUJIWARA's avatar
      revset: store full detail into revsetalias.error for error source distinction · ddf2172e
      Katsunori FUJIWARA authored
      Before this patch, any errors in the declaration of revset alias
      aren't detected at all, and there is no information about error source
      in the error message.
      
      As a part of preparation for parsing alias declarations and
      definitions more strictly, this patch stores full detail into
      "revsetalias.error" for error source distinction.
      
      This makes raising "Abort" and warning potential errors just use
      "revsetalias.error" without any message composing.
      ddf2172e
    • Katsunori FUJIWARA's avatar
      revset: factor out composing error message for ParseError to reuse · c4d0c3d0
      Katsunori FUJIWARA authored
      This patch defines the composing function not in "ParseError" class but
      in "revset" module, because:
      
        - "_()" shouldn't be used in "ParseError", to avoid adding "from
          i18n import _" i18n" to "error" module
      
        - generalizing message composition of"ParseError" for all code paths
          other than revset isn't the purpose of this patch
      
          we should also take care of showing "unexpected leading
          whitespace" for some code paths, to generalize widely.
      c4d0c3d0
    • Katsunori FUJIWARA's avatar
      revset: make tokenize extensible to parse alias declarations and definitions · 91dbb98b
      Katsunori FUJIWARA authored
      Before this patch, "tokenize" doesn't recognize the symbol starting
      with "$" as a valid one.
      
      This prevents revset alias declarations and definitions from being
      parsed with "tokenize", because "$" may be used as the initial letter
      of alias arguments.
      
      BTW, the alias argument name doesn't require leading "$" itself, in
      fact. But we have to assume that users may use "$" as the initial
      letter of argument names in their aliases, because examples in "hg
      help revsets" uses such names for a long time.
      
      To make "tokenize" extensible to parse alias declarations and
      definitions, this patch introduces optional arguments "syminitletters"
      and "symletters". Giving these sets can change the policy of "valid
      symbol" in tokenization easily.
      
      This patch keeps original examination of letter validity for
      reviewability, even though there is redundant interchanging between
      "chr"/"ord" at initialization of "_syminitletters" and "_symletters".
      At most 256 times examination (per initialization) is cheaper enough
      than revset evaluation itself.
      
      This patch is a part of preparation for parsing alias declarations and
      definitions more strictly.
      91dbb98b
  14. Jan 09, 2015
    • Mads Kiilerich's avatar
      largefiles: make linear update set unsure largefiles normal if unchanged · 9d25bb84
      Mads Kiilerich authored
      'hg update' would hash all 'unsure' largefiles before performing the merge. It
      would update the standins but not detect the very common case where the
      largefile never had been changed by the user but just had been marked with an
      invalid dirstate mtime to make sure any changes done by the user in the same
      second would be detected. The largefile would remain in that state and would
      have to be hashed again next time even though it still not had been changed.
      Sad trombone.
      
      Instead, for largefiles listed as 'unsure' or 'modified', after updating the
      standin with the actual hash, mark the largefile as normal if it turns out to
      not be modified relative to the revision in the parent revision. That will
      prevent it from being hashed again next time.
      9d25bb84
    • Mads Kiilerich's avatar
      debugdirstate: don't hide date field with --nodate, just show 'set'/'unset' · ddc17eaf
      Mads Kiilerich authored
      The value of the dirstate date field cannot be used in tests and we thus have
      to use debugdirstate with --nodate. It is however still very helpful to be able
      to see whether the date field has been set or still is unset. The absence of
      that information made it hard to debug some largefile dirstate issues.
      
      This change _could_ make the test suite more unstable ... but that would be
      places where the test suite or the code should be made more stable. (Note:
      'unset' with the magic negative sizes is reliable. 'unset' for normal sizes
      would probably not be reliable, but there is no such occurrences in the test
      suite and it should thus be reliable.)
      
      This output wastes more horizontal space in the --nodate output, but it also
      makes things simpler that the output format always is the same. It is just a
      debug command so let's keep it simple.
      ddc17eaf
    • Mads Kiilerich's avatar
  15. Jan 12, 2015
Loading