Skip to content
Snippets Groups Projects
  1. Dec 03, 2015
    • Pierre-Yves David's avatar
      context: use a the nofsauditor when matching file in history (issue4749) · 15c6eb0a51bd
      Pierre-Yves David authored
      Before this change, asking for file from history (eg: 'hg cat -r 42 foo/bar')
      could fail because of the current content of the working copy (eg: current
      "foo" being a symlink). As the working copy state have no influence on the
      content of the history, we can safely skip these checks.
      
      The working copy context class have a different 'match'
      implementation. That implementation still use the repo.auditor will
      still catch symlink traversal.
      
      I've audited all stuff calling "match" and they all go through a ctx
      in a sensible way. The most unclear case was diff which still seemed
      okay. You raised my paranoid level today and I double checked through
      tests. They behave properly.
      
      The odds of someone using the wrong (matching with a changectx for
      operation that will eventually touch the file system) is non-zero
      because you are never sure of what people will do. But I dunno if we
      can fight against that. So I would not commit to "never" for "at this
      level" and "in the future" if someone write especially bad code.
      
      However, as a last defense, the vfs itself is running path auditor in
      all cases outside of .hg/. So I think anything passing the 'matcher'
      for buggy reason would growl at the vfs layer.
      15c6eb0a51bd
  2. Jan 30, 2013
  3. Jan 10, 2013
  4. Jan 07, 2013
    • kiilerix's avatar
      dispatch: show empty filename in OSError aborts · 720308f741cb
      kiilerix authored
      Mercurial would sometimes exit with:
        abort: No such file or directory
      where str of the actual OSError exception was the more helpful:
        [Errno 2] No such file or directory: ''
      
      The exception will now always show the filename and quote it:
        abort: No such file or directory: ''
      720308f741cb
  5. Jun 10, 2012
    • kiilerix's avatar
      tests: add missing trailing 'cd ..' · f2719b387380
      kiilerix authored
      Many tests didn't change back from subdirectories at the end of the tests ...
      and they don't have to. The missing 'cd ..' could always be added when another
      test case is added to the test file.
      
      This change do that tests (99.5%) consistently end up in $TESTDIR where they
      started, thus making it simpler to extend them or move them around.
      f2719b387380
    • kiilerix's avatar
      tests: convert some 'hghave symlink' to #if · 6a997aacba5d
      kiilerix authored
      This will enable some tests for windows.
      6a997aacba5d
  6. Apr 03, 2012
  7. Nov 16, 2011
  8. Nov 07, 2011
  9. Apr 30, 2011
  10. Apr 07, 2011
  11. Oct 09, 2010
  12. Sep 30, 2010
    • Erik Zielke's avatar
      tests: removed test names in tests · e3247ceaca5e
      Erik Zielke authored
      The name of the test files is replaced with a glob * expression,
      thereby the tests does not depend on the filename of the file they are
      in.
      e3247ceaca5e
  13. Sep 22, 2010
    • Brodie Rao's avatar
      tests: add glob matching for unified tests · 97ffc68f71d3
      Brodie Rao authored
      This adds a " (glob)" marker that works like a simpler version of
      (re): "*" is converted to ".*", and "?" is converted to ".".
      
      Both special characters can be escaped using "\", and the backslash
      itself can be escaped as well.
      
      Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't
      supported.
      97ffc68f71d3
    • Brodie Rao's avatar
      tests: require regexes in unified tests to be marked with " (re)" · 02990e22150b
      Brodie Rao authored
      Consider this test:
      
        $ hg glog --template '{rev}:{node|short} "{desc}"\n'
        @  2:20c4f79fd7ac "3"
        |
        | o  1:38f24201dcab "2"
        |/
        o  0:2a18120dc1c9 "1"
      
      Because each line beginning with "|" can be compiled as a regular
      expression (equivalent to ".*|"), they will match any output.
      
      Similarly:
      
        $ echo foo
      
      
      The blank output line can be compiled as a regular expression and will
      also match any output.
      
      With this patch, none of the above output lines will be matched as
      regular expressions. A line must end in " (re)" in order to be matched
      as one.
      
      Lines are still matched literally first, so the following will pass:
      
        $ echo 'foo (re)'
        foo (re)
      02990e22150b
    • Brodie Rao's avatar
      tests: improve regexes in unified tests · 5163e3c8aa52
      Brodie Rao authored
      5163e3c8aa52
  14. Sep 17, 2010
  15. Sep 16, 2010
  16. Aug 14, 2010
  17. Jan 22, 2009
  18. Jan 04, 2009
  19. Dec 30, 2008
  20. Aug 10, 2007
    • Bryan O'Sullivan's avatar
      Make audit_path more stringent. · d316124ebbea
      Bryan O'Sullivan authored
      The following properties of a path are now checked for:
      
          - under top-level .hg
          - starts at the root of a windows drive
          - contains ".."
          - traverses a symlink (e.g. a/symlink_here/b)
          - inside a nested repository
      
      If any of these is true, the path is rejected.
      
      The check for traversing a symlink is arguably stricter than necessary;
      perhaps we should be checking for symlinks that point outside the
      repository.
      d316124ebbea
Loading