]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: drop supporting below Mercurial 1.1 (#9465)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 25 Oct 2011 06:10:12 +0000 (06:10 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 25 Oct 2011 06:10:12 +0000 (06:10 +0000)
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

lib/redmine/scm/adapters/mercurial/hg-template-0.9.5.tmpl [deleted file]
lib/redmine/scm/adapters/mercurial_adapter.rb
test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb

diff --git a/lib/redmine/scm/adapters/mercurial/hg-template-0.9.5.tmpl b/lib/redmine/scm/adapters/mercurial/hg-template-0.9.5.tmpl
deleted file mode 100644 (file)
index 3cf584a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-changeset = 'This template must be used with --debug option\n'
-changeset_quiet =  'This template must be used with --debug option\n'
-changeset_verbose = 'This template must be used with --debug option\n'
-changeset_debug = '<logentry revision="{rev}" node="{node|short}">\n<author>{author|escape}</author>\n<date>{date|isodate}</date>\n<paths>\n{files}{file_adds}{file_dels}{file_copies}</paths>\n<msg>{desc|escape}</msg>\n{tags}</logentry>\n\n'
-
-file = '<path action="M">{file|urlescape}</path>\n'
-file_add = '<path action="A">{file_add|urlescape}</path>\n'
-file_del = '<path action="D">{file_del|urlescape}</path>\n'
-file_copy = '<path-copied copyfrom-path="{source|urlescape}">{name|urlescape}</path-copied>\n'
-tag = '<tag>{tag|escape}</tag>\n'
-header='<?xml version="1.0" encoding="UTF-8" ?>\n<log>\n\n'
-# footer="</log>"
\ No newline at end of file
index 3d8ef617a1aef81b207f5125b201e5da904f450b..53f24735c0d7ff5c7661b76ac7e829785c90783a 100644 (file)
@@ -47,7 +47,7 @@ module Redmine
           end
 
           def client_available
-            client_version_above?([0, 9, 5])
+            client_version_above?([1, 2])
           end
 
           def hgversion
@@ -72,12 +72,7 @@ module Redmine
           end
 
           def template_path_for(version)
-            if ((version <=> [0,9,5]) > 0) || version.empty?
-              ver = "1.0"
-            else
-              ver = "0.9.5"
-            end
-            "#{HELPERS_DIR}/#{TEMPLATE_NAME}-#{ver}.#{TEMPLATE_EXTENSION}"
+            "#{HELPERS_DIR}/#{TEMPLATE_NAME}-1.0.#{TEMPLATE_EXTENSION}"
           end
         end
 
index 4c946ba22c17efae4283b848e1770297ad1b3b3d..10a78c4afbba7ec0552d934024994fe6031c3db9 100644 (file)
@@ -53,12 +53,14 @@ begin
       end
 
       def test_template_path
-        to_test = { [0,9,5]  => "0.9.5",
-                    [1,0]    => "1.0",
+        to_test = {
+                    [1,2]    => "1.0",
                     []       => "1.0",
-                    [1,0,1]  => "1.0",
+                    [1,2,1]  => "1.0",
                     [1,7]    => "1.0",
-                    [1,7,1]  => "1.0" }
+                    [1,7,1]  => "1.0",
+                    [2,0]    => "1.0",
+                   }
         to_test.each do |v, template|
           test_template_path_for(v, template)
         end