summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm/adapters/mercurial_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix RuboCop offense Style/RedundantArrayConstructor (#36919).Go MAEDA2023-06-071-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22252 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Lint/MissingSuper (#36919).Go MAEDA2023-03-241-5/+0
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22147 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year to 2023 (#38141).Go MAEDA2023-01-011-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22013 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Support revision without any message in Mercurial repositories (#36258).Go MAEDA2022-09-011-1/+1
| | | | | | | Patch by salman mp and Yuichi HARADA. git-svn-id: https://svn.redmine.org/redmine/trunk@21792 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Typo in method names: s/trailling/trailing/ (#37586).Go MAEDA2022-08-281-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@21785 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year in source files to 2022 (#36379).Go MAEDA2022-01-021-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@21342 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Stricter validation of given revisions of repositories (#35085).Go MAEDA2021-04-231-0/+9
| | | | | | | Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@20962 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year in source files to 2021 (#33069).Go MAEDA2021-03-251-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20846 e93f8b46-1217-0410-a6f0-8f06a7374b81
* fix source indent of lib/redmine/scm/adapters/mercurial_adapter.rbToshi MARUYAMA2020-12-021-4/+5
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20537 e93f8b46-1217-0410-a6f0-8f06a7374b81
* fix source indent of lib/redmine/scm/adapters/mercurial_adapter.rbToshi MARUYAMA2020-10-281-7/+7
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20223 e93f8b46-1217-0410-a6f0-8f06a7374b81
* fix source indent of lib/redmine/scm/adapters/mercurial_adapter.rbToshi MARUYAMA2020-09-121-4/+4
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20022 e93f8b46-1217-0410-a6f0-8f06a7374b81
* remove spaces inside {} of lib/redmine/scm/adapters/mercurial_adapter.rbToshi MARUYAMA2020-08-071-6/+6
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@19945 e93f8b46-1217-0410-a6f0-8f06a7374b81
* add empty line after guard clause to MercurialAdapterToshi MARUYAMA2020-07-211-0/+4
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@19926 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: escape branch and tag names (#27790)Toshi MARUYAMA2020-05-081-8/+10
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@19765 e93f8b46-1217-0410-a6f0-8f06a7374b81
* remove extra empty line at beginning of ↵Toshi MARUYAMA2020-05-081-1/+0
| | | | | | lib/redmine/scm/adapters/mercurial_adapter.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19760 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: change template "escape" to "urlescape" for "author" and ↵Toshi MARUYAMA2020-03-221-6/+8
| | | | | | "desc" (#23055) git-svn-id: http://svn.redmine.org/redmine/trunk@19606 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year in source files to 2020 (#33069).Go MAEDA2020-03-031-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@19553 e93f8b46-1217-0410-a6f0-8f06a7374b81
* cleanup: rubocop: fix Style/MultilineBlockChain in ↵Toshi MARUYAMA2019-11-081-1/+2
| | | | | | lib/redmine/scm/adapters/mercurial_adapter.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18957 e93f8b46-1217-0410-a6f0-8f06a7374b81
* cleanup: rubocop: fix Layout/SpaceInsideParens in ↵Toshi MARUYAMA2019-11-081-1/+1
| | | | | | lib/redmine/scm/adapters/mercurial_adapter.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18956 e93f8b46-1217-0410-a6f0-8f06a7374b81
* cleanup: rubocop: fix Style/RescueModifier in ↵Toshi MARUYAMA2019-11-081-1/+6
| | | | | | lib/redmine/scm/adapters/mercurial_adapter.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18946 e93f8b46-1217-0410-a6f0-8f06a7374b81
* code cleanup: rubocop: fix Lint/HandleExceptions in ↵Toshi MARUYAMA2019-09-121-0/+3
| | | | | | lib/redmine/scm/adapters/mercurial_adapter.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18458 e93f8b46-1217-0410-a6f0-8f06a7374b81
* code cleanup: rubocop: fix Lint/AmbiguousOperator in ↵Toshi MARUYAMA2019-09-121-1/+1
| | | | | | lib/redmine/scm/adapters/mercurial_adapter.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18456 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year.Go MAEDA2019-05-251-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@18198 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Don't rescue Exception class (#31387).Go MAEDA2019-05-251-1/+1
| | | | | | | Patch by Go MAEDA and Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@18197 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use Regexp#match? to reduce allocations of MatchData object (#28940).Go MAEDA2019-03-271-2/+2
| | | | | | | Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@18011 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use #b shortcut instead of #force_encoding (#31059).Go MAEDA2019-03-201-3/+2
| | | | | | | Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@17992 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Support frozen_string_literal in lib/**/*.rb (#26561).Go MAEDA2019-03-171-1/+1
| | | | | | | Contributed by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@17988 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add "frozen_string_literal: false" for all files (#26561).Go MAEDA2019-03-151-0/+2
| | | | | | | This will be changed to true in the future. git-svn-id: http://svn.redmine.org/redmine/trunk@17947 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Replace Enumerable#sort with faster Enumerable#sort_by (#29299).Go MAEDA2018-08-021-1/+1
| | | | | | | Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17462 e93f8b46-1217-0410-a6f0-8f06a7374b81
* mercurial: work around faulty parsing of early command options (#27516)Toshi MARUYAMA2017-12-071-13/+14
| | | | | | | | | Use -sVALUE and --long=VALUE instead of "-s VALUE" and "--long VALUE" respectively. Contributed by Yuya Nishihara. git-svn-id: http://svn.redmine.org/redmine/trunk@17062 e93f8b46-1217-0410-a6f0-8f06a7374b81
* mercurial: separate command options and positional arguments with "--" (#27516)Toshi MARUYAMA2017-12-071-5/+5
| | | | | | | | | | We don't have much problems here thanks to hgtarget(path) and CGI.escape(), which prepends a repository path and encodes "=" character respectively, but it's better to not rely on the side effect of these functions. Contributed by Yuya Nishihara. git-svn-id: http://svn.redmine.org/redmine/trunk@17061 e93f8b46-1217-0410-a6f0-8f06a7374b81
* mercurial: reject malicious command argument (#27516)Toshi MARUYAMA2017-12-071-0/+15
| | | | | | | | | | | | | | | | | | | | | | We've got a security report from the Phabricator team, which basically says --config and --debugger arguments can be injected anywhere to lead to an arbitrary command execution. https://secure.phabricator.com/rPa7921a4448093d00defa8bd18f35b8c8f8bf3314 This is a fundamental issue of the argument parsing rules in Mercurial, which allows extensions to populate their parsing rules and such extensions can be loaded by "--config extensions.<name>=". There's a chicken and egg problem. We're working on hardening the parsing rules, but which won't come in by default as it would be a behavior change. This patch adds a verification to reject malicious command arguments as a last ditch. The subsequent patches will fix the problem in more appropriate way. Contributed by Yuya Nishihara. git-svn-id: http://svn.redmine.org/redmine/trunk@17060 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright.Jean-Philippe Lang2017-06-251-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@16685 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Updates copyright for 2016.Jean-Philippe Lang2016-03-131-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@15238 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Copyright update.Jean-Philippe Lang2015-01-111-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@13872 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Merged rails-4.1 branch (#14534).Jean-Philippe Lang2014-10-221-17/+5
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@13482 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: use long id in adapter level (#14361)Toshi MARUYAMA2014-02-021-2/+2
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@12761 e93f8b46-1217-0410-a6f0-8f06a7374b81
* back out r12752 (#14361)Toshi MARUYAMA2014-02-011-2/+2
| | | | | | Revision, Author and Comment of repository browser are broken. git-svn-id: http://svn.redmine.org/redmine/trunk@12753 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: use long id in adapter level (#14361)Toshi MARUYAMA2014-02-011-2/+2
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@12752 e93f8b46-1217-0410-a6f0-8f06a7374b81
* update copyright year (#15977)Toshi MARUYAMA2014-01-291-1/+1
| | | | | | Contributed by Daniel Felix. git-svn-id: http://svn.redmine.org/redmine/trunk@12736 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Copyright for 2013 (#12788).Jean-Philippe Lang2013-01-121-1/+1
| | | | | | Patch by Daniel Felix. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11169 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Copyright update.Jean-Philippe Lang2012-05-051-1/+1
| | | | git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9636 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Removes the XML declaration that breaks the parser with JRuby.Jean-Philippe Lang2012-04-261-3/+3
| | | | git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9534 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: lib: return array of Branch class instead of array of ↵Toshi MARUYAMA2011-10-281-1/+8
| | | | | | strings at branches method (#5501) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7673 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: lib: add parents to Revision class (#5501)Toshi MARUYAMA2011-10-281-1/+6
| | | | git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7666 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: drop supporting below Mercurial 1.1 (#9465)Toshi MARUYAMA2011-10-251-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On November 1st 2011, Mercurial 2.0 will be released. On Mercurial 1.1.2, unit lib test fails with following error. <pre> Traceback (most recent call last): File "/WEB-DOWN/hg-repo/hg-crew/hg", line 20, in <module> mercurial.dispatch.run() File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 20, in run sys.exit(dispatch(sys.argv[1:])) File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 29, in dispatch return _runcatch(u, args) File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 45, in _runcatch return _dispatch(ui, args) File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 367, in _dispatch ret = _runcommand(ui, options, cmd, d) File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 416, in _runcommand return checkargs() File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 376, in checkargs return cmdfunc() File "/WEB-DOWN/hg-repo/hg-crew/mercurial/dispatch.py", line 361, in <lambda> d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/WEB-DOWN/hg-repo/hg-crew/mercurial/util.py", line 715, in check return func(*args, **kwargs) File "/REDMINE-1/hg-workdir/redmine-bb-all/lib/redmine/scm/adapters/mercurial/redminehelper.py", line 149, in rhlog if hg.util.version() >= '1.6': AttributeError: 'module' object has no attribute 'version' 1) Error: test_nodes_in_branch(MercurialAdapterTest): Redmine::Scm::Adapters::MercurialAdapter::HgCommandAborted: hg exited with non-zero status: 1 lib/redmine/scm/adapters/mercurial_adapter.rb:306:in `hg' lib/redmine/scm/adapters/mercurial_adapter.rb:234:in `nodes_in_branch' test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb:311:in `test_nodes_in_branch' test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb:304:in `each' test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb:304:in `test_nodes_in_branch' </pre> git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7650 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: use self.class.sq_bin for command name at adpter scm_cmd() ↵Toshi MARUYAMA2011-07-151-2/+5
| | | | | | (#8825). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6279 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: use "shell_quote_command" method at adapter for JRuby + ↵Toshi MARUYAMA2011-07-151-1/+1
| | | | | | Windows command name (#8825). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6278 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: catch exception and return nil during getting info (#8777).Toshi MARUYAMA2011-07-111-0/+4
| | | | git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6245 e93f8b46-1217-0410-a6f0-8f06a7374b81
* scm: mercurial: fix unit adapter annotate test fails on Windows Mercurial ↵Toshi MARUYAMA2011-06-101-1/+2
| | | | | | 1.8.4+29-e597ef52a7c2. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6042 e93f8b46-1217-0410-a6f0-8f06a7374b81