Skip to content
Snippets Groups Projects
  1. Mar 29, 2016
    • Katsunori FUJIWARA's avatar
      keyword: use templatefilter to mark a function as template filter · 9a6fa1d93bc8
      Katsunori FUJIWARA authored
      This patch also adds test for filter 'svnisodate' and 'svnutcdate' for
      safety, because there is no test using them, yet.
      9a6fa1d93bc8
    • Katsunori FUJIWARA's avatar
      templatefilters: use templatefilter to mark a function as template filter · 11f623b5668f
      Katsunori FUJIWARA authored
      Using decorator can localize changes for adding (or removing) a
      template filter function in source code.
      
      This patch also removes leading ":FILTER:" part in help document of
      each filters, because using templatefilter makes it useless.
      
      This patch uses not 'filter' but 'templatefilter' as a decorator name,
      because the former name hides Python built-in one, even though the
      latter is a little redundant in 'templatefilters.py'.
      11f623b5668f
    • Katsunori FUJIWARA's avatar
      registrar: add templatefilter to mark a function as template filter (API) · 6b3b958daf03
      Katsunori FUJIWARA authored
      This patch also adds loadfilter() to templatefilters, because this
      combination helps to figure out how they cooperate with each other.
      
      Listing up loadfilter() in dispatch.extraloaders causes implicit
      loading template filter functions at loading (3rd party) extension.
      
      This change requires that "templatefilter" attribute of (3rd party)
      extension is registrar.templatefilter or so.
      6b3b958daf03
  2. Feb 14, 2016
    • Yuya Nishihara's avatar
      revset: inline _getaliasarg() function · a04baf9c063b
      Yuya Nishihara authored
      This function is now much simpler than before. Inlining small functions helps
      to extract a reusable alias processor.
      a04baf9c063b
    • Yuya Nishihara's avatar
      revset: drop redundant check for unknown alias arguments · b56bf98c8afb
      Yuya Nishihara authored
      Since _parsealiasdefn() rejects unknown alias arguments, _checkaliasarg() is
      unnecessary. New test is added to make sure unknown '$n' symbols are rejected.
      b56bf98c8afb
    • Yuya Nishihara's avatar
      revset: move tagging of alias arguments from tokenization to parsing phase · a14732e08fec
      Yuya Nishihara authored
      In short, this patch moves the hack from tokenizedefn() to _relabelaliasargs(),
      which is called after parsing. This change aims to eliminate tight dependency
      on the revset tokenizer.
      
      Before this patch, we had to rewrite an alias argument to a pseudo function:
      
        "$1" -> "_aliasarg('$1')"
        ('symbol', '$1') -> ('function', ('symbol', '_aliasarg'), ('string', '$1'))
      
      This was because the tokenizer must generate tokens that are syntactically
      valid. By moving the process to the parsing phase, we can assign a unique tag
      to an alias argument.
      
        ('symbol', '$1') -> ('_aliasarg', '$1')
      
      Since new _aliasarg node never be generated from a user input, we no longer
      have to verify a user input at findaliases(). The test for _aliasarg("$1") is
      removed as it is syntactically valid and should pass the parsing phase.
      a14732e08fec
    • Yuya Nishihara's avatar
      revset: add test that should fail if '_aliasarg' tag is removed · 3e0d03c3c594
      Yuya Nishihara authored
      I'm going to refactor the alias processing functions. We need '_aliasarg' tag
      to limit the scope of the alias expansion, but it wasn't covered by the test.
      This patch adds the test that should fail if '_aliasarg' were 'symbol'.
      
      This is the first half of the second part of the "template alias" series. The
      whole series will consist of the following parts:
      
       1. make parsed template tree to be compatible with parser functions
          (1d461ee26e1b and 73d01cba5810)
       2. refactor alias processing to be less dependent on revset module
          (1/2 in this series)
       3. extract reusable component to parser module
       4. clean up it
       5. extend it to support template syntax
       6. add debugging/testing functions of template aliases
       7. add alias expansion routine to templater
      3e0d03c3c594
  3. Mar 27, 2016
  4. Mar 29, 2016
  5. Mar 28, 2016
  6. Mar 29, 2016
  7. Mar 26, 2016
    • Martin von Zweigbergk's avatar
      bundle: avoid crash when no good changegroup version found · c4b727795d6a
      Martin von Zweigbergk authored
      When using treemanifests, only changegroup3 bundles can be
      created. However, there is currently no way of requesting a
      changegroup3 bundle, so we run into an assertion in
      changegroup.getbundler() when trying to get a changroup2
      bundler. Let's avoid the traceback and print a short error message
      instead.
      c4b727795d6a
  8. Mar 25, 2016
  9. Mar 28, 2016
    • Martin von Zweigbergk's avatar
      bundle: move writebundle() from changegroup.py to bundle2.py (API) · ae53ecc47414
      Martin von Zweigbergk authored
      writebundle() writes a bundle2 bundle or a plain changegroup1. Imagine
      away the "2" in "bundle2.py" for a moment and this change should makes
      sense. The bundle wraps the changegroup, so it makes sense that it
      knows about it. Another sign that this is correct is that the delayed
      import of bundle2 in changegroup goes away.
      
      I'll leave it for another time to remove the "2" in "bundle2.py"
      (alternatively, extract a new bundle.py from it).
      ae53ecc47414
  10. Mar 29, 2016
  11. Mar 23, 2016
  12. Mar 21, 2016
    • Mateusz Kwapich's avatar
      subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC) · 34d43cb85de8
      Mateusz Kwapich authored
      CVE-2016-3068 (1/1)
      
      Git's git-remote-ext remote helper provides an ext:: URL scheme that
      allows running arbitrary shell commands. This feature allows
      implementing simple git smart transports with a single shell shell
      command. However, git submodules could clone arbitrary URLs specified
      in the .gitmodules file. This was reported as CVE-2015-7545 and fixed
      in git v2.6.1.
      
      However, if a user directly clones a malicious ext URL, the git client
      will still run arbitrary shell commands.
      
      Mercurial is similarly effected. Mercurial allows specifying git
      repositories as subrepositories. Git ext:: URLs can be specified as
      Mercurial subrepositories allowing arbitrary shell commands to be run
      on `hg clone ...`.
      
      
      The Mercurial community would like to thank Blake Burkhart for
      reporting this issue. The description of the issue is copied from
      Blake's report.
      
      This commit changes submodules to pass the GIT_ALLOW_PROTOCOL env
      variable to git commands  with the same list of allowed protocols that
      git submodule is using.
      
      When the GIT_ALLOW_PROTOCOL env variable is already set, we just pass it
      to git without modifications.
      34d43cb85de8
  13. Mar 17, 2016
  14. Mar 28, 2016
Loading